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

:root {
    --red: #c5162e;
    --red-dark: #8f1022;
    --red-soft: #fff0f2;
    --ink: #171717;
    --muted: #6d6d76;
    --line: #e8e8ec;
    --soft: #f8f8fa;
    --white: #ffffff;
    --admin-bg: #f6f7fb;
    --admin-sidebar: #16171d;
    --admin-sidebar-soft: #22242c;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
    margin: 0;
    font-family: 'Hind Siliguri', Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: var(--ink);
    background: var(--admin-bg);
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 264px;
    background: var(--admin-sidebar);
    border-right: 1px solid rgba(255,255,255,.06);
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    color: white;
    box-shadow: 20px 0 45px rgba(25, 26, 32, .08);
}
.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 0; }
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f2243f, #9b1024);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 700;
    box-shadow: 0 12px 26px rgba(197, 22, 46, .25);
}
.brand strong { letter-spacing: .2px; }
.brand small { display: block; color: #a9acb8; margin-top: 2px; }
.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    padding: 9px;
    cursor: pointer;
}
.menu-toggle span {
    display: block;
    height: 2px;
    background: white;
    border-radius: 99px;
    margin: 5px 0;
    transition: transform .18s ease, opacity .18s ease;
}
.nav { display: grid; gap: 7px; }
.nav a, .logout {
    display: block;
    padding: 12px 13px;
    border-radius: 10px;
    color: #d9dbe3;
    font-weight: 500;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav a:hover, .logout:hover {
    background: rgba(255,255,255,.08);
    color: white;
    transform: translateX(2px);
}
.nav a.active {
    background: linear-gradient(135deg, rgba(197, 22, 46, .95), rgba(143, 16, 34, .95));
    color: white;
    box-shadow: 0 12px 24px rgba(197, 22, 46, .18);
}
.logout {
    margin-top: 24px;
    border: 1px solid rgba(255,255,255,.12);
    color: #ffccd3;
}
.sidebar.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.sidebar.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.content {
    flex: 1;
    padding: 30px;
    background:
        radial-gradient(circle at top right, rgba(197, 22, 46, .08), transparent 32rem),
        var(--admin-bg);
}
.public-content {
    width: 100%;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}
h1 { margin: 0 0 6px; font-size: 28px; }
h2 { margin: 0 0 14px; font-size: 20px; }
p { color: var(--muted); line-height: 1.6; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.card, .panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(23, 23, 23, .04);
}
.stat-value { font-size: 32px; font-weight: 800; color: var(--red); }
.stat-label { color: var(--muted); margin-top: 4px; }
.dashboard-batches .table-tools h2 { margin-bottom: 2px; }
.dashboard-batches .table-tools p { margin: 0; }
.batch-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.batch-stat-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    background:
        linear-gradient(180deg, rgba(255, 240, 242, .72), rgba(255,255,255,0) 54%),
        #fff;
    box-shadow: 0 12px 26px rgba(23, 23, 23, .035);
}
.batch-stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.batch-stat-top strong {
    display: block;
    font-size: 18px;
    color: var(--ink);
}
.batch-stat-top span,
.batch-capacity {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}
.batch-stat-top em {
    min-width: 50px;
    height: 36px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    color: var(--red-dark);
    background: var(--red-soft);
    font-style: normal;
    font-weight: 800;
}
.batch-meter {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #ececf1;
    margin: 16px 0;
}
.batch-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--red), #ff6a7d);
}
.batch-stat-numbers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.batch-stat-numbers div {
    border: 1px solid #eeeeF2;
    border-radius: 10px;
    padding: 10px;
    background: rgba(255,255,255,.72);
}
.batch-stat-numbers b {
    display: block;
    font-size: 21px;
    color: var(--ink);
}
.batch-stat-numbers span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}
.batch-capacity {
    border-top: 1px solid var(--line);
    margin-top: 12px;
    padding-top: 10px;
}
.two-col { grid-template-columns: 360px 1fr; align-items: start; }
form { margin: 0; }
.form-grid { display: grid; gap: 12px; }
.form-row { display: grid; gap: 7px; }
label { font-size: 15px; font-weight: 500; color: #33333a; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    font: inherit;
    font-size: 16px;
    background: white;
}
textarea { min-height: 95px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(197, 22, 46, .16);
    border-color: var(--red);
}
.btn {
    border: 0;
    border-radius: 10px;
    background: var(--red);
    color: white;
    padding: 11px 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    text-align: center;
}
.btn:hover { background: var(--red-dark); }
.btn.secondary { background: #2f3037; }
.btn.light { background: #fff1f3; color: var(--red-dark); }
.btn.small { padding: 7px 10px; font-size: 13px; }
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.search { max-width: 360px; min-width: 220px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #fafafb; }
tbody tr:hover { background: #fffafa; }
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
    background: #f0f0f2;
}
.badge.confirmed { color: #126335; background: #e8f7ee; }
.badge.waiting { color: #8a5b00; background: #fff5d8; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.alert { margin-bottom: 16px; border-radius: 8px; padding: 12px 14px; border: 1px solid var(--line); background: white; }
.alert.success { border-color: #b7ebca; background: #effbf3; }
.alert.error { border-color: #ffc2cc; background: #fff1f3; }
.auth-card { width: min(100%, 980px); display: grid; grid-template-columns: 1fr 390px; background: white; border-radius: 8px; border: 1px solid var(--line); overflow: hidden; }
.auth-info { padding: 42px; background: linear-gradient(135deg, #c5162e, #7e0f1e); color: white; }
.auth-info p { color: #ffe3e8; }
.auth-panel { padding: 34px; }
.public-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.student-photo { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.checkbox-grid { display: grid; gap: 8px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checkbox-item input { width: auto; }
.public-content.form-page {
    display: block;
    place-items: initial;
    padding: 0;
    background: #ececef;
}
.application-page {
    width: min(100%, 1060px);
    margin: 0 auto;
    padding: 0 14px 28px;
}
.application-top {
    background: #050505;
    color: white;
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-bottom: 5px solid var(--red);
}
.application-top a {
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 8px;
    padding: 9px 12px;
}
.astra-logo { display: flex; align-items: center; gap: 12px; }
.astra-logo span {
    width: 54px;
    height: 54px;
    background: var(--red);
    color: white;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 34px;
    font-weight: 900;
}
.astra-logo strong { display: block; font-size: 32px; line-height: .9; }
.astra-logo small { font-size: 17px; letter-spacing: 1px; }
.paper-form {
    background: white;
    border: 1px solid #d9d9df;
    padding: 28px 36px 34px;
    box-shadow: 0 16px 36px rgba(0,0,0,.08);
}
.paper-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 22px;
}
.paper-title { text-align: center; }
.paper-title p { color: #111; font-size: 24px; margin: 0 0 12px; }
.paper-title h1 { color: var(--red); font-size: 42px; letter-spacing: 0; margin-bottom: 28px; }
.line-row {
    grid-template-columns: 110px 1fr;
    align-items: center;
    text-align: left;
}
.photo-box {
    height: 220px;
    border: 2px solid var(--red);
    border-radius: 10px;
    display: grid;
    place-items: center;
    text-align: center;
    color: #111;
    font-size: 20px;
    cursor: pointer;
    padding: 12px;
}
.photo-box input { margin-top: 12px; font-size: 12px; }
.form-section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--red);
    color: white;
    border-radius: 7px;
    padding: 6px 12px;
    font-size: 21px;
    font-weight: 600;
    margin: 14px 0 12px;
}
.form-section-title span,
.numbered-field b {
    background: white;
    color: var(--red);
    border-radius: 5px;
    min-width: 25px;
    height: 25px;
    display: inline-grid;
    place-items: center;
}
.numbered-fields { display: grid; gap: 10px; }
.numbered-field {
    display: grid;
    grid-template-columns: 36px 245px 1fr;
    align-items: center;
    gap: 10px;
}
.numbered-field b {
    background: var(--red);
    color: white;
    font-size: 19px;
}
.numbered-field input,
.numbered-field select,
.line-row select,
.paper-form textarea {
    border: 0;
    border-bottom: 1px dotted #333;
    border-radius: 0;
    padding: 8px 4px;
    font-size: 17px;
}
.inline-options {
    grid-template-columns: 36px 245px auto auto auto 1fr;
}
.inline-options label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.inline-options input { width: auto; }
.address-box {
    border: 1px solid var(--red);
    border-radius: 8px;
    padding: 0 14px 14px;
    margin: 18px 0;
}
.address-box .form-section-title { margin-top: -17px; }
.address-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.address-grid .form-row:nth-child(1),
.address-grid .form-row:nth-child(2) { grid-column: span 3; }
.address-grid .form-row:nth-child(n+3) { grid-column: span 2; }
.compact .numbered-field { grid-template-columns: 36px 230px 1fr; }
.declaration {
    text-align: center;
    margin: 18px 0;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}
.declaration strong { color: var(--red); font-size: 22px; }
.declaration p { color: #111; margin: 8px 0 0; }
.apply-submit {
    width: 100%;
    font-size: 16px;
    margin-top: 10px;
}

@media (max-width: 860px) {
    body { font-size: 15px; }
    .app-shell {
        display: block;
        min-height: 100vh;
    }
    .auth-card,
    .two-col {
        display: block;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 12px 14px;
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
        box-shadow: 0 12px 28px rgba(0,0,0,.08);
    }
    .sidebar-head {
        margin-bottom: 0;
    }
    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }
    .menu-toggle { display: block; }
    .nav {
        display: none;
        gap: 8px;
        padding-top: 13px;
    }
    .sidebar.menu-open .nav { display: grid; }
    .nav a {
        padding: 11px 12px;
        white-space: normal;
        background: rgba(255,255,255,.06);
        border: 1px solid rgba(255,255,255,.09);
        color: white;
    }
    .logout {
        display: none;
        margin-top: 8px;
        width: 100%;
        padding: 11px 13px;
        justify-content: center;
    }
    .sidebar.menu-open .logout { display: inline-flex; }
    .content {
        padding: 14px;
        width: 100%;
    }
    .public-content {
        min-height: 100vh;
        padding: 14px;
        display: block;
    }
    .page-head,
    .table-tools {
        display: grid;
        gap: 12px;
    }
    h1 { font-size: 24px; }
    h2 { font-size: 19px; }
    .panel,
    .card {
        padding: 14px;
    }
    .stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .stat-value { font-size: 26px; }
    .actions,
    .table-tools .actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
    .actions .btn,
    .actions button,
    .actions select,
    .actions form {
        width: 100%;
    }
    .btn,
    .btn.small {
        width: 100%;
        padding: 10px 12px;
        font-size: 15px;
    }
    .search {
        max-width: none;
        min-width: 0;
        width: 100%;
    }
    input,
    select,
    textarea {
        min-height: 44px;
        font-size: 16px;
    }
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        border: 1px solid var(--line);
        border-radius: 8px;
    }
    th,
    td {
        padding: 10px;
    }
    .auth-card {
        width: 100%;
        border-radius: 8px;
    }
    .auth-info,
    .auth-panel {
        padding: 22px;
    }
    .auth-info h1 { font-size: 26px; }
    .public-links,
    .public-links .btn {
        width: 100%;
    }
    .application-page {
        padding: 0 0 18px;
        width: 100%;
    }
    .application-top {
        min-height: auto;
        padding: 14px;
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }
    .application-top a {
        width: 100%;
        text-align: center;
    }
    .astra-logo span {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
    .astra-logo strong {
        font-size: 25px;
    }
    .astra-logo small {
        font-size: 14px;
    }
    .paper-form {
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }
    .application-top,
    .paper-form {
        padding-left: 14px;
        padding-right: 14px;
    }
    .paper-head, .numbered-field, .inline-options, .address-grid {
        display: grid;
        grid-template-columns: 1fr;
    }
    .line-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .numbered-field {
        gap: 7px;
        padding-bottom: 12px;
        border-bottom: 1px solid #f0f0f2;
    }
    .numbered-field b {
        width: 30px;
        min-width: 30px;
    }
    .inline-options label {
        width: 100%;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 9px 10px;
    }
    .inline-options input {
        min-height: auto;
    }
    .address-grid .form-row:nth-child(n) { grid-column: auto; }
    .address-box {
        padding: 0 10px 12px;
        margin: 16px 0;
    }
    .form-section-title {
        font-size: 18px;
        max-width: 100%;
        flex-wrap: wrap;
    }
    .paper-title p { font-size: 18px; }
    .paper-title h1 {
        font-size: 28px;
        line-height: 1.15;
        margin-bottom: 18px;
    }
    .numbered-field input,
    .numbered-field select,
    .line-row select,
    .paper-form textarea {
        font-size: 16px;
        width: 100%;
    }
    .photo-box { height: auto; min-height: 150px; }
    .declaration strong { font-size: 20px; }
    .declaration p { font-size: 15px; }
}

@media (max-width: 520px) {
    .content,
    .public-content {
        padding: 10px;
    }
    .sidebar {
        padding: 12px 10px;
    }
    .brand strong {
        font-size: 16px;
    }
    .brand small {
        font-size: 12px;
    }
    .nav a,
    .logout {
        font-size: 14px;
    }
    .page-head {
        margin-bottom: 14px;
    }
    h1 { font-size: 22px; }
    .card,
    .panel {
        padding: 12px;
    }
    .auth-info,
    .auth-panel {
        padding: 18px;
    }
    .paper-form {
        padding-top: 18px;
        padding-bottom: 24px;
    }
    .paper-title h1 {
        font-size: 25px;
    }
    .form-section-title {
        font-size: 17px;
        padding: 6px 10px;
    }
    .astra-logo strong {
        font-size: 22px;
    }
    .numbered-field,
    .compact .numbered-field {
        grid-template-columns: 1fr;
    }
    label {
        font-size: 15px;
    }
    th,
    td {
        font-size: 14px;
    }
}
