@font-face {
    font-family: Vazir;
    src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Vazir;
    src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Vazir;
    src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f3f6f5;
    --card: #fff;
    --ink: #172a24;
    --muted: #71827c;
    --line: #dce6e2;
    --green: #174b3f;
    --green2: #28705f;
    --mint: #e2f1ec;
    --gold: #c79d4a;
    --amber: #fff1d0;
    --red: #b94e48;
    --redbg: #fde9e7;
    --blue: #3e6f9e;
    --shadow: 0 12px 38px rgba(22, 70, 58, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px Vazir, Tahoma, Arial, sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.app {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 100vh;
}

.side {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, #123c33, #1d5b4c);
    color: #fff;
    padding: 25px 17px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.logo {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 0 7px 22px;
    border-bottom: 1px solid #ffffff22;
}

.logo i {
    font-style: normal;
    width: 43px;
    height: 43px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e1c274, #a67b2d);
    display: grid;
    place-items: center;
    color: #163d34;
    font-size: 20px;
    font-weight: 700;
    flex: none;
}

.logo strong {
    display: block;
    font-size: 16px;
}

.logo small {
    color: #bfd4cd;
}

.nav {
    display: grid;
    gap: 7px;
    margin-top: 20px;
}

.nav a,
.nav .nav-item {
    border: 0;
    background: transparent;
    color: #c7dcd5;
    padding: 12px 13px;
    border-radius: 12px;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav a:hover,
.nav a.active {
    background: #ffffff18;
    color: #fff;
}

.nav b {
    width: 27px;
    height: 27px;
    border-radius: 8px;
    background: #ffffff12;
    display: grid;
    place-items: center;
    font-weight: 500;
}

.side-note {
    margin-top: auto;
    background: #ffffff10;
    border: 1px solid #ffffff18;
    padding: 13px;
    border-radius: 14px;
    color: #cce0da;
    font-size: 11px;
    line-height: 1.8;
}

.side-note strong {
    color: #fff;
    display: block;
}

.main {
    padding: 25px 28px 50px;
    min-width: 0;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 22px;
}

.top h1 {
    margin: 0 0 4px;
    font-size: 23px;
}

.top p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.card {
    background: var(--card);
    border: 1px solid #174b3f10;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 19px 21px;
}

.section-head h2 {
    font-size: 16px;
    margin: 0 0 3px;
}

.section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.8;
}

.btn {
    border: 0;
    background: var(--green);
    color: #fff;
    border-radius: 11px;
    padding: 10px 14px;
    font-weight: 700;
}

.btn:hover {
    filter: brightness(1.07);
}

.btn.ghost {
    background: #fff;
    color: var(--green);
    border: 1px solid var(--line);
}

.field label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.field input,
.field select,
.search,
.filter {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 11px;
    padding: 10px 12px;
    color: var(--ink);
    width: 100%;
    outline: none;
}

.field input:focus,
.field select:focus,
.search:focus,
.filter:focus {
    border-color: var(--green2);
    box-shadow: 0 0 0 3px #28705f22;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
}

.login-brand {
    background: linear-gradient(180deg, #123c33, #1d5b4c);
    color: #fff;
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.login-brand .logo {
    border-bottom-color: #ffffff22;
}

.login-lead {
    margin: 28px 7px 0;
    color: #d5e7e1;
    font-size: 13px;
    line-height: 2;
}

.login-main {
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.login-card {
    width: min(440px, 100%);
    padding: 28px 26px 24px;
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 22px;
}

.login-card .intro {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.9;
}

.login-form {
    display: grid;
    gap: 14px;
}

.password-row {
    position: relative;
}

.password-row input {
    padding-right: 72px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: var(--mint);
    color: var(--green);
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 700;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.remember input {
    accent-color: var(--green);
    width: 16px;
    height: 16px;
}

.login-form .btn {
    width: 100%;
    padding: 12px 14px;
    margin-top: 4px;
}

.form-error {
    background: var(--redbg);
    color: var(--red);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 12px;
    line-height: 1.8;
}

@media (max-width: 860px) {
    .login-screen {
        grid-template-columns: 1fr;
    }

    .login-brand {
        min-height: auto;
        padding: 22px 18px 18px;
    }

    .login-lead,
    .login-brand .side-note {
        display: none;
    }

    .login-brand .logo {
        border-bottom: 0;
        padding-bottom: 0;
    }
}

@media (max-width: 720px) {
    .app {
        display: block;
    }

    .side {
        position: relative;
        height: auto;
        padding: 18px 14px;
    }

    .side-note {
        display: none;
    }

    .main {
        padding: 17px 13px 28px;
    }

    .top {
        align-items: flex-start;
    }

    .top h1 {
        font-size: 19px;
    }
}

.btn.danger {
    background: var(--redbg);
    color: var(--red);
}

.btn.sm {
    padding: 7px 10px;
    font-size: 11px;
}

.toolbar {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.search {
    min-width: 260px;
    width: auto;
}

.filter {
    width: auto;
}

.push {
    margin-right: auto;
}

.table-card {
    overflow: hidden;
}

.table-wrap {
    overflow: auto;
}

.table {
    border-collapse: collapse;
    width: 100%;
    min-width: 900px;
}

.table th {
    background: #f7faf8;
    color: var(--muted);
    font-size: 10px;
    text-align: right;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf2ef;
    font-size: 11px;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #f8fbfa;
}

.table tbody tr.empty-row:hover {
    background: transparent;
}

.table tr[hidden] {
    display: none;
}

.person {
    display: flex;
    gap: 9px;
    align-items: center;
}

.person small {
    display: block;
    color: var(--muted);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--mint);
    display: grid;
    place-items: center;
    color: var(--green);
    font-weight: 700;
}

.pill {
    display: inline-block;
    border-radius: 99px;
    background: #edf4f1;
    color: var(--green);
    padding: 5px 9px;
    font-size: 9px;
}

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

.row-actions form {
    margin: 0;
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.form-grid .form-error {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 8px;
    align-items: end;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
}

.modal.open {
    display: block;
}

.backdrop {
    position: absolute;
    inset: 0;
    background: #0c211b88;
}

.dialog {
    position: relative;
    width: min(700px, calc(100% - 28px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: #fff;
    border-radius: 20px;
    padding: 22px;
    margin: 20px auto;
    box-shadow: 0 30px 80px #0003;
}

.dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 17px;
}

.dialog-head h2 {
    margin: 0;
    font-size: 17px;
}

.close {
    border: 0;
    background: #edf3f0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.toast {
    position: fixed;
    left: 22px;
    bottom: 22px;
    background: #153f35;
    color: #fff;
    padding: 11px 15px;
    border-radius: 11px;
    opacity: 0;
    transform: translateY(8px);
    transition: 0.2s;
    z-index: 60;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: none;
}

@media (max-width: 720px) {
    .search {
        width: 100%;
        min-width: 0;
    }

    .push {
        margin-right: 0;
    }

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