* { box-sizing: border-box; }
body {
    margin: 0;
    background: #f3f6fb;
    color: #1f2937;
    font-family: Arial, sans-serif;
}
.topbar {
    background: #144b7d;
    color: #fff;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav {
    background: #103b61;
    padding: 10px 24px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.nav a {
    color: #fff;
    text-decoration: none;
    padding: 8px 12px;
    background: rgba(255,255,255,.12);
    border-radius: 8px;
}
.brand { font-size: 24px; font-weight: 700; }
.subbrand, .role { opacity: .85; font-size: 14px; }
.container { padding: 20px; }
.card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 4px 18px rgba(0,0,0,.08);
    margin-bottom: 18px;
}
.auth-card { max-width: 420px; margin: 40px auto; }
.form-group { margin-bottom: 12px; }
label { display: block; margin-bottom: 6px; font-weight: 700; }
input, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccd6e0;
    border-radius: 8px;
    background: #fff;
}
.filters {
    display: grid;
    grid-template-columns: 240px 200px 120px auto;
    gap: 12px;
    align-items: end;
}
.filters-small {
    grid-template-columns: 280px auto;
}
.grid-form {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}
.actions-inline {
    display: flex;
    gap: 10px;
    align-items: end;
}
.btn {
    display: inline-block;
    border: none;
    text-decoration: none;
    background: #144b7d;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
}
.btn-secondary { background: #4b647d; }
.btn-danger { background: #b42318; }
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
}
.alert-danger { background: #fde7e9; color: #8a1f1f; }
.alert-success { background: #e8f7ee; color: #146534; }
.hint { margin-top: 12px; color: #6b7280; font-size: 14px; }
.user-panel { text-align: right; }
.table-scroll { overflow-x: auto; }
.tabel-table, .simple-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.tabel-table { min-width: 1200px; }
.tabel-table th, .tabel-table td, .simple-table th, .simple-table td {
    border: 1px solid #d9e1ea;
    padding: 6px;
    text-align: center;
}
.tabel-table th, .simple-table th {
    background: #edf3fb;
}
.name-col {
    text-align: left !important;
    min-width: 280px;
}
.status {
    display: inline-block;
    min-width: 24px;
    padding: 6px;
    border-radius: 6px;
    background: #ffe8a3;
    font-weight: 700;
}
.status-select {
    min-width: 52px;
    padding: 6px;
    text-align: center;
}
.is-present { background: #ecfdf3; }
.is-absent { background: #fff1f2; }
.holiday { background: #fff3c4; }
.total-cell { font-weight: 700; }
.save-bar { margin: 16px 0 28px; }
@media (max-width: 1000px) {
    .filters, .filters-small, .grid-form { grid-template-columns: 1fr; }
}


.form-group-check {
    display: flex;
    align-items: center;
    padding-top: 28px;
}
.form-group-check label {
    font-weight: 600;
}
.form-group-check input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}
.students-grid-form {
    grid-template-columns: 1.5fr 1fr 1fr 1fr auto;
}


.students-grid-form-2 {
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr auto;
}


.users-grid-form {
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr auto;
}


.users-grid-form-2 {
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 1fr auto;
}


.users-grid-form-3 {
    grid-template-columns: 1.3fr 1fr 1.2fr 1fr 1fr 1fr 1fr auto;
}


.smtp-grid-form {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}


.mail-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.inner-card {
    margin-bottom: 0;
}
@media (max-width: 1000px) {
    .mail-settings-grid {
        grid-template-columns: 1fr;
    }
}


.mail-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.full-row {
    grid-column: 1 / -1;
}
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccd6e0;
    border-radius: 8px;
    background: #fff;
    resize: vertical;
    font-family: Arial, sans-serif;
}
@media (max-width: 1000px) {
    .mail-form-grid {
        grid-template-columns: 1fr;
    }
    .full-row {
        grid-column: auto;
    }
}


.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.notification-item {
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
}
.notification-item.is-unread {
    border-left: 5px solid #1e4f7a;
}
.notification-item.is-read {
    opacity: 0.85;
}
.notification-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.notification-title {
    font-size: 18px;
    font-weight: 700;
}
.notification-date {
    color: #6b7280;
    white-space: nowrap;
}
.notification-body {
    margin-bottom: 12px;
}


.nav-notifications {
    position: relative;
    display: inline-block;
}

.nav-notifications-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font: inherit;
    padding: 0;
    margin: 0;
}

.nav-notifications-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 360px;
    max-height: 460px;
    overflow: auto;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.16);
    z-index: 1000;
    padding: 10px;
}

.nav-notifications-menu.is-open {
    display: block;
}

.nav-notification-item {
    border-bottom: 1px solid #edf2f7;
    padding: 10px 8px;
}

.nav-notification-item:last-child {
    border-bottom: none;
}

.nav-notification-item.is-unread {
    background: #f8fbff;
    border-left: 4px solid #1e4f7a;
}

.nav-notification-item.is-read {
    opacity: 0.86;
}

.nav-notification-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.nav-notification-date {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.nav-notification-text {
    font-size: 13px;
    color: #374151;
    line-height: 1.45;
    max-height: 56px;
    overflow: hidden;
}

.nav-notification-actions {
    margin-top: 8px;
}

.nav-notification-actions a,
.nav-notification-footer a {
    color: #1e4f7a;
    text-decoration: none;
    font-weight: 600;
}

.nav-notification-empty {
    padding: 16px 8px;
    color: #6b7280;
    text-align: center;
}

.nav-notification-footer {
    padding: 10px 8px 4px;
    text-align: center;
    border-top: 1px solid #edf2f7;
    margin-top: 6px;
}

@media (max-width: 768px) {
    .nav-notifications-menu {
        width: 300px;
        right: -20px;
    }
}
