:root {
    --app-ink: #12231a;
    --app-muted: #5a6b62;
    --app-surface: #ffffff;
    --app-canvas: #edf2ee;
    --app-border: #d5e0d8;
    --app-brand: #123b2b;
    --app-brand-strong: #0c2419;
    --app-brand-soft: #e6f0ea;
    --app-gold: #c29a3f;
    --app-gold-soft: #f8f2e4;
    --app-danger: #a63d38;
    --app-danger-soft: #fbefee;
    --app-success: #236449;
    --app-success-soft: #eaf5ee;
    --app-warning: #805d1a;
    --app-warning-soft: #fbf5e8;
    --app-shadow: 0 22px 48px rgb(12 36 25 / 9%);
    --app-radius: 18px;
    --app-radius-sm: 11px;
    --app-focus: 0 0 0 3px rgb(194 154 63 / 32%);
    --app-font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }

body.app-body {
    min-height: 100vh;
    margin: 0;
    color: var(--app-ink);
    font-family: var(--app-font);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(95% 65% at 100% -12%, rgb(194 154 63 / 18%), transparent 52%),
        radial-gradient(75% 55% at -12% 105%, rgb(18 59 43 / 12%), transparent 48%),
        linear-gradient(168deg, #f6faf7 0%, var(--app-canvas) 48%, #e4ede7 100%);
}

[lang="ar"] {
    line-height: 1.7;
}

body.app-body.is-guest {
    display: grid;
    grid-template-rows: 1fr;
    align-items: stretch;
}

body.app-body.is-guest .app-main {
    width: min(100% - 32px, 1120px);
    margin: 0 auto;
    padding: 0;
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--app-surface) 92%, transparent);
    border-bottom: 1px solid var(--app-border);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgb(201 162 75 / 35%);
}

.app-header-inner {
    width: min(100% - 48px, 1320px);
    min-height: 74px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 28px;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--app-ink);
    text-decoration: none;
    flex-shrink: 0;
}

