:root {
    --bg: #f5eddc;
    --bg-alt: #eadfc4;
    --panel: rgba(255, 251, 243, 0.92);
    --panel-strong: #14352d;
    --text: #1d2d2a;
    --muted: #5f6d68;
    --line: rgba(29, 45, 42, 0.12);
    --accent: #b76e2a;
    --success: #2f7a59;
    --danger: #b44637;
    --shadow: 0 18px 40px rgba(46, 31, 14, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Manrope", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(183, 110, 42, 0.18), transparent 24rem),
        radial-gradient(circle at top right, rgba(20, 53, 45, 0.18), transparent 22rem),
        linear-gradient(180deg, #f9f3e8 0%, var(--bg) 45%, var(--bg-alt) 100%);
}

body.rtl {
    font-family: "Noto Nastaliq Urdu", "Manrope", sans-serif;
}

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

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

.page-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 18px 40px;
}

.topbar,
.hero,
.stat-card,
.panel,
.flash {
    animation: rise 0.55s ease both;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.brand-panel,
.panel,
.stat-card,
.flash {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.brand-panel {
    padding: 18px 20px;
    min-width: min(100%, 380px);
}

.brand-link {
    display: flex;
    gap: 16px;
    align-items: center;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), #cf9a59);
    color: #fffaf3;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px;
}

.brand-title,
.hero h1,
.hero h2,
.section-heading h1,
.panel-header h2 {
    margin: 0;
    font-family: "Space Grotesk", "Manrope", sans-serif;
}

body.rtl .brand-title,
body.rtl .hero h1,
body.rtl .hero h2,
body.rtl .section-heading h1,
body.rtl .panel-header h2 {
    font-family: "Noto Nastaliq Urdu", "Manrope", sans-serif;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.brand-copy {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.nav-cluster,
.nav-links,
.hero-actions,
.toolbar,
.action-row,
.language-switcher,
.session-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.nav-cluster {
    justify-content: flex-end;
}

.mobile-nav {
    display: none;
    width: 100%;
}

.nav-link,
.lang-link,
.button,
.text-link {
    transition: 0.2s ease;
}

.nav-link,
.lang-link {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.64);
    padding: 10px 14px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.nav-link:hover,
.lang-link:hover,
.text-link:hover {
    transform: translateY(-1px);
}

.nav-link.active,
.lang-link.active {
    background: var(--panel-strong);
    color: #fef5e7;
    border-color: transparent;
}

.switch-label {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(20, 53, 45, 0.06);
    color: var(--panel-strong);
    font-size: 0.9rem;
    font-weight: 700;
}

.logout-form {
    margin: 0;
}

.hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.6fr 0.9fr;
    gap: 24px;
    padding: 30px;
    margin-bottom: 22px;
    border-radius: 32px;
    border: 1px solid rgba(20, 53, 45, 0.12);
    background:
        linear-gradient(135deg, rgba(20, 53, 45, 0.96), rgba(41, 90, 74, 0.92)),
        linear-gradient(180deg, rgba(183, 110, 42, 0.18), transparent 55%);
    color: #fef6ea;
    box-shadow: var(--shadow);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -40px -90px auto;
    width: 220px;
    height: 220px;
    border-radius: 48px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04));
    transform: rotate(22deg);
}

.eyebrow,
.mini-label {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffe8c7;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero h1 {
    margin-top: 16px;
    font-size: clamp(2rem, 5vw, 3.35rem);
    line-height: 1.05;
}

.hero p {
    max-width: 54ch;
    color: rgba(254, 246, 234, 0.78);
    line-height: 1.8;
}

.hero-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    background: rgba(255, 248, 236, 0.1);
    backdrop-filter: blur(10px);
}

.hero-panel h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.1;
}

.hero-metrics,
.stats-grid,
.section-grid,
.form-grid,
.meta-grid {
    display: grid;
    gap: 18px;
}

.hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-metrics div {
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
}

.hero-metrics span,
.meta-grid span,
.notification-meta span,
.stat-card span,
.field label,
.table-wrap th,
.payment-side span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.hero-metrics strong,
.stat-card strong {
    display: block;
    margin-top: 8px;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 22px;
}

.stat-card {
    padding: 22px;
}

.stat-card strong {
    font-size: 1.8rem;
    color: var(--panel-strong);
}

.section-grid {
    grid-template-columns: 1.25fr 0.95fr;
}

.panel {
    padding: 24px;
}

.panel-header,
.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: end;
    margin-bottom: 20px;
}

.panel-header h2,
.section-heading h1 {
    font-size: 1.65rem;
    line-height: 1.15;
}

.panel-header p,
.section-heading p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.75;
}

