* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
    padding: 10px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* HEADER SISMA */
header {
    background: linear-gradient(135deg, #1b5e20, #388e3c);
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
}

header .header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

header .header-top img { height: 40px; }
header .header-top h1 { font-size: 20px; margin: 0; letter-spacing: 1px; }
header .header-top h1 .green { color: #81c784; }
header .header-top .sub { font-size: 11px; opacity: 0.85; }
header .header-top .user-info {
    font-size: 12px; opacity: 0.9; margin-left: auto;
}
header .header-top .user-info a { color: white; }

/* CARDS */
.card {
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    padding: 12px 15px;
}

.card h2 {
    font-size: 14px;
    color: #1b5e20;
    border-bottom: 2px solid #e8f5e9;
    padding-bottom: 6px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* FORM - mobile first */
.form-group { margin-bottom: 8px; }
.form-group label { display: block; font-weight: 600; font-size: 12px; color: #555; margin-bottom: 2px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px;
    font-size: 14px; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { border-color: #2e7d32; }

/* INFO TABLE mobile */
.info-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.info-table td { padding: 4px 6px; border: 1px solid #ddd; font-size: 12px; }
.info-table td:first-child { font-weight: 600; background: #f5f5f5; width: 60px; }
.info-table input { border: none !important; font-size: 13px !important; padding: 2px !important; width: 100% !important; }

/* ITEMS - mobile optimized */
.item-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    padding: 8px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 6px;
}

.item-row select, .item-row input {
    padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 12px;
}

.categoria-select { width: 100%; margin-bottom: 3px; }
.producto-select { flex: 1; min-width: 140px; }
.cantidad-input { width: 50px; text-align: center; }
.precio-item {
    background: transparent !important; border: none !important;
    font-weight: 700; color: #1b5e20; text-align: right;
    width: 90px; font-size: 13px;
}

.btn-add {
    background: #e8f5e9; color: #1b5e20; border: 2px dashed #4caf50;
    padding: 8px; border-radius: 6px; cursor: pointer; font-size: 13px;
    width: 100%; margin-top: 5px;
}

.btn-remove {
    background: #ffebee; color: #c62828; border: none;
    width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
    font-size: 14px; display: flex; align-items: center; justify-content: center;
}

/* RESUMEN */
.resumen-box {
    background: #f1f8e9; border: 1px solid #c8e6c9; border-radius: 6px;
    padding: 10px; margin-top: 10px;
}

.resumen-row {
    display: flex; justify-content: flex-end;
    padding: 3px 0; font-size: 13px;
}

.resumen-row .label { font-weight: 600; width: 120px; text-align: right; margin-right: 10px; }
.resumen-row .value { width: 100px; text-align: right; font-family: monospace; }
.resumen-row.total {
    font-size: 16px; font-weight: 700; color: #1b5e20;
    border-top: 2px solid #2e7d32; padding-top: 6px; margin-top: 6px;
}

/* BOTON */
.btn-submit {
    background: linear-gradient(135deg, #1b5e20, #388e3c);
    color: white; padding: 12px 20px; border: none; border-radius: 8px;
    font-size: 16px; cursor: pointer; width: 100%; font-weight: 600;
    margin-top: 10px;
}

/* FOOTER */
.site-footer {
    background: #1b5e20; color: white; padding: 10px 15px;
    border-radius: 0 0 8px 8px; font-size: 11px; text-align: center; line-height: 1.6;
}

/* NOTAS */
.notas-box {
    background: #f5f5f5; border-left: 3px solid #2e7d32;
    padding: 8px 10px; font-size: 12px; color: #555; white-space: pre-wrap;
    border-radius: 0 4px 4px 0;
}

/* LOGIN */
.login-wrapper {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 20px;
    background: linear-gradient(135deg, #1b5e20, #388e3c);
}
.login-box {
    background: white; border-radius: 12px; padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); width: 360px; max-width: 100%;
    text-align: center;
}
.login-box img { height: 45px; margin-bottom: 8px; }
.login-box h1 { color: #1b5e20; margin: 0; font-size: 22px; }
.login-box .subtitle { color: #666; font-size: 12px; margin-bottom: 20px; }
.login-box input {
    width: 100%; padding: 10px; margin-bottom: 10px;
    border: 1px solid #ccc; border-radius: 6px; font-size: 14px;
}
.login-box button {
    width: 100%; padding: 10px;
    background: linear-gradient(135deg, #1b5e20, #388e3c);
    color: white; border: none; border-radius: 6px; font-size: 15px; cursor: pointer; font-weight: 600;
}
.login-box .error {
    background: #ffebee; color: #c62828; padding: 8px; border-radius: 6px;
    margin-bottom: 10px; font-size: 13px;
}
.login-box .footer { font-size: 11px; color: #999; margin-top: 15px; border-top: 1px solid #eee; padding-top: 12px; }

/* MOBILE ONLY */
@media (max-width: 480px) {
    body { padding: 5px; }
    header { padding: 10px; }
    header .header-top img { height: 30px; }
    header .header-top h1 { font-size: 16px; }
    header .header-top .user-info { font-size: 10px; width: 100%; text-align: center; margin-top: 5px; }
    .card { padding: 10px; }
    .card h2 { font-size: 12px; }
    .item-row { padding: 6px; }
    .categoria-select { font-size: 11px; }
    .producto-select { min-width: 100px; font-size: 11px; }
    .precio-item { width: 70px; font-size: 11px; }
    .resumen-row .label { width: 80px; font-size: 12px; }
    .resumen-row .value { width: 80px; font-size: 12px; }
    .resumen-row.total { font-size: 14px; }
    .login-box { padding: 20px; }
}
