:root {
    --primary: #0A2D52;
    --primary-light: #123f6e;
    --primary-soft: #eef3f8;
    --secondary: #ffffff;
    --text-dark: #1c2b3a;
    --text-muted: #63758a;
    --border: #e4e9f0;
    --success: #1f9d55;
    --danger: #d64545;
    --radius: 12px;
    --shadow: 0 6px 24px rgba(10, 45, 82, 0.08);
    --shadow-hover: 0 12px 32px rgba(10, 45, 82, 0.14);
}

* { box-sizing: border-box; }

body.app-shell {
    margin: 0;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: #f6f8fb;
    color: var(--text-dark);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ===== Navbar ===== */
.app-navbar {
    background: var(--secondary);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.app-navbar .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.app-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 20px; letter-spacing: .3px; }
.app-brand img { height: 40px; }
.app-nav-links { display: flex; align-items: center; gap: 8px; }
.app-nav-links a {
    color: #0a70dd; padding: 9px 16px; border-radius: 8px; font-size: 14.5px; font-weight: 500;
    transition: .2s;
}
.app-nav-links a:hover, .app-nav-links a.active { background: rgba(255,255,255,.12); color: #6daaeb; }
.app-nav-links a.btn-outline { border: 1px solid rgba(255,255,255,.35); }
.app-nav-links a.btn-solid { background: var(--primary); color: #fff ; font-weight: 600; }
.app-nav-links a.btn-solid:hover { background: var(--primary-light); }
.navbar-toggle { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; }

@media (max-width: 860px) {
    .navbar-toggle { display: block; }
    .app-nav-links {
        position: absolute; top: 68px; left: 0; right: 0; background: var(--primary);
        flex-direction: column; align-items: stretch; padding: 10px 20px 20px; gap: 4px;
        display: none;
    }
    .app-nav-links.open { display: flex; }
    .app-nav-links a { padding: 12px 14px; }
}

/* ===== Hero ===== */
.hero { background: linear-gradient(135deg, var(--primary) 0%, #0e3a68 100%); color: #fff; padding: 70px 0 60px; }
.hero h1 { font-size: 38px; font-weight: 700; margin: 0 0 16px; max-width: 720px; }
.hero p { font-size: 16.5px; color: #cfdcea; max-width: 620px; margin: 0 0 28px; }
.hero-stats { display: flex; gap: 34px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats div strong { display: block; font-size: 26px; }
.hero-stats div span { color: #b9cbdd; font-size: 13px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn { display: inline-block; padding: 12px 26px; border-radius: 8px; font-weight: 600; font-size: 14.5px; cursor: pointer; border: none; transition: .2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover { background: #eef3f8; }
.btn-outline-light { border: 1px solid rgba(255,255,255,.5); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.1); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ===== Section ===== */
.section-pad { padding: 56px 0; }
.section-heading { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-heading h2 { font-size: 28px; margin: 0 0 10px; color: var(--primary); }
.section-heading p { color: var(--text-muted); font-size: 15px; }

/* ===== Filter bar ===== */
.filter-bar {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px; margin-top: -46px; position: relative; z-index: 5;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
}
.filter-bar select, .filter-bar input {
    width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit; color: var(--text-dark); background: #fbfcfe;
}
.filter-bar button { grid-column: span 1; }
@media (max-width: 960px) { .filter-bar { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .filter-bar { grid-template-columns: 1fr; margin-top: 20px; } }

/* ===== Teacher Cards ===== */
.teacher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px; }
@media (max-width: 960px) { .teacher-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .teacher-grid { grid-template-columns: 1fr; } }

.teacher-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 22px;
    text-align: center; transition: .25s; border: 1px solid var(--border);
}
.teacher-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.teacher-card .avatar {
    width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px;
    border: 3px solid var(--primary-soft); background: var(--primary-soft);
}
.teacher-card h4 { margin: 0 0 4px; font-size: 17px; color: var(--text-dark); }
.teacher-card .role { color: var(--primary); font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.teacher-card .meta { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.teacher-card .meta span { display: inline-flex; align-items: center; gap: 5px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 38px; }
.pagination a, .pagination span {
    padding: 9px 15px; border-radius: 8px; border: 1px solid var(--border); font-size: 14px; background: #fff;
}
.pagination a:hover { background: var(--primary-soft); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Auth Cards ===== */
.auth-wrap { min-height: calc(100vh - 68px); display: flex; align-items: center; justify-content: center; padding: 40px 16px; background: #f0f4f9; }
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 36px; width: 100%; max-width: 440px; }
.auth-card h2 { color: var(--primary); margin: 0 0 6px; }
.auth-card p.sub { color: var(--text-muted); font-size: 14px; margin: 0 0 26px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--text-dark); }
.form-group .hint { font-weight: 400; color: var(--text-muted); font-size: 12px; margin-left: 4px; }
.form-control, select.form-control, textarea.form-control {
    width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; font-size: 14.5px;
    font-family: inherit; background: #fbfcfe; color: var(--text-dark);
}
textarea.form-control { min-height: 110px; resize: vertical; }
.form-control:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,45,82,.08); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.auth-footer-link { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.auth-footer-link a { color: var(--primary); font-weight: 600; }

/* ===== Alerts ===== */
.alert { padding: 13px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 18px; }
.alert-success { background: #e8f8ee; color: var(--success); border: 1px solid #c6ecd4; }
.alert-error { background: #fdecec; color: var(--danger); border: 1px solid #f6c9c9; }

/* ===== Field hint / info icon (hover for field info) ===== */
.field-info {
    display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
    border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700;
    cursor: help; position: relative; margin-left: 6px; vertical-align: middle;
}
.field-info::after {
    content: attr(data-tip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%);
    background: var(--text-dark); color: #fff; padding: 8px 11px; border-radius: 6px; font-size: 12px;
    width: max-content; max-width: 240px; white-space: normal; opacity: 0; pointer-events: none; transition: .18s;
    box-shadow: 0 6px 18px rgba(0,0,0,.2); z-index: 20; font-weight: 400; line-height: 1.4;
}
.field-info:hover::after { opacity: 1; }

/* ===== Dashboard Layout ===== */
.dash-wrap { display: flex; min-height: calc(100vh - 68px); background: #f6f8fb; }
.dash-sidebar { width: 250px; background: #fff; border-right: 1px solid var(--border); padding: 24px 0; flex-shrink: 0; }
.dash-sidebar h5 { padding: 0 22px; color: var(--text-muted); font-size: 11.5px; letter-spacing: .8px; text-transform: uppercase; margin: 18px 0 8px; }
.dash-sidebar h5:first-child { margin-top: 0; }
.dash-sidebar a { display: flex; align-items: center; gap: 10px; padding: 11px 22px; font-size: 14.5px; color: var(--text-dark); border-left: 3px solid transparent; }
.dash-sidebar a:hover { background: var(--primary-soft); }
.dash-sidebar a.active { background: var(--primary-soft); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.dash-main { flex: 1; padding: 32px; max-width: 900px; }
.dash-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 30px; margin-bottom: 24px; }
.dash-card h3 { margin: 0 0 4px; color: var(--primary); font-size: 19px; }
.dash-card p.desc { color: var(--text-muted); font-size: 13.5px; margin: 0 0 22px; }

.share-box { display: flex; align-items: center; gap: 10px; background: var(--primary-soft); border-radius: 8px; padding: 12px 14px; margin-bottom: 20px; flex-wrap: wrap; }
.share-box input { flex: 1; min-width: 200px; border: 1px solid var(--border); border-radius: 6px; padding: 9px 11px; font-size: 13px; background: #fff; }

.mobile-dash-toggle { display: none; }
@media (max-width: 860px) {
    .dash-wrap { flex-direction: column; }
    .dash-sidebar { width: 100%; display: none; border-right: none; border-bottom: 1px solid var(--border); }
    .dash-sidebar.open { display: block; }
    .mobile-dash-toggle { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 11px 16px; margin: 16px 16px 0; font-weight: 600; color: var(--primary); }
    .dash-main { padding: 20px 16px; }
}

/* ===== Repeater ===== */
.repeater-item { border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 14px; position: relative; background: #fbfcfe; }
.repeater-item .remove-row { position: absolute; top: 10px; right: 10px; background: #fdecec; color: var(--danger); border: none; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.add-row-btn { background: var(--primary-soft); color: var(--primary); border: 1px dashed var(--primary); border-radius: 8px; padding: 10px 18px; font-weight: 600; font-size: 13.5px; cursor: pointer; }

/* ===== Table (admin) ===== */
.table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table.app-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.app-table th { background: var(--primary-soft); text-align: left; padding: 13px 16px; color: var(--primary); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
table.app-table td { padding: 13px 16px; border-top: 1px solid var(--border); color: var(--text-dark); }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-active { background: #e8f8ee; color: var(--success); }
.badge-inactive { background: #fdecec; color: var(--danger); }
.badge-pending { background: #fff7e0; color: #b9860b; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 30px; }
@media (max-width: 860px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.stat-card strong { font-size: 26px; color: var(--primary); display: block; }
.stat-card span { color: var(--text-muted); font-size: 13px; }

/* ===== Footer ===== */
.app-footer { background: var(--primary); color: #cfdcea; padding: 34px 0; text-align: center; font-size: 13.5px; margin-top: 40px; }
.app-footer a { color: #fff; }
