:root {
    --ohana: #08bfd9;
    --ohana-dark: #008ba3;
    --ink: #111820;
    --muted: #60707a;
    --line: #dfe8eb;
    --surface: #f4f9fa;
    --success-bg: #dcf7ed;
    --success-text: #067e5c;
    --error-bg: #fee4e2;
    --error-text: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--surface);
    font-family: Arial, Helvetica, sans-serif;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(420px, 100%);
    padding: 32px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(17, 24, 32, 0.10);
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.auth-brand img {
    width: 82px;
    height: 82px;
    object-fit: cover;
    border-radius: 18px;
}

.auth-brand h1 {
    margin: 12px 0 5px;
    font-size: 24px;
}

.auth-brand p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.field {
    display: grid;
    gap: 7px;
    margin-bottom: 17px;
}

.field label {
    font-size: 13px;
    font-weight: bold;
}

.field input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #cbd9de;
    border-radius: 9px;
    outline: none;
    font-size: 15px;
}

.field input:focus {
    border-color: var(--ohana-dark);
    box-shadow: 0 0 0 3px rgba(8, 191, 217, 0.15);
}

.button {
    width: 100%;
    border: 0;
    border-radius: 9px;
    padding: 14px;
    color: #062126;
    background: var(--ohana);
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.button:hover {
    background: #19cbe3;
}

.message {
    margin-bottom: 18px;
    padding: 12px 13px;
    border-radius: 9px;
    font-size: 13px;
}

.message.error {
    color: var(--error-text);
    background: var(--error-bg);
}

.message.success {
    color: var(--success-text);
    background: var(--success-bg);
}

.app-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 32px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.app-brand img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 10px;
}

.logout-link {
    color: #a11c1c;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
}

.panel-content {
    width: min(1000px, calc(100% - 36px));
    margin: 34px auto;
}

.panel-content h1 {
    margin-bottom: 6px;
}

.panel-content > p {
    color: var(--muted);
}

.welcome-card {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
}

.badge {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 9px;
    border-radius: 20px;
    color: #006f83;
    background: #dff8fc;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

@media (max-width: 560px) {
    .auth-card {
        padding: 25px 20px;
    }

    .app-header {
        padding: 12px 18px;
    }
}

.app-layout {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 15px;
    color: #dce8ec;
    background: #111b20;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 30px;
    color: #b8c7cc;
    font-size: 13px;
    line-height: 1.1;
}

.sidebar-brand img {
    width: 51px;
    height: 51px;
    object-fit: cover;
    border-radius: 13px;
}

.sidebar-brand strong {
    color: #ffffff;
    font-size: 20px;
}

.sidebar-nav {
    display: grid;
    gap: 7px;
}

.nav-item {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    color: #bdcbd1;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
}

.nav-item i {
    width: 20px;
    color: inherit;
    font-size: 18px;
    font-style: normal;
    text-align: center;
}

.nav-item:hover {
    color: #ffffff;
    background: #1d2a31;
}

.nav-item.active {
    color: #071316;
    background: var(--ohana);
}

.nav-item.locked {
    cursor: not-allowed;
    color: #6f8087;
}

.nav-item.locked em {
    margin-left: auto;
    color: #6f8087;
    font-size: 9px;
    font-style: normal;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 18px 7px 3px;
    border-top: 1px solid #2a383e;
}

.avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #062126;
    background: var(--ohana);
    font-size: 13px;
    font-weight: bold;
}

.sidebar-user strong,
.sidebar-user small {
    display: block;
}

.sidebar-user strong {
    max-width: 130px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user small {
    margin-top: 3px;
    color: #87969d;
    font-size: 10px;
}

.sidebar-user a {
    margin-left: auto;
    color: #aab9bf;
    font-size: 20px;
    text-decoration: none;
}

.app-main {
    flex: 1;
    min-width: 0;
}

.app-content {
    width: min(1180px, calc(100% - 60px));
    margin: 0 auto;
    padding: 42px 0 55px;
}

.mobile-header {
    display: none;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 27px;
}

.page-heading h1 {
    margin: 4px 0 6px;
    font-size: 28px;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.eyebrow {
    margin: 0;
    color: var(--ohana-dark);
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.13em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 17px;
}

.dashboard-card,
.catalog-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
}

.dashboard-card small {
    display: block;
    color: #72808a;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.08em;
}

.dashboard-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.catalog-card.full {
    grid-column: 1 / -1;
}

.catalog-card h2 {
    margin: 0 0 5px;
    font-size: 18px;
}

.catalog-card > p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
}

