/* ========== GOOGLE FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { margin:0; padding:0; box-sizing:border-box; font-family: 'Inter', 'Segoe UI', Arial, sans-serif; }
body { background:#f4f6f9; color:#1f2937; }

/* ---------- Auth pages (login/register) ---------- */
.auth-wrap {
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    background-image: url('bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Dark overlay on background so text is readable */
.auth-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 0;
}

.auth-box {
    background: rgba(15, 15, 25, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding:36px 40px;
    border-radius:16px;
    width:100%;
    max-width:420px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
    position: relative;
    z-index: 1;
}

.auth-box h2 {
    margin-bottom:6px;
    color: #ffffff;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.auth-box p.sub {
    color: #a5b4fc;
    margin-bottom:24px;
    font-size:14px;
}

.auth-box label {
    display:block;
    margin:16px 0 6px;
    font-size:13px;
    font-weight:600;
    color: #e2e8f0;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.auth-box input,
.auth-box select {
    width:100%;
    padding:11px 14px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius:8px;
    font-size:14px;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    outline: none;
    transition: border 0.2s;
}

.auth-box input:focus,
.auth-box select:focus {
    border-color: #818cf8;
    background: rgba(255,255,255,0.12);
}

.auth-box input::placeholder {
    color: rgba(255,255,255,0.35);
}

.auth-box button {
    width:100%;
    margin-top:22px;
    padding:13px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color:#fff;
    border:none;
    border-radius:8px;
    font-size:15px;
    font-weight:700;
    cursor:pointer;
    letter-spacing: 0.3px;
    transition: opacity 0.2s, transform 0.1s;
}

.auth-box button:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.auth-box .switch {
    text-align:center;
    margin-top:18px;
    font-size:14px;
    color: #94a3b8;
}

.auth-box .switch a {
    color: #a5b4fc;
    text-decoration:none;
    font-weight:600;
}

.auth-box .switch a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.error-msg {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
    padding:10px 12px;
    border-radius:8px;
    font-size:13px;
    margin-bottom:10px;
    border: 1px solid rgba(239,68,68,0.3);
}

.success-msg {
    background: rgba(34,197,94,0.15);
    color: #86efac;
    padding:10px 12px;
    border-radius:8px;
    font-size:13px;
    margin-bottom:10px;
    border: 1px solid rgba(34,197,94,0.3);
}

/* ---------- App layout ---------- */
.topbar {
    background: #4f46e5;
    color:#fff;
    padding:14px 20px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    position:sticky;
    top:0;
    z-index:100;
    box-shadow: 0 2px 10px rgba(79,70,229,0.4);
}

.topbar-left { display:flex; align-items:center; gap:12px; font-size:16px; font-weight: 700; }
.topbar-right { display:flex; align-items:center; gap:14px; font-size:14px; }
.btn-logout {
    color:#fff;
    background:rgba(255,255,255,0.18);
    padding:6px 14px;
    border-radius:6px;
    text-decoration:none;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.28); }
.hamburger { display:none; cursor:pointer; font-size:20px; }

.layout { display:flex; min-height:calc(100vh - 54px); }
.sidebar {
    width:220px;
    background:#1f2937;
    padding:16px 0;
    flex-shrink:0;
}

.sidebar a {
    display:block;
    padding:12px 20px;
    color:#d1d5db;
    text-decoration:none;
    font-size:14px;
    font-weight: 500;
    transition: all 0.15s;
}

.sidebar a:hover,
.sidebar a.active {
    background:#374151;
    color:#fff;
    border-left:3px solid #6366f1;
    padding-left: 17px;
}

.content { flex:1; padding:24px; overflow-x:auto; }

/* ---------- Cards / stats ---------- */
.stats-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(180px,1fr));
    gap:16px;
    margin-bottom:24px;
}

.stat-card {
    background:#fff;
    padding:18px;
    border-radius:10px;
    box-shadow:0 1px 4px rgba(0,0,0,0.06);
}

.stat-card .label { font-size:13px; color:#6b7280; font-weight: 500; }
.stat-card .value { font-size:24px; font-weight:700; margin-top:6px; }
.stat-card.green .value { color:#16a34a; }
.stat-card.red .value { color:#dc2626; }
.stat-card.blue .value { color:#2563eb; }

/* ---------- Forms & tables ---------- */
.card {
    background:#fff;
    padding:20px;
    border-radius:10px;
    box-shadow:0 1px 4px rgba(0,0,0,0.06);
    margin-bottom:20px;
}

.card h3 {
    margin-bottom:16px;
    font-size:16px;
    font-weight: 700;
    color: #1f2937;
}

.form-row { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.form-row .field { flex:1; min-width:150px; }

.field label {
    display:block;
    font-size:13px;
    font-weight:600;
    margin-bottom:5px;
    color:#374151;
}

.field input,
.field select,
.field textarea {
    width:100%;
    padding:9px 10px;
    border:1px solid #d1d5db;
    border-radius:6px;
    font-size:14px;
    color: #1f2937;
    outline: none;
    transition: border 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #6366f1;
}

.btn {
    padding:10px 20px;
    background:#4f46e5;
    color:#fff;
    border:none;
    border-radius:6px;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    text-decoration:none;
    display:inline-block;
    transition: background 0.2s;
}

.btn:hover { background:#4338ca; }
.btn-sm { padding:5px 10px; font-size:12px; }
.btn-red { background:#dc2626; }
.btn-red:hover { background:#b91c1c; }
.btn-green { background:#16a34a; }
.btn-green:hover { background:#15803d; }

table { width:100%; border-collapse:collapse; font-size:14px; }
table th, table td { padding:10px 12px; text-align:left; border-bottom:1px solid #e5e7eb; }
table th {
    background:#f9fafb;
    font-weight:700;
    color:#374151;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

table td { color: #1f2937; }

.tag {
    padding:3px 10px;
    border-radius:20px;
    font-size:12px;
    font-weight:600;
}

.tag.in, .tag.paid, .tag.present { background:#dcfce7; color:#15803d; }
.tag.out, .tag.unpaid, .tag.absent { background:#fee2e2; color:#b91c1c; }
.tag.half { background:#fef9c3; color:#a16207; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .hamburger { display:block; }
    .sidebar { position:fixed; left:-220px; top:54px; bottom:0; transition:left 0.2s; z-index:99; }
    .sidebar.open { left:0; }
    .content { padding:14px; }
    .form-row { flex-direction:column; }
    .auth-box { padding: 28px 24px; }
}
