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

.app-sidebar {
    width: 260px;
    flex: 0 0 260px;
    min-height: 100vh;
    padding: 1.25rem .85rem;
    background: linear-gradient(180deg, #123b37 0%, #0f766e 100%);
    box-shadow: -1px 0 14px rgb(15 23 42 / .16);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0 .35rem 1.75rem;
    color: #fff;
    font-size: .96rem;
    font-weight: 700;
    line-height: 1.65;
    text-decoration: none
}

.sidebar-brand-mark {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgb(255 255 255 / .3);
    border-radius: .7rem;
    background: rgb(255 255 255 / .14);
    font-size: 1.05rem
}

.sidebar-nav {
    overflow-y: auto;
    padding-inline: .1rem
}

.sidebar-section + .sidebar-section {
    margin-top: 1.25rem
}

.sidebar-section-title {
    margin: 0 .7rem .45rem;
    color: #a9cbc6;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em
}

.app-sidebar .sidebar-link,
.sidebar-mobile-body .sidebar-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 2.6rem;
    padding: .55rem .7rem;
    color: #dcefeb;
    border-radius: .55rem;
    font-size: .86rem;
    transition: background-color .15s ease, color .15s ease
}

.app-sidebar .sidebar-link:hover,
.app-sidebar .sidebar-link.active,
.sidebar-mobile-body .sidebar-link:hover,
.sidebar-mobile-body .sidebar-link.active {
    color: #fff;
    background: rgb(255 255 255 / .16)
}

.app-sidebar .sidebar-link.active,
.sidebar-mobile-body .sidebar-link.active {
    box-shadow: inset -3px 0 0 #d8f3eb
}

.sidebar-link-icon {
    display: inline-grid;
    width: 1.25rem;
    place-items: center;
    flex: 0 0 1.25rem;
    color: #bce7df;
    font-size: 1.05rem
}

.sidebar-mobile-header,
.sidebar-mobile-body {
    background: #123b37;
    color: #fff
}

.sidebar-mobile-body .sidebar-nav {
    height: 100%
}

.sidebar-mobile-body .sidebar-section-title {
    color: #a9cbc6
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 1rem
}