.text-link {
    color: var(--accent);
    font-weight: 700;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    border: 1px solid transparent;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
}

.button.primary {
    background: linear-gradient(135deg, var(--accent), #ce9156);
    color: #fff9f1;
}

.button.secondary {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff6e5;
}

.button.tertiary {
    background: #fff6eb;
    border-color: rgba(183, 110, 42, 0.18);
    color: var(--accent);
}

.button.small {
    padding: 9px 12px;
    border-radius: 14px;
}

.button.danger {
    background: rgba(180, 70, 55, 0.12);
    border-color: rgba(180, 70, 55, 0.16);
    color: var(--danger);
}

.button.light {
    background: rgba(20, 53, 45, 0.06);
    border-color: var(--line);
    color: var(--panel-strong);
}

.filter-card {
    padding: 0;
    overflow: hidden;
}

.filter-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    cursor: pointer;
    list-style: none;
    font-size: 0.98rem;
    font-weight: 700;
}

.filter-toggle::-webkit-details-marker,
.mobile-nav-toggle::-webkit-details-marker {
    display: none;
}

.filter-toggle strong {
    display: block;
    margin-bottom: 4px;
    color: var(--panel-strong);
}

.filter-toggle small {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(20, 53, 45, 0.08);
    color: var(--panel-strong);
}

.filter-form {
    padding: 0 24px 24px;
    border-top: 1px solid var(--line);
}

.mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--panel-strong);
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.mobile-nav-panel {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.mobile-nav-links {
    display: grid;
    gap: 10px;
}

.mobile-nav-links .nav-link,
.mobile-language-switcher .lang-link {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.mobile-language-switcher {
    margin-top: 16px;
    justify-content: center;
}

.search-form {
    gap: 8px;
}

.search-input {
    min-width: min(100%, 320px);
}

.due-card,
.payment-row {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.54);
}

.due-card + .due-card,
.payment-row + .payment-row {
    margin-top: 14px;
}

.due-card-header,
.payment-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.due-card h3,
.payment-row h3 {
    margin: 0;
    font-size: 1.05rem;
}

.due-card p,
.payment-row p {
    margin: 6px 0 0;
    color: var(--muted);
}

.meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.meta-grid strong {
    display: block;
    margin-top: 8px;
}

.payment-side {
    text-align: end;
}

.progress-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.progress {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(20, 53, 45, 0.08);
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--accent), #f0b16a);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 800;
}

.badge-available {
    background: rgba(47, 122, 89, 0.12);
    color: var(--success);
}

.badge-reserved,
.badge-active,
.badge-installment {
    background: rgba(183, 110, 42, 0.12);
    color: var(--accent);
}

.badge-sold,
.badge-completed,
.badge-adjustment {
    background: rgba(20, 53, 45, 0.12);
    color: var(--panel-strong);
}

.badge-cancelled,
.badge-overdue {
    background: rgba(180, 70, 55, 0.12);
    color: var(--danger);
}

.badge-pending,
.badge-partial,
.badge-booking,
.badge-final,
.badge-inactive,
.badge-skipped {
    background: rgba(68, 96, 196, 0.12);
    color: #3754ab;
}

.badge-today {
    background: rgba(47, 122, 89, 0.18);
    color: #206447;
}

.dashboard-notification-stats {
    margin-bottom: 18px;
}

.notification-row {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.58);
}

.notification-row + .notification-row {
    margin-top: 14px;
}

.notification-overdue {
    border-color: rgba(180, 70, 55, 0.2);
}

