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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

header {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    padding: 14px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.2rem;
}

header h1 a {
    color: #fff;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 44px;
    min-height: 44px;
}

.nav-toggle:hover {
    background: rgba(255,255,255,0.15);
}

nav {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 12px;
    flex-wrap: wrap;
}

nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.2s;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

nav a:hover, nav a.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

nav a.nav-logout {
    color: #ffcdd2;
}

nav a.nav-logout:hover {
    background: rgba(244,67,54,0.3);
    color: #fff;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 14px;
    color: #1a73e8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-card .label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 4px;
}

.stat-card .value.positive { color: #2e7d32; }
.stat-card .value.negative { color: #c62828; }

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 12px;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    min-height: 80px;
}

.menu-item:hover {
    background: #e3f2fd;
    border-color: #1a73e8;
    box-shadow: 0 4px 12px rgba(26,115,232,0.15);
}

.menu-item .icon {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: end;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    min-height: 44px;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: #1a73e8;
    color: #fff;
}

.btn-primary:hover { background: #1557b0; }

.btn-danger {
    background: #d32f2f;
    color: #fff;
}

.btn-danger:hover { background: #b71c1c; }

.btn-secondary {
    background: #757575;
    color: #fff;
}

.btn-secondary:hover { background: #616161; }

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    min-height: 32px;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-error {
    background: #fbe9e7;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 400px;
}

table th, table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

table th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #666;
    position: sticky;
    top: 0;
}

table tr:active td {
    background: #f0f0f0;
}

.total-row td {
    font-weight: 700;
    border-top: 2px solid #333;
    border-bottom: none;
}

footer {
    text-align: center;
    padding: 20px 16px;
    color: #999;
    font-size: 0.75rem;
}

.empty-state {
    text-align: center;
    padding: 24px;
    color: #999;
}

.empty-state .icon {
    font-size: 2rem;
    margin-bottom: 6px;
}

.net-bar {
    margin-top: 14px;
    padding: 14px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.net-bar strong {
    font-size: 0.9rem;
}

.net-bar .net-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-yes { background: #e8f5e9; color: #2e7d32; }
.badge-no { background: #f5f5f5; color: #999; }

@media (max-width: 500px) {
    .stats-grid { gap: 8px; }
    .stat-card { padding: 12px 8px; }
    .stat-card .value { font-size: 1.2rem; }
    .menu-grid { gap: 8px; }
    .menu-item { padding: 12px 8px; min-height: 70px; font-size: 0.8rem; }
    .menu-item .icon { font-size: 1.3rem; }
    .card { padding: 14px; }
    header { padding: 10px 0; }
    header h1 { font-size: 1rem; }
    .container { padding: 10px; }
    .btn { padding: 10px 18px; font-size: 0.9rem; }
    .form-group input { padding: 10px; font-size: 0.95rem; }
    .table-wrap { margin: 0; }
    table th, table td { padding: 8px 6px; font-size: 0.85rem; }
    .form-row { flex-direction: column; gap: 0; }
}

@media (max-width: 480px) {
    .nav-toggle {
        display: block;
    }

    nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.15);
    }

    nav.open {
        display: flex;
    }

    nav a {
        justify-content: center;
        padding: 10px;
        border-radius: 8px;
        font-size: 0.9rem;
    }

    .stats-grid { grid-template-columns: 1fr 1fr; }
    .menu-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 601px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .menu-grid { grid-template-columns: repeat(3, 1fr); }
}

.login-body {
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 380px;
}

.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 36px 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    text-align: center;
}

.login-icon {
    font-size: 2.8rem;
    margin-bottom: 8px;
}

.login-card h1 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 4px;
}

.login-sub {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.login-card .form-group {
    text-align: left;
}

.login-card input {
    text-align: center;
    font-size: 1.3rem;
    letter-spacing: 6px;
    font-weight: 700;
    padding: 14px;
}
