* {
    box-sizing: border-box;
}

:root {
    --navy-950: #111c2f;
    --navy-900: #172a46;
    --blue-600: #2559d8;
    --blue-100: #eaf0ff;
    --green-600: #17804d;
    --text: #172033;
    --muted: #748197;
    --border: #e3e9f2;
    --surface: #ffffff;
    --background: #f5f7fb;
    --danger-bg: #fff0f0;
    --danger-text: #9b2525;
    --success-bg: #eafaf1;
    --success-text: #17643a;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Tahoma, Arial, sans-serif;
    color: var(--text);
    background: var(--background);
}

body {
    direction: rtl;
}

a {
    color: inherit;
}

.eyebrow {
    font-size: 12px;
    font-weight: 800;
    color: #547096;
}

.muted {
    color: var(--muted);
    line-height: 1.8;
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    color: #fff;
    background: var(--blue-600);
    font-size: 26px;
    font-weight: 900;
    box-shadow: 0 12px 30px #0003;
}

.brand-icon-small {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 20px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 11px;
    padding: 13px 18px;
    font-weight: 800;
    cursor: pointer;
}

.link-button {
    text-decoration: none;
}

.button-primary {
    color: #fff;
    background: var(--blue-600);
}

.button-light {
    color: var(--text);
    background: #fff;
    border: 1px solid #dbe2ec;
}

.button-block {
    width: 100%;
}

.alert {
    padding: 13px 14px;
    margin: 16px 0;
    border-radius: 11px;
    line-height: 1.7;
}

.alert-danger {
    color: var(--danger-text);
    background: var(--danger-bg);
}

.alert-success {
    color: var(--success-text);
    background: var(--success-bg);
}

.status-chip {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    color: #2451bd;
    background: var(--blue-100);
    font-size: 12px;
    font-weight: 800;
}

.status-active {
    color: #17643a;
    background: #eafaf1;
}

.status-suspended {
    color: #995b00;
    background: #fff6dd;
}

.status-archived {
    color: #6c7584;
    background: #edf0f4;
}

/* Login */

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
}

.login-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10vh 9vw;
    color: #fff;
    background:
        linear-gradient(
            145deg,
            var(--navy-950),
            var(--navy-900)
        );
}

.login-brand-panel h1 {
    margin: 24px 0 6px;
    font-size: 42px;
}

.login-brand-panel h2 {
    margin: 0 0 18px;
    font-size: 24px;
    font-weight: 500;
}

.login-brand-panel p {
    max-width: 560px;
    color: #c9d4e6;
    line-height: 1.9;
}

.build-label {
    margin-top: 36px;
    color: #8fa5c7;
}

.login-form-panel {
    display: grid;
    place-items: center;
    padding: 30px;
}

.login-card {
    width: min(430px, 100%);
    padding: 38px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 25px 70px #172a4617;
}

.login-card h2 {
    margin: 8px 0;
    font-size: 30px;
}

.login-card label,
.field label {
    display: block;
    margin: 20px 0 8px;
    font-weight: 700;
}

.login-card input,
.field input,
.field select,
.field textarea,
.status-form select {
    width: 100%;
    padding: 14px;
    border: 1px solid #d9e0ea;
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

/* App shell */

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: 270px;
    padding: 24px 18px;
    color: #fff;
    background: var(--navy-950);
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 24px;
}