.notification-today {
    border-color: rgba(47, 122, 89, 0.24);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.notification-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.notification-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.notification-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.notification-meta strong {
    display: block;
    margin-top: 8px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 18px;
    background:
        radial-gradient(circle at top left, rgba(183, 110, 42, 0.18), transparent 24rem),
        radial-gradient(circle at top right, rgba(20, 53, 45, 0.18), transparent 22rem),
        linear-gradient(180deg, #f9f3e8 0%, var(--bg) 45%, var(--bg-alt) 100%);
}

.auth-card {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    border: 1px solid var(--line);
    border-radius: 32px;
    overflow: hidden;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.auth-side {
    padding: 32px;
    color: #fef6ea;
    background:
        linear-gradient(135deg, rgba(20, 53, 45, 0.96), rgba(41, 90, 74, 0.92)),
        linear-gradient(180deg, rgba(183, 110, 42, 0.18), transparent 55%);
}

.auth-copy {
    margin-top: 40px;
}

.auth-side .brand-copy {
    color: rgba(254, 246, 234, 0.72);
}

.auth-copy h1 {
    margin: 18px 0 12px;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
}

body.rtl .auth-copy h1 {
    font-family: "Noto Nastaliq Urdu", "Manrope", sans-serif;
}

.auth-copy p {
    max-width: 42ch;
    color: rgba(254, 246, 234, 0.82);
    line-height: 1.85;
}

.auth-language-switcher {
    margin-top: 28px;
}

.auth-demo-card {
    margin-top: 28px;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff6e5;
}

.auth-demo-card p {
    margin: 10px 0 0;
}

.auth-form-panel {
    padding: 32px;
}

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

.checkbox-field {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 0.92rem;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.auth-submit {
    width: 100%;
}

.table-wrap {
    overflow-x: auto;
}

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

th,
td {
    padding: 14px 12px;
    text-align: start;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.45);
}

.empty-state {
    padding: 24px;
    border: 1px dashed rgba(20, 53, 45, 0.18);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.4);
    text-align: center;
    color: var(--muted);
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field.is-hidden {
    display: none !important;
}

.field-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.field-hint,
.muted-copy {
    color: var(--muted);
    font-size: 0.88rem;
}

.help-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(20, 53, 45, 0.08);
    color: var(--panel-strong);
    font-size: 0.76rem;
    font-weight: 800;
    cursor: help;
}

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

.checkbox-stack {
    justify-content: flex-end;
}

.selection-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.66);
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.selection-grid strong {
    display: block;
    margin-top: 8px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    padding: 14px 16px;
    color: var(--text);
}

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

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(183, 110, 42, 0.18);
    border-color: rgba(183, 110, 42, 0.36);
}

.flash {
    margin-bottom: 16px;
    padding: 16px 18px;
}

.flash-success {
    border-color: rgba(47, 122, 89, 0.18);
}

.flash-error {
    border-color: rgba(180, 70, 55, 0.18);
}

.error-list {
    margin: 10px 0 0;
    padding-inline-start: 20px;
}

.inline-form {
    display: inline;
}

.footer-note {
    margin-top: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 960px) {
    .topbar,
    .section-grid,
    .hero,
    .panel-header,
    .section-heading,
    .payment-row,
    .due-card-header {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .hero-panel,
    .hero-copy,
    .payment-side {
        text-align: start;
    }

    .form-grid,
    .hero-metrics,
    .meta-grid,
    .selection-grid,
    .notification-meta,
    .auth-card {
        grid-template-columns: 1fr;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    .filter-toggle {
        padding: 18px 20px;
    }

    .filter-form {
        padding: 0 20px 20px;
    }

    .auth-side,
    .auth-form-panel {
        padding: 24px;
    }

    .mobile-session-tools {
        margin-top: 16px;
        justify-content: center;
    }

    table {
        min-width: 640px;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding-inline: 14px;
    }

    .brand-link {
        align-items: flex-start;
    }

    .hero {
        padding: 22px;
    }

    .panel,
    .stat-card,
    .brand-panel {
        border-radius: 22px;
    }

    .brand-title {
        font-size: 1.05rem;
    }

    .brand-copy,
    .panel-header p,
    .section-heading p,
    .footer-note {
        font-size: 0.82rem;
        line-height: 1.65;
    }

    .panel,
    .stat-card,
    .brand-panel,
    .mobile-nav-panel {
        padding: 18px;
    }

    .filter-card {
        padding: 0;
    }

    .section-heading h1,
    .panel-header h2 {
        font-size: 1.35rem;
    }

    .nav-link,
    .lang-link,
    .button,
    .mobile-nav-toggle,
    .user-chip {
        padding: 10px 12px;
        border-radius: 14px;
        font-size: 0.82rem;
    }

    .switch-label,
    .hero-metrics span,
    .meta-grid span,
    .stat-card span,
    .field label,
    .table-wrap th,
    .payment-side span,
    .filter-toggle small {
        font-size: 0.78rem;
    }

    .stat-card strong {
        font-size: 1.45rem;
    }

    .toolbar {
        width: 100%;
    }

    .toolbar .button,
    .toolbar > a.button,
    .toolbar > button.button {
        flex: 1 1 calc(50% - 8px);
    }

    .search-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .search-input {
        min-width: 0;
        width: 100%;
    }

    .search-form .button {
        flex: 1 1 calc(50% - 8px);
    }

    .action-row {
        gap: 8px;
    }

    .notification-row {
        padding: 16px;
    }

    .notification-header {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-shell {
        padding: 16px 14px;
    }

    .auth-side,
    .auth-form-panel {
        padding: 20px;
    }

    .auth-copy {
        margin-top: 28px;
    }

    .checkbox-field {
        font-size: 0.84rem;
    }

    table {
        min-width: 540px;
    }

    .filter-toggle {
        padding: 16px 18px;
        font-size: 0.9rem;
    }

    .filter-form {
        padding: 0 18px 18px;
    }
}