.app-brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: 0 8px 18px rgb(18 59 43 / 16%);
}
.app-brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.app-brand-copy { display: flex; align-items: baseline; gap: 10px; }
.app-brand-name, .app-brand-caption { display: block; }
.app-brand-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
    white-space: nowrap;
}
.app-brand-caption {
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.app-nav, .app-account {
    display: flex;
    align-items: center;
}

.app-nav { gap: 4px; }
.app-nav-desktop { margin-left: auto; }
.app-account { gap: 10px; }
.app-account form, .mobile-nav-panel form { margin: 0; }

.app-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #536159;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.app-nav-link:hover { background: var(--app-brand-soft); color: var(--app-ink); }
.app-nav-link.is-active {
    background: var(--app-brand);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 18px rgb(18 59 43 / 18%);
}
.app-nav-link:focus-visible, .mobile-nav summary:focus-visible { outline: none; box-shadow: var(--app-focus); }
.app-signout { color: #68756d; }
.app-signout:hover { color: var(--app-danger); background: var(--app-danger-soft); }

.role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid color-mix(in srgb, var(--app-gold) 35%, var(--app-border));
    border-radius: 999px;
    background: var(--app-gold-soft);
    color: #6f5520;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.mobile-nav { display: none; position: relative; }
.mobile-nav summary { list-style: none; cursor: pointer; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary::after { content: "⌄"; margin-left: 8px; color: var(--app-muted); }
.mobile-nav-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 30;
    width: min(300px, calc(100vw - 32px));
    padding: 10px;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}
.mobile-nav-panel .app-nav-link { width: 100%; justify-content: flex-start; }
.mobile-nav-panel .app-nav-link.is-active { box-shadow: none; }

.app-main {
    width: min(100% - 48px, 1320px);
    margin: 0 auto;
    padding: 32px 0 72px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid color-mix(in srgb, var(--app-border) 80%, transparent);
}

.page-heading h1, .page-title {
    margin: 0;
    color: var(--app-brand-strong);
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.page-title-ar {
    margin: 4px 0 0;
    color: color-mix(in srgb, var(--app-brand) 78%, var(--app-muted));
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    font-weight: 600;
    line-height: 1.45;
}

.page-heading p, .page-description {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--app-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.65;
}

.surface-panel {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: color-mix(in srgb, var(--app-surface) 96%, white);
    box-shadow: 0 12px 32px rgb(15 42 29 / 5%);
}

.panel-heading { margin: 0; color: var(--app-ink); font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.panel-description { margin: 6px 0 18px; color: var(--app-muted); font-size: 13px; font-weight: 550; }
.filter-panel { margin-bottom: 16px; padding: 18px; }
.filter-grid { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto; align-items: end; gap: 12px; }
.employee-filter-grid { grid-template-columns: minmax(240px, 2fr) minmax(160px, 1fr) auto; }
.filter-actions { display: flex; gap: 8px; }
.filter-actions .btn { min-width: 82px; }

.form-label, .filter-panel label, .surface-panel label {
    display: block;
    color: #3c4941;
    font-size: 13px;
    font-weight: 700;
}

.app-main input:not([type="checkbox"]):not([type="radio"]),
.app-main select,
.app-main textarea {
    width: 100%;
    min-height: 44px;
    margin-top: 7px;
    padding: 10px 13px;
    border: 1px solid #c7d3cb;
    border-radius: var(--app-radius-sm);
    background: #fff;
    color: var(--app-ink);
    font: inherit;
    font-size: 14px;
    line-height: 1.45;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.app-main textarea { min-height: 100px; resize: vertical; }
.app-main input[type="file"] { padding: 9px; }
.app-main input::placeholder, .app-main textarea::placeholder { color: #8b9690; }
.app-main input:focus, .app-main select:focus, .app-main textarea:focus {
    outline: none;
    border-color: var(--app-brand);
    box-shadow: var(--app-focus);
}
.app-main input[type="checkbox"], .app-main input[type="radio"] { accent-color: var(--app-brand); }
.app-main fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.app-main fieldset:disabled { opacity: .76; }
.app-main input:disabled, .app-main select:disabled, .app-main textarea:disabled { background: #f3f5f3; cursor: not-allowed; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--app-radius-sm);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--app-focus); }
.btn-primary {
    background: linear-gradient(180deg, #164834 0%, var(--app-brand-strong) 100%);
    color: #fff;
    box-shadow: 0 10px 20px rgb(18 59 43 / 18%);
}
.btn-primary:hover { background: var(--app-brand-strong); transform: translateY(-1px); }
.btn-secondary { border-color: #c7d3cb; background: #fff; color: #33423a; }
.btn-secondary:hover { background: var(--app-brand-soft); border-color: #aebdb2; }
.btn-danger { border-color: #e6c6c3; background: #fff; color: var(--app-danger); }
.btn-danger:hover { background: var(--app-danger-soft); }
.btn-quiet { background: transparent; color: #526057; }
.btn-quiet:hover { background: #f1f4f1; }
.btn-small { min-height: 34px; padding: 6px 10px; font-size: 12px; }

.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.app-main table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.app-main thead { background: linear-gradient(180deg, #f4f8f5, #eef4f0); }
.app-main th {
    padding: 13px 16px;
    border-bottom: 1px solid var(--app-border);
    color: #5d6c63;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.app-main td { padding: 15px 16px; border-bottom: 1px solid #edf0ed; color: #39473f; vertical-align: middle; }
.app-main tbody tr:last-child td { border-bottom: 0; }
.app-main tbody tr:hover { background: color-mix(in srgb, var(--app-brand-soft) 55%, white); }
.app-main th[scope="col"] { text-align: inherit; }
.table-cell-primary { color: var(--app-ink); font-weight: 750; }
.table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.table-pagination { padding: 12px 16px; border-top: 1px solid var(--app-border); background: #fafcfb; }
.table-pagination nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.table-pagination a, .table-pagination span { color: #58665d; font-size: 12px; font-weight: 650; }

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
}
.status-active, .status-approved { border-color: #d3e8da; background: var(--app-success-soft); color: #276247; }
.status-inactive, .status-draft { border-color: #e3e7e3; background: #f3f5f3; color: #59665e; }
.status-submitted { border-color: #eee1bd; background: var(--app-warning-soft); color: #795a20; }
.status-rejected { border-color: #eccdca; background: var(--app-danger-soft); color: #9c3934; }

.flash-message {
    margin-bottom: 16px;
    padding: 13px 16px;
    border: 1px solid;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 550;
    box-shadow: 0 8px 18px rgb(15 42 29 / 4%);
}
.flash-success { border-color: #cde3d5; background: var(--app-success-soft); color: #245d43; }
.flash-error { border-color: #edcfcc; background: var(--app-danger-soft); color: #8d3935; }
.flash-warning { border-color: #ead9ae; background: var(--app-warning-soft); color: #73571d; }
.flash-title { margin: 0 0 4px; font-weight: 800; }
.flash-message ul { margin: 0; padding-left: 19px; }

.empty-state { padding: 44px 24px !important; color: var(--app-muted) !important; text-align: center; }
.empty-state strong { display: block; margin-bottom: 4px; color: #344239; font-size: 15px; font-weight: 800; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.section-stack { display: grid; gap: 16px; }
.panel-padding { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-hint { display: block; margin-top: 5px; color: var(--app-muted); font-size: 12px; font-weight: 500; }
.form-required { color: #a63d38; }
.profile-choice {
    display: flex !important;
    align-items: center;
    gap: 14px !important;
    min-height: 92px;
    padding: 16px;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.profile-choice:hover { border-color: color-mix(in srgb, var(--app-brand) 35%, var(--app-border)); }
.profile-choice:has(input:checked) {
    border-color: var(--app-brand);
    background: var(--app-brand-soft);
    box-shadow: inset 3px 0 0 var(--app-gold);
}
.profile-choice img { width: 128px; height: 54px; object-fit: contain; }
.profile-choice-copy { color: var(--app-muted); font-size: 12px; font-weight: 550; }
.profile-choice-copy strong { display: block; margin-bottom: 2px; color: var(--app-ink); font-size: 13px; font-weight: 800; }
.brand-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-photo {
    display: block;
    width: 96px;
    height: 96px;
    margin-top: 8px;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    object-fit: cover;
    object-position: center top;
}
.photo-cropper { display: grid; gap: 8px; }
.photo-cropper label { margin: 0; }
body.photo-cropper-open { overflow: hidden; }
.photo-cropper-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgb(15 42 29 / 52%);
}
.photo-cropper-modal[hidden] { display: none !important; }
.photo-cropper-dialog {
    width: min(100%, 560px);
    max-height: min(92vh, 760px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 14px;
    padding: 18px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 60px rgb(15 42 29 / 28%);
}
.photo-cropper-header h3 {
    margin: 0;
    color: var(--app-ink);
    font-size: 1.05rem;
    font-weight: 800;
}
.photo-cropper-header p {
    margin: 4px 0 0;
    color: var(--app-muted);
    font-size: 13px;
    font-weight: 600;
}
.photo-cropper-stage {
    min-height: 280px;
    max-height: min(58vh, 460px);
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: #111;
}
.photo-cropper-stage img { display: block; max-width: 100%; }
.photo-cropper-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}
.private-panel {
    border-color: color-mix(in srgb, var(--app-gold) 45%, var(--app-border));
    background: linear-gradient(180deg, #fffcf6, #faf6ec);
}
.private-panel .panel-description { color: #766743; }
.private-panel .panel-heading { color: #5f4a1d; }
.review-change { background: #fbf5e8; }
.private-data-panel {
    border-color: color-mix(in srgb, var(--app-gold) 45%, var(--app-border));
    background: linear-gradient(180deg, #fffcf6, #faf6ec);
}
.data-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.data-list dt { color: var(--app-muted); font-size: 11px; font-weight: 700; }
.data-list dd { margin: 3px 0 0; color: var(--app-ink); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.review-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.review-action-card { padding: 20px; }
.review-action-card h2 { margin: 0; font-size: 16px; font-weight: 800; }
.review-action-card p { margin: 6px 0 14px; color: var(--app-muted); font-size: 13px; }
.history-list { margin: 0; padding: 0; list-style: none; }
.history-list li { padding: 11px 0; border-bottom: 1px solid #edf0ed; font-size: 13px; }
.history-list li:last-child { border-bottom: 0; }
.history-date { color: var(--app-muted); font-size: 12px; font-weight: 600; }
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: color-mix(in srgb, var(--app-surface) 88%, var(--app-brand-soft));
    box-shadow: 0 10px 24px rgb(15 42 29 / 5%);
}
.form-actions.is-sticky {
    position: sticky;
    bottom: 14px;
    z-index: 5;
}
.form-actions-note { color: var(--app-muted); font-size: 12px; font-weight: 550; }
.profile-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.profile-public-link { color: var(--app-brand); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.profile-secondary { color: var(--app-muted); font-size: 13px; font-weight: 600; }
.account-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 16px; }
.account-details, .account-password { padding: 24px; }
.account-details dl { display: grid; gap: 0; margin: 18px 0 0; }
.account-details dl > div { display: grid; grid-template-columns: minmax(145px, .7fr) minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--app-border); }
.account-details dt { color: var(--app-muted); font-size: 12px; font-weight: 700; }
.account-details dd { margin: 0; color: var(--app-ink); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.submit-review-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.section-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.back-link { display: inline-block; margin-bottom: 8px; color: var(--app-muted); font-size: 13px; font-weight: 650; text-decoration: none; }
.back-link:hover { color: var(--app-brand); text-decoration: underline; }
.review-page-heading { margin-bottom: 22px; }
.change-indicator {
    display: inline-flex;
    margin-left: 7px;
    padding: 2px 7px;
    border-radius: 7px;
    background: #f0e5c7;
    color: #725820;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: none;
    vertical-align: middle;
}
.audit-details summary { color: var(--app-brand); font-size: 12px; font-weight: 700; cursor: pointer; }
.audit-details dl { display: grid; gap: 7px; min-width: 180px; margin: 9px 0 0; }
.audit-details dl > div { padding-top: 6px; border-top: 1px solid var(--app-border); }
.audit-details dt { color: var(--app-muted); font-size: 10px; font-weight: 750; }
.audit-details dd { margin: 2px 0 0; color: var(--app-ink); font-size: 12px; overflow-wrap: anywhere; }
.role-select { min-width: 130px; }

.auth-shell {
    width: min(100%, 1040px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
    gap: 24px;
    align-items: stretch;
    padding-block: clamp(24px, 6vh, 56px);
    animation: auth-rise .55s ease both;
}
.auth-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 460px;
    padding: clamp(26px, 4vw, 40px);
    border-radius: 28px;
    background: linear-gradient(155deg, #174f38 0%, var(--app-brand) 42%, var(--app-brand-strong) 100%);
    color: #fff;
    box-shadow: var(--app-shadow);
}
.auth-hero::before {
    position: absolute;
    inset: auto -18% -40% auto;
    width: 300px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgb(194 154 63 / 26%);
    content: "";
}
.auth-hero::after {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse at 30% 20%, #000 20%, transparent 70%);
    content: "";
    pointer-events: none;
}
.auth-hero-glow {
    position: absolute;
    inset: -18% auto auto -10%;
    width: 220px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgb(255 255 255 / 10%);
    filter: blur(2px);
    z-index: 0;
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.auth-hero-brand img {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 14px 32px rgb(0 0 0 / 24%);
}
.auth-hero-brand strong {
    display: block;
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
}
.auth-hero-brand span {
    display: block;
    margin-top: 4px;
    opacity: .88;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}
.auth-hero-kicker {
    margin: 0 0 10px !important;
    opacity: .78 !important;
    font-size: .78rem !important;
    font-weight: 600 !important;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.auth-hero-copy h2 {
    margin: 0 0 8px;
    max-width: 16ch;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em;
}
.auth-hero-ar {
    margin: 0 0 14px !important;
    max-width: 22ch !important;
    opacity: .92 !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    line-height: 1.55 !important;
}
.auth-hero p {
    margin: 0;
    max-width: 36ch;
    opacity: .88;
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.65;
}
.auth-hero-foot {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid rgb(255 255 255 / 18%);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .03em;
    opacity: .82;
}

.auth-layout {
    width: min(100%, 480px);
    margin: 0;
    animation: auth-rise .55s ease .08s both;
}
.auth-shell .auth-layout { width: 100%; }
.auth-panel {
    padding: clamp(26px, 4vw, 36px);
    border-radius: 28px;
    box-shadow: var(--app-shadow);
    backdrop-filter: blur(8px);
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.auth-brand img {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 10px 24px rgb(18 59 43 / 14%);
}
.auth-brand-copy { min-width: 0; }
.auth-brand-copy strong {
    display: block;
    color: var(--app-brand-strong);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}
.auth-brand-copy span {
    display: block;
    margin-top: 2px;
    color: var(--app-brand);
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.4;
}
.auth-brand-copy em {
    display: block;
    margin-top: 4px;
    color: var(--app-muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
}
.auth-panel .page-title { font-size: 1.75rem; }
.auth-panel .page-title-ar { margin-bottom: 6px; }
.auth-panel .page-description { margin-bottom: 22px; }
.auth-form { display: grid; gap: 16px; }
.auth-form .btn { width: 100%; margin-top: 2px; min-height: 46px; font-size: 14px; }
.auth-form .checkbox-row { display: flex; align-items: center; gap: 9px; font-weight: 500; line-height: 1.45; }
.auth-form .checkbox-row input { width: 16px; height: 16px; margin: 0; flex-shrink: 0; }
.auth-footer-link {
    display: block;
    margin-top: 18px;
    text-align: center;
    color: var(--app-brand);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.auth-footer-link:hover { text-decoration: underline; text-underline-offset: 3px; }

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-kicker {
    margin: 0 0 6px;
    color: var(--app-gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.entry-heading { align-items: flex-start; }
.entry-filters { margin-bottom: 18px; }
.import-panel {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
    padding: 20px;
}
.import-panel .panel-heading { margin: 0 0 4px; }
.import-panel .panel-description { margin: 0; }
.import-form {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) minmax(220px, 1fr) auto;
    align-items: end;
    gap: 12px;
}
.import-form label { margin: 0; }
.import-form button { min-height: 42px; }
.import-summary {
    margin-bottom: 18px;
    padding: 16px 20px;
    color: var(--app-ink);
}
.import-summary ul { margin: 8px 0 0; padding-left: 20px; color: var(--app-danger); }
.entry-list { display: grid; gap: 12px; }
.entry-card {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, .9fr);
    gap: 18px;
    padding: 18px 20px;
    align-items: center;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.entry-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--app-brand) 28%, var(--app-border));
    box-shadow: 0 16px 36px rgb(15 42 29 / 8%);
}
.entry-card-main { display: grid; gap: 12px; min-width: 0; }
.entry-card-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.entry-avatar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(160deg, var(--app-brand), var(--app-brand-strong));
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    box-shadow: 0 8px 18px rgb(18 59 43 / 16%);
}
.entry-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}
.entry-card-copy { min-width: 0; }
.entry-card-name {
    margin: 0;
    color: var(--app-ink);
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.entry-card-email {
    margin: 3px 0 0;
    color: var(--app-muted);
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.entry-card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.entry-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: #fff;
    color: var(--app-ink);
    font-size: 12px;
    font-weight: 700;
}
.entry-chip img {
    width: 28px;
    height: 20px;
    object-fit: contain;
}
.entry-chip-muted {
    color: var(--app-muted);
    background: #f7f9f7;
}
.entry-card-actions {
    display: grid;
    gap: 10px;
    justify-items: stretch;
    align-content: center;
    min-width: 0;
}
.entry-card-actions > .btn-primary,
.entry-card-actions > .btn-secondary { width: 100%; }
.entry-card-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
}
.entry-waiting {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--app-warning-soft);
    color: var(--app-warning);
    font-size: 12px;
    font-weight: 750;
}
.entry-empty {
    padding: 48px 24px;
    text-align: center;
}
.entry-empty strong {
    display: block;
    margin-bottom: 6px;
    color: var(--app-ink);
    font-size: 16px;
    font-weight: 800;
}
.entry-empty p {
    margin: 0 0 18px;
    color: var(--app-muted);
    font-size: 14px;
}
.entry-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 4px;
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 650;
}
.entry-pagination-summary { margin-right: auto; }
.entry-pagination-nav, .entry-pagination-links {
    display: flex;
    align-items: center;
    gap: 6px;
}
.entry-pagination .is-current {
    border-color: var(--app-brand);
    background: var(--app-brand);
    color: #fff;
    cursor: default;
}
.entry-pagination .is-disabled {
    background: #f3f5f3;
    color: var(--app-muted);
    cursor: not-allowed;
}
.entry-you {
    display: inline-flex;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--app-gold-soft);
    color: #6f5520;
    font-size: 11px;
    font-weight: 750;
    vertical-align: middle;
}
.user-role-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.user-role-form .role-select {
    min-height: 34px;
    margin: 0;
    min-width: 160px;
}
.user-card .entry-card-actions { gap: 12px; }
.audit-avatar {
    background: linear-gradient(160deg, #2f5f4a, var(--app-brand-strong));
}
.audit-details-card {
    width: 100%;
}
.audit-details-card > summary {
    list-style: none;
    display: inline-flex;
    width: auto;
    cursor: pointer;
}
.audit-details-card > summary::-webkit-details-marker { display: none; }
.audit-details-card[open] > summary { margin-bottom: 10px; }
.audit-details-card dl {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: #f7f9f7;
}
.audit-card { align-items: start; }

.card-preview-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.card-preview-company { min-width: 0; padding: 20px; }
.card-preview-brand-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-preview-brand-header h2 { margin: 0; color: var(--app-ink); font-size: 16px; font-weight: 800; }
.card-preview-brand-header p { margin: 3px 0 0; color: var(--app-muted); font-size: 12px; font-weight: 600; }
.card-preview-status { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 8px; font-size: 10px; font-weight: 750; }
.card-preview-status.is-selected { background: var(--app-success-soft); color: var(--app-success); }
.card-preview-status.is-preview-only { background: #f3f5f3; color: var(--app-muted); }
.card-preview-faces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; margin-inline: auto; gap: 12px; }
.card-preview-face { min-width: 0; margin: 0; }
.card-preview-image-frame { padding: 8px; border: 1px solid var(--app-border); border-radius: 14px; background: #f7f9f7; }
.card-preview-image-frame img { display: block; width: 100%; height: auto; border-radius: 8px; }
.card-preview-face figcaption { margin-top: 8px; color: var(--app-muted); font-size: 12px; font-weight: 650; text-align: center; }
.review-photo-preview { display: block; width: 76px; height: 76px; border: 1px solid var(--app-border); border-radius: 12px; object-fit: cover; object-position: center top; }

@media (max-width: 1000px) {
    .app-header-inner { gap: 16px; }
    .app-nav { gap: 0; }
    .app-nav-link { padding-inline: 8px; font-size: 12px; }
    .role-badge { display: none; }
    .auth-shell { grid-template-columns: 1fr; width: min(100%, 520px); }
    .auth-hero { min-height: auto; }
}

@media (max-width: 1040px) {
    .app-header-inner { width: min(100% - 32px, 1320px); min-height: 66px; }
    .app-nav-desktop, .app-account { display: none; }
    .mobile-nav { display: block; margin-left: auto; }
    .mobile-nav summary {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
        padding: 8px 12px;
        border: 1px solid var(--app-border);
        border-radius: 10px;
        background: #fff;
        color: var(--app-ink);
        font-size: 13px;
        font-weight: 700;
    }
    .app-main { width: min(100% - 32px, 1320px); padding-top: 26px; }
    body.app-body.is-guest .app-main { width: min(100% - 24px, 1120px); }
    .filter-grid, .employee-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-grid > :first-child,
    .employee-filter-grid > :first-child { grid-column: 1 / -1; }
    .filter-actions { justify-content: flex-start; }
}

@media (max-width: 900px) {
    .entry-card {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 14px;
    }
    .entry-card-actions { width: 100%; }
}

@media (max-width: 600px) {
    .app-main { width: min(100% - 28px, 1320px); padding: 22px 0 42px; }
    .app-header-inner { width: min(100% - 28px, 1320px); }
    .app-brand-copy { display: block; }
    .app-brand-caption { margin-top: 2px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 18px; }
    .page-heading h1, .page-title { font-size: 25px; }
    .filter-panel, .panel-padding { padding: 16px; }
    .filter-grid, .employee-filter-grid, .form-grid, .review-actions, .data-list { grid-template-columns: minmax(0, 1fr); }
    .filter-grid > :first-child,
    .employee-filter-grid > :first-child,
    .form-grid .span-all { grid-column: auto; }
    .profile-choice img { width: 94px; height: 44px; }
    .brand-choice-grid { grid-template-columns: minmax(0, 1fr); }
    .card-preview-grid { grid-template-columns: minmax(0, 1fr); }
    .card-preview-company { padding: 15px; }
    .card-preview-faces { gap: 8px; }
    .card-preview-image-frame { padding: 4px; }
    .app-main table { min-width: 680px; }
    .app-main .queue-table { min-width: 560px; }
    .app-main .review-compare-table { min-width: 720px; }
    .auth-shell { padding-block: 18px; gap: 14px; }
    .auth-hero { padding: 20px; border-radius: 18px; }
    .auth-panel { padding: 22px; border-radius: 18px; }
    .profile-meta { gap: 7px; }
    .account-grid { grid-template-columns: 1fr; }
    .account-details, .account-password { padding: 18px; }
    .account-details dl > div { grid-template-columns: minmax(125px, .8fr) minmax(0, 1fr); gap: 10px; }
    .form-actions.is-sticky { bottom: 8px; }
    .entry-card { padding: 16px; }
    .entry-avatar { width: 42px; height: 42px; border-radius: 12px; }
    .entry-pagination { flex-direction: column; align-items: flex-start; }
    .import-form { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
    .auth-shell, .auth-layout { animation: none; }
    .entry-card:hover { transform: none; }
}
