/* =============================================
   Dreamy Eyes App - Main Stylesheet
   ============================================= */

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

:root {
    --primary: #1565C0;
    --primary-dark: #0D47A1;
    --primary-light: #1976D2;
    --accent: #FF6F00;
    --success: #2E7D32;
    --danger: #C62828;
    --warning: #F57F17;
    --info: #01579B;
    --bg: #F0F4F8;
    --white: #FFFFFF;
    --text: #212529;
    --text-muted: #6c757d;
    --border: #DEE2E6;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 10px;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-dark); }

/* ===== TOP NAV ===== */
.topnav {
    background: var(--primary-dark);
    color: white;
    padding: 14px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topnav .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.topnav .brand img {
    height: 38px;
    filter: brightness(0) invert(1);
}

.topnav .nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topnav .nav-links a {
    color: rgba(255,255,255,0.85);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    transition: background 0.2s;
}

.topnav .nav-links a:hover, .topnav .nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

.topnav .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.9);
    font-size: 13px;
}

.topnav .user-info .avatar {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 15px;
}

.logout-btn {
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.3);
    cursor: pointer;
    transition: background 0.2s;
}
.logout-btn:hover { background: rgba(255,255,255,0.25); color: white; }

/* ===== SIDEBAR ===== */
.layout {
    display: flex;
    min-height: calc(100vh - 66px);
}

.sidebar {
    width: 230px;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
    min-height: calc(100vh - 66px);
}

.sidebar .menu-label {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-top: 12px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text);
    font-size: 13.5px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar a:hover {
    background: #EEF2FF;
    color: var(--primary);
    border-left-color: var(--primary-light);
}

.sidebar a.active {
    background: #EEF2FF;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar a span.icon { font-size: 16px; }

/* ===== MAIN CONTENT ===== */
.main {
    flex: 1;
    padding: 28px;
    overflow-x: hidden;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
}

.page-header p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 22px;
    margin-bottom: 22px;
    border: 1px solid var(--border);
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary-dark);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card .stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-card .stat-info .stat-number {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-info .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.stat-blue .stat-icon { background: #EEF2FF; color: var(--primary); }
.stat-green .stat-icon { background: #E8F5E9; color: var(--success); }
.stat-orange .stat-icon { background: #FFF8E1; color: var(--warning); }
.stat-red .stat-icon { background: #FFEBEE; color: var(--danger); }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #F8F9FA;
    padding: 11px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

table td {
    padding: 12px 14px;
    border-bottom: 1px solid #F0F0F0;
    vertical-align: middle;
    font-size: 13.5px;
}

table tr:hover td { background: #F9FAFB; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: #E8F5E9; color: var(--success); }
.badge-danger { background: #FFEBEE; color: var(--danger); }
.badge-warning { background: #FFF8E1; color: #E65100; }
.badge-info { background: #E3F2FD; color: var(--info); }
.badge-secondary { background: #F0F0F0; color: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #1B5E20; color: white; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #B71C1C; color: white; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #E65100; color: white; }

.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-full { width: 100%; text-align: center; display: block; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group label .req { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: 13.5px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

textarea.form-control { resize: vertical; min-height: 90px; }

select.form-control { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* ===== AUTH PAGES ===== */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0D47A1 0%, #1976D2 50%, #42A5F5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

.auth-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    padding: 40px;
    width: 100%;
    max-width: 460px;
}

.auth-box .logo-area {
    text-align: center;
    margin-bottom: 28px;
}

.auth-box .logo-area img {
    height: 50px;
    margin-bottom: 10px;
}

.auth-box .logo-area h2 {
    font-size: 18px;
    color: var(--primary-dark);
    font-weight: 700;
}

.auth-box .logo-area p {
    font-size: 13px;
    color: var(--text-muted);
}

.auth-tabs {
    display: flex;
    background: var(--bg);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tabs a {
    flex: 1;
    text-align: center;
    padding: 9px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}

.auth-tabs a.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

/* ===== LANDING PAGE ===== */
.landing-hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #0D47A1 0%, #1565C0 60%, #1976D2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: white;
}

.landing-hero img {
    height: 60px;
    filter: brightness(0) invert(1);
    margin-bottom: 16px;
}

.landing-hero h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.landing-hero p {
    font-size: 16px;
    opacity: 0.85;
    margin-bottom: 40px;
    max-width: 450px;
}

.portal-cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

.portal-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 16px;
    padding: 32px 28px;
    width: 200px;
    color: white;
    transition: all 0.2s;
    cursor: pointer;
}

.portal-card:hover {
    background: rgba(255,255,255,0.22);
    transform: translateY(-4px);
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.portal-card .portal-icon { font-size: 40px; margin-bottom: 12px; }
.portal-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.portal-card p { font-size: 12px; opacity: 0.8; }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 18px;
    border-radius: 7px;
    margin-bottom: 18px;
    font-size: 13.5px;
}

.alert-success { background: #E8F5E9; color: var(--success); border-left: 4px solid var(--success); }
.alert-danger { background: #FFEBEE; color: var(--danger); border-left: 4px solid var(--danger); }
.alert-warning { background: #FFF8E1; color: #E65100; border-left: 4px solid var(--warning); }
.alert-info { background: #E3F2FD; color: var(--info); border-left: 4px solid var(--info); }

/* ===== ATTENDANCE ===== */
.att-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.att-day {
    width: 42px; height: 42px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    font-weight: 600;
    cursor: default;
}

.att-present { background: #E8F5E9; color: var(--success); }
.att-absent { background: #FFEBEE; color: var(--danger); }
.att-holiday { background: #FFF8E1; color: #E65100; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; min-height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 10px 0; }
    .sidebar a { padding: 8px 16px; }
    .main { padding: 16px; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .topnav { padding: 12px 16px; }
    .topnav .nav-links { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-box { padding: 26px 20px; }
}