.dashboard-stat-card {
    display: flex;
    min-height: 132px;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.1rem 1.2rem;
    border: 1px solid #dce9e6;
    border-radius: .85rem;
    background: linear-gradient(135deg, #fff, #f4fbf9);
    box-shadow: 0 2px 8px rgb(15 23 42 / .04)
}

.dashboard-stat-card strong {
    color: #0f766e;
    font-size: 2rem;
    line-height: 1.1
}

.dashboard-stat-card-primary {
    border-color: #9bd5ca;
    background: linear-gradient(135deg, #e9faf5, #fff)
}

.operation-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1rem;
    border-radius: .7rem;
    font-weight: 600
}

.operation-summary strong {
    font-size: 1.45rem
}

.operation-summary-success { background: #e9f8ef; color: #167344 }
.operation-summary-warning { background: #fff5e1; color: #9a6700 }
.operation-summary-info { background: #e9f3ff; color: #0a58ca }

.dashboard-stat-card small,
.dashboard-stat-label {
    color: #64748b
}

.dashboard-stat-label {
    font-size: .82rem;
    font-weight: 600
}

.dashboard-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 0;
    border-bottom: 1px solid #edf2f1
}

.dashboard-list-item:last-child {
    border-bottom: 0
}

.dashboard-list-item strong,
.dashboard-list-item small {
    display: block
}

/* Keep every Bootstrap modal usable on short screens and with long forms. */
.modal-dialog {
    max-height: calc(100dvh - 2rem)
}

.modal-content {
    display: flex;
    max-height: calc(100dvh - 2rem);
    flex-direction: column;
    overflow: hidden
}

.modal-content > form {
    display: flex;
    max-height: calc(100dvh - 2rem);
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column
}

.modal-header,
.modal-footer {
    flex: 0 0 auto
}

.modal-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain
}

.modal-content > form .modal-body,
.modal-content > .modal-body {
    flex: 1 1 auto
}

@media (max-width: 575.98px) {
    .modal-dialog {
        margin: .5rem;
        max-height: calc(100dvh - 1rem)
    }

    .modal-content,
    .modal-content > form {
        max-height: calc(100dvh - 1rem)
    }

    .modal-footer {
        gap: .5rem
    }
}

body {
    font-family: Cairo, Tahoma, sans-serif
}

.min-width-0 {
    min-width: 0
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem
}

.table>tbody>tr>td {
    vertical-align: middle
}

.required-mark {
    color: #dc3545;
    font-weight: 700;
    margin-inline-start: .2rem
}

input,
select,
textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #bfcac7;
    border-radius: 6px;
    background: #fff;
    font: inherit
}

textarea {
    min-height: 82px;
    resize: vertical
}

.filter {
    display: flex;
    gap: 8px;
    margin-bottom: 22px
}

:root {
    --primary: #0f766e;
    --dark: #16302d;
    --line: #d9e2e0;
    --bg: #f4f7f6;
    --danger: #b42318
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: #1f2937;
    font-family: Cairo, Tahoma, sans-serif;
    font-size: 14px
}

.app-shell {
    min-height: 100vh;
    display: flex
}

.sidebar {
    width: 250px;
    background: var(--dark);
    padding: 28px 18px;
    color: #fff;
    flex-shrink: 0
}

.brand {
    display: block;
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 36px
}

.sidebar nav {
    display: grid;
    gap: 7px
}

.sidebar nav a {
    color: #d5e6e2;
    text-decoration: none;
    padding: 10px;
    border-radius: 7px
}

.sidebar nav a:hover {
    background: #28514b;
    color: #fff
}

.main-content {
    flex: 1;
    min-width: 0
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    min-height: 68px;
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.main-content main {
    padding: 30px
}

.page-heading {
    margin-bottom: 22px
}

.page-heading h1 {
    margin: 0 0 5px;
    font-size: 24px
}

.page-heading p {
    color: #64748b;
    margin: 0
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 1px 2px #0f172a08
}

.card h2 {
    margin-top: 0;
    font-size: 18px
}

.two-columns {
    display: grid;
    grid-template-columns: minmax(290px, 0.8fr) minmax(400px, 1.2fr);
    gap: 22px
}

.narrow {
    max-width: 700px
}

.form-grid {
    display: grid;
    gap: 16px
}

input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #bfcac7;
    border-radius: 6px;
    background: #fff;
    font: inherit
}

.check {
    display: block;
    font-weight: 400;
    margin: 7px 0
}

.check input {
    width: auto;
    margin-left: 6px;
    vertical-align: middle
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px 14px
}

legend {
    padding: 0 5px;
    font-weight: 600
}

.button {
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    padding: 9px 14px;
    color: #fff;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    display: inline-block
}

.button-secondary {
    background: #64748b
}

.danger {
    background: var(--danger)
}

.actions {
    display: flex;
    gap: 6px;
    align-items: center
}

.actions form {
    display: inline
}

.table-wrap {
    overflow-x: auto
}

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

th,
td {
    padding: 11px 9px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    vertical-align: top
}

th {
    font-weight: 700;
    background: #f8fafc
}

.alert {
    padding: 12px 16px;
    border-radius: 7px;
    margin: 16px 30px
}

.alert ul {
    margin: 0;
    padding-right: 18px
}

.success {
    background: #dcfce7;
    color: #166534
}

.error {
    background: #fee2e2;
    color: #991b1b
}

.help,
small {
    font-size: 12px;
    color: #64748b;
    margin: 0
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px
}

.auth-card {
    width: min(100%, 420px)
}

.auth-card h1 {
    font-size: 20px;
    color: var(--primary)
}

.auth-card h2 {
    font-size: 17px
}

.auth-card .button {
    width: 100%
}

.pagination {
    margin-top: 16px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap
}

.pagination a,
.pagination span {
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    text-decoration: none;
    color: inherit
}

@media(max-width:800px) {
    .app-shell {
        display: block
    }

    .sidebar {
        width: 100%;
        padding: 15px
    }

    .brand {
        margin-bottom: 12px
    }

    .sidebar nav {
        display: flex;
        overflow: auto
    }

    .main-content main {
        padding: 18px
    }

    .topbar {
        padding: 12px 18px
    }

    .two-columns {
        grid-template-columns: 1fr
    }

    .alert {
        margin: 12px 18px
    }
}