.catalog-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px auto;
    gap: 9px;
    align-items: end;
    margin-bottom: 18px;
}

.catalog-form.filters-form {
    grid-template-columns: minmax(180px, 1fr) 150px minmax(180px, 1fr) auto;
}

.catalog-form label {
    display: grid;
    gap: 6px;
    color: #53626b;
    font-size: 11px;
    font-weight: bold;
}

.catalog-form input,
.catalog-form select {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border: 1px solid #cbd9de;
    border-radius: 8px;
    outline: none;
    background: #ffffff;
    font-size: 13px;
}

.catalog-form input:focus,
.catalog-form select:focus {
    border-color: var(--ohana-dark);
    box-shadow: 0 0 0 3px rgba(8, 191, 217, 0.12);
}

.catalog-form button,
.small-button {
    min-height: 40px;
    padding: 9px 13px;
    border: 0;
    border-radius: 8px;
    color: #062126;
    background: var(--ohana);
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.catalog-list {
    display: grid;
    gap: 8px;
}

.catalog-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 47px;
    padding: 9px 11px;
    border-radius: 9px;
    background: #f5f9fa;
}

.catalog-row strong {
    font-size: 13px;
}

.catalog-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.catalog-row form {
    margin-left: auto;
}

.catalog-row .small-button {
    min-height: 31px;
    color: #54626b;
    background: #e4ecef;
    font-size: 10px;
}

.catalog-row .small-button.activate {
    color: #087653;
    background: #dff6eb;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #11a570;
}

.status-dot.inactive {
    background: #aab6ba;
}

.empty-list {
    padding: 18px;
    border-radius: 9px;
    color: var(--muted);
    background: #f5f9fa;
    font-size: 13px;
    text-align: center;
}

.check-field {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    color: #52616a;
    font-size: 11px;
    font-weight: bold;
}

.check-field input {
    width: auto;
    min-height: auto;
}