.sidebar-brand small {
    display: block;
    margin-top: 3px;
    color: #8fa1bd;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-nav a,
.sidebar-nav span {
    padding: 12px 14px;
    border-radius: 10px;
    color: #cbd5e5;
    text-decoration: none;
    font-size: 14px;
}

.sidebar-nav a.active {
    color: #fff;
    background: #203452;
    font-weight: 700;
}

.sidebar-nav span {
    opacity: 0.42;
}

.sidebar-version {
    margin-top: auto;
    padding: 18px 10px 10px;
    color: #7287a7;
    font-size: 12px;
}

.app-main {
    min-height: 100vh;
    margin-right: 270px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 92px;
    padding: 18px 32px;
    border-bottom: 1px solid #e7ebf1;
    background: #fff;
}

.topbar h1 {
    margin: 4px 0;
    font-size: 21px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-user small {
    display: block;
    margin-top: 3px;
    color: #78869a;
}

.page-content {
    padding: 30px;
}

.narrow-content {
    max-width: 1100px;
    margin: 0 auto;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.page-heading h2,
.page-heading h3 {
    margin: 0 0 6px;
}

.compact-heading {
    margin-bottom: 18px;
}

.hero-card,
.client-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px;
    border: 1px solid #e2e8f3;
    border-radius: 22px;
    background:
        linear-gradient(
            135deg,
            #fff,
            #f2f6ff
        );
}

.hero-card h2,
.client-hero h2 {
    margin: 14px 0 8px;
    font-size: 28px;
}

.hero-card p {
    max-width: 760px;
    color: #69788e;
    line-height: 1.8;
}

.workspace-badge {
    padding: 18px;
    border: 1px solid #e0e7f2;
    border-radius: 15px;
    color: var(--blue-600);
    background: #fff;
    font-weight: 900;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin: 22px 0;
}

.kpi-card,
.content-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.content-card + .content-card {
    margin-top: 18px;
}

.kpi-card span,
.kpi-card small {
    display: block;
    color: #7a8799;
}

.kpi-card strong {
    display: block;
    margin: 12px 0;
    font-size: 25px;
}

.success-text {
    color: var(--green-600);
}

/* Forms */

.stack-form {
    display: grid;
    gap: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.field label {
    margin-top: 0;
}

.field-full {
    grid-column: 1 / -1;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.section-heading p {
    margin: 0;
}

.section-number {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: #fff;
    background: var(--blue-600);
    font-weight: 900;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Tables */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

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

.data-table th {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    color: #65748a;
    text-align: right;
    font-size: 13px;
}

.data-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #edf1f6;
    vertical-align: middle;
}

.table-subtext {
    display: block;
    margin-top: 5px;
    color: #8995a6;
}

.table-link {
    color: var(--blue-600);
    text-decoration: none;
    font-weight: 800;
}

/* Details */

.detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr;
    gap: 18px;
    margin: 18px 0;
}

.details-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 0;
}

.details-list > div {
    padding: 15px 0;
    border-bottom: 1px solid #edf1f6;
}

.details-list dt {
    margin-bottom: 6px;
    color: #7b899b;
    font-size: 13px;
}

.details-list dd {
    margin: 0;
    font-weight: 700;
}

.status-form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

/* Misc */

.empty-state {
    padding: 60px 20px;
    text-align: center;
}

.empty-state p {
    color: var(--muted);
}

.empty-inline {
    padding: 20px;
    border-radius: 12px;
    color: #7c8999;
    background: #f7f9fc;
}

.client-card-grid,
.module-placeholder-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.client-mini-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfcfe;
    text-decoration: none;
}

.client-mini-card span,
.client-mini-card small {
    color: #7b899c;
    font-size: 12px;
}

.module-placeholder-grid > div {
    padding: 18px;
    border: 1px dashed #cfd8e6;
    border-radius: 14px;
    color: #7d8999;
    background: #fafbfd;
    text-align: center;
}

.simple-page {
    min-height: 100vh;
    padding: 35px 20px;
}

.error-card {
    width: min(750px, 100%);
    margin: 0 auto;
    padding: 35px;
    border-radius: 20px;
    background: #fff;
    text-align: center;
    box-shadow: 0 20px 60px #18315314;
}

@media (max-width: 1000px) {
    .kpi-grid,
    .client-card-grid {
        grid-template-columns: 1fr 1fr;
    }

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

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

    .login-brand-panel {
        display: none;
    }

    .sidebar {
        width: 82px;
        padding: 18px 10px;
    }

    .sidebar-brand > div:last-child,
    .sidebar-nav span,
    .sidebar-version {
        display: none;
    }

    .sidebar-nav a {
        overflow: hidden;
        font-size: 0;
        height: 44px;
    }

    .app-main {
        margin-right: 82px;
    }

    .topbar {
        padding: 16px;
    }

    .page-content {
        padding: 16px;
    }
}

@media (max-width: 650px) {
    .form-grid,
    .kpi-grid,
    .client-card-grid,
    .module-placeholder-grid,
    .details-list {
        grid-template-columns: 1fr;
    }

    .field-full {
        grid-column: auto;
    }

    .page-heading,
    .hero-card,
    .client-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-user > div {
        display: none;
    }
}