@media (max-width: 850px) {
    .sidebar {
        width: 210px;
    }

    .app-content {
        width: min(100% - 34px, 1180px);
        padding-top: 28px;
    }

    .catalog-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .catalog-card.full {
        grid-column: auto;
    }

    .catalog-form,
    .catalog-form.filters-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .app-layout {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .mobile-header {
        min-height: 65px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 18px;
        background: #ffffff;
        border-bottom: 1px solid var(--line);
    }

    .app-brand img {
        width: 38px;
        height: 38px;
        object-fit: cover;
        border-radius: 9px;
    }

    .page-heading {
        display: block;
    }

    .page-heading h1 {
        font-size: 24px;
    }

    .catalog-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .catalog-row form {
        width: 100%;
        margin-left: 0;
    }

    .catalog-row .small-button {
        width: 100%;
    }
}

.form-card {
    padding: 24px;
    margin-bottom: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
}

.form-card h2 {
    margin: 0;
    font-size: 18px;
}

.form-card > p {
    margin: 6px 0 22px;
    color: var(--muted);
    font-size: 13px;
}

.form-section {
    padding: 20px 0;
    border-top: 1px solid var(--line);
}

.form-section:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.form-section h3 {
    margin: 0 0 4px;
    font-size: 14px;
}

.form-section > p {
    margin: 0 0 15px;
    color: var(--muted);
    font-size: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.form-group {
    display: grid;
    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    color: #52616a;
    font-size: 12px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd9de;
    border-radius: 8px;
    outline: none;
    background: #ffffff;
    font: inherit;
    font-size: 13px;
}

.form-group textarea {
    min-height: 92px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--ohana-dark);
    box-shadow: 0 0 0 3px rgba(8, 191, 217, 0.12);
}

.form-group small {
    color: var(--muted);
    font-size: 10px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.form-actions .button {
    width: auto;
    min-width: 180px;
}

.filter-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 200px auto;
    gap: 10px;
    align-items: end;
    padding: 18px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #ffffff;
}

.filter-card label {
    display: grid;
    gap: 6px;
    color: #52616a;
    font-size: 11px;
    font-weight: bold;
}

.filter-card input,
.filter-card select {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border: 1px solid #cbd9de;
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
}

.filter-card button {
    min-height: 40px;
    padding: 9px 13px;
    border: 0;
    border-radius: 8px;
    color: #062126;
    background: var(--ohana);
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.student-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #ffffff;
}

.student-list-header,
.student-row {
    display: grid;
    grid-template-columns: minmax(190px, 1.6fr) minmax(110px, 0.8fr) minmax(140px, 1fr) 95px 95px;
    gap: 12px;
    align-items: center;
}

.student-list-header {
    padding: 13px 17px;
    color: #73808a;
    background: #f5f9fa;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.06em;
}

.student-row {
    padding: 14px 17px;
    border-top: 1px solid #edf1f2;
    font-size: 13px;
}

.student-row strong,
.student-row small {
    display: block;
}

.student-row small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.student-status {
    display: inline-block;
    padding: 6px 8px;
    border-radius: 20px;
    color: #087653;
    background: #dff6eb;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
}

.student-status.pending {
    color: #9b6500;
    background: #fff2d8;
}

.alert-badge {
    display: inline-block;
    padding: 6px 8px;
    border-radius: 20px;
    color: #b42318;
    background: #fee4e2;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
}

.no-alert {
    color: #849198;
    font-size: 11px;
}

@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-card {
        grid-template-columns: 1fr 1fr;
    }

    .filter-card button {
        width: 100%;
    }

    .student-list {
        overflow-x: auto;
    }

    .student-list-header,
    .student-row {
        min-width: 780px;
    }
}

@media (max-width: 560px) {
    .form-grid,
    .filter-card {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

    .form-card {
        padding: 18px;
    }

    .form-actions .button {
        width: 100%;
    }
}

.student-list-header,
.student-row {
    grid-template-columns:
        minmax(190px, 1.6fr)
        minmax(110px, 0.8fr)
        minmax(140px, 1fr)
        95px
        85px
        52px;
}

.detail-button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: #006f83;
    background: #dff8fc;
    cursor: pointer;
    font-size: 17px;
}

.detail-button:hover {
    color: #ffffff;
    background: var(--ohana-dark);
}

.detail-dialog {
    width: min(760px, calc(100% - 28px));
    max-height: min(760px, calc(100vh - 30px));
    overflow: auto;
    padding: 0;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(9, 20, 26, 0.45);
}

.detail-dialog::backdrop {
    background: rgba(8, 20, 25, 0.62);
}

.detail-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    color: #ffffff;
    background: #111b20;
}

.detail-dialog-header h2 {
    margin: 4px 0 5px;
    font-size: 22px;
}

.detail-dialog-header p {
    margin: 0;
    color: #b8c7cc;
    font-size: 13px;
}

.close-detail-button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: #2a3b43;
    cursor: pointer;
    font-size: 19px;
}

.detail-dialog-content {
    padding: 23px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.detail-field {
    min-height: 70px;
    padding: 12px;
    border: 1px solid #e0eaed;
    border-radius: 10px;
    background: #f7fafb;
}

.detail-field small,
.extra-detail small {
    display: block;
    margin-bottom: 5px;
    color: #65747d;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-field strong,
.extra-detail strong {
    display: block;
    white-space: pre-line;
    font-size: 13px;
    line-height: 1.45;
}

.detail-field.attention {
    border-color: #f0c8c5;
    background: #fff3f2;
}

.detail-field.attention strong {
    color: #b42318;
}

.extra-fields {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.extra-fields h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

.extra-detail {
    padding: 10px 0;
    border-bottom: 1px solid #edf1f2;
}

@media (max-width: 900px) {
    .student-list-header,
    .student-row {
        min-width: 900px;
    }
}

@media (max-width: 560px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-dialog-header,
    .detail-dialog-content {
        padding: 18px;
    }
}