/**
 * OSGB Design System — 2026 SaaS / ERP shell
 * Faz 1–2: tokens + layout density + typography + buttons
 * Soft override: layouts/app.blade.php inline stillerinden SONRA yüklenir.
 */

:root {
    /* Layout metrics */
    --topbar-h: 56px;
    --sidebar-w: 240px;
    --sidebar-collapsed-w: 68px;
    --footer-h: 52px;
    --main-pad-x: 1.25rem;
    --main-pad-y: 1rem;

    /* Surfaces — pastel sage, logo green family */
    --bg: #f2f6f3;
    --bg-grad: #f2f6f3;
    --panel: #ffffff;
    --panel2: #f7faf7;
    --surface: #ffffff;
    --surface-muted: #eef5f0;

    /* Borders / text */
    --border: #d5e3d9;
    --border-strong: #c3d5c9;
    --text: #1c2b22;
    --text-primary: #1c2b22;
    --text-secondary: #4d6156;
    --muted: #5d6f64;

    /* Brand — logo green, kept quiet for small text */
    --accent: #2f7a4c;
    --accent-2: #276843;
    --accent-dim: #1f5536;
    --primary: #2f7a4c;
    --secondary: #6d7f74;
    --success: #3d8f5c;
    --warning: #c4843a;
    --danger: #c45454;
    --info: #5d8f86;
    --bs-primary: #2f7a4c;
    --bs-primary-rgb: 47, 122, 76;
    --bs-link-color: #276843;
    --bs-link-hover-color: #1f5536;

    /* Radius scale (controlled) */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius: 8px;

    /* Shadow — minimal */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow: none;

    /* Motion */
    --ease: 150ms ease;
    --ease-med: 200ms ease;

    /* Sidebar */
    --sidebar-bg: #fbfcfb;
    --sidebar-item-hover: rgba(47, 90, 62, 0.05);
    --sidebar-item-active: rgba(47, 122, 76, 0.12);
    --ui-line-w: 1px;

    /* Type */
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --fs-body: 14px;
    --fs-table: 13px;
    --fs-secondary: 12px;
    --fs-title: 1.25rem;
}

[data-theme="dark"] {
    --bg: #121a15;
    --bg-grad: #121a15;
    --panel: #1a2420;
    --panel2: #22302a;
    --surface: #1a2420;
    --surface-muted: #22302a;
    --border: #2c3d34;
    --border-strong: #3a5144;
    --text: #eef6f0;
    --text-primary: #eef6f0;
    --text-secondary: #c5d6cb;
    --muted: #a3b8aa;
    --accent: #9dccab;
    --accent-2: #b7dcc2;
    --accent-dim: #cfe6d6;
    --primary: #9dccab;
    --success: #86c99a;
    --warning: #e2b56a;
    --danger: #e08b8b;
    --info: #9ec9c0;
    --bs-primary: #9dccab;
    --bs-primary-rgb: 157, 204, 171;
    --bs-link-color: #b7dcc2;
    --bs-link-hover-color: #cfe6d6;
    --sidebar-bg: #101814;
    --sidebar-item-hover: rgba(157, 204, 171, 0.08);
    --sidebar-item-active: rgba(157, 204, 171, 0.16);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ——— Base density ——— */
body {
    font-family: var(--font) !important;
    font-size: var(--fs-body) !important;
    font-weight: 450 !important;
    line-height: 1.5 !important;
    background: var(--bg) !important;
    background-attachment: scroll !important;
    color: var(--text) !important;
}

main:not(.main--guest-home):not(.main--guest-page) {
    padding: var(--main-pad-y) var(--main-pad-x) !important;
}

.page-title {
    font-size: var(--fs-title) !important;
    font-weight: 650 !important;
    letter-spacing: -0.02em !important;
    margin: 0 0 0.2rem !important;
    text-align: left !important;
}

.page-desc {
    font-size: var(--fs-secondary) !important;
    color: var(--muted) !important;
    margin: 0 0 1rem !important;
    max-width: 42rem !important;
    font-weight: 450 !important;
}

/* ——— Cards / surfaces ——— */
.card {
    background: var(--panel) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 1rem 1.15rem !important;
    box-shadow: none !important;
}

.kpi {
    border-radius: var(--radius-md) !important;
    padding: 0.85rem 1rem !important;
    background: var(--panel) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

/* ——— Buttons (shadcn/ui style standardization) ——— */
.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem !important;
    border-radius: var(--radius-sm, 6px) !important;
    padding: 0.45rem 0.85rem !important;
    min-height: 2.25rem !important;
    font-size: 0.8125rem !important;
    font-weight: 550 !important;
    line-height: 1.2 !important;
    border: 1px solid transparent !important;
    cursor: pointer !important;
    font-family: inherit !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    backdrop-filter: none !important;
    transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}
.btn:hover:not(:disabled) {
    transform: none !important;
}
.btn:focus:not(:focus-visible) {
    outline: none !important;
}
.btn:focus-visible {
    outline: 2px solid var(--accent, #2f7a4c) !important;
    outline-offset: 2px !important;
}
.btn:disabled,
.btn.disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Button variants */
.btn-primary {
    background: var(--accent) !important;
    background-image: none !important;
    border-color: var(--accent) !important;
    color: #ffffff !important;
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-2) !important;
    border-color: var(--accent-2) !important;
    color: #ffffff !important;
}
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover:not(:disabled) {
    color: #122016 !important;
}

.btn-secondary,
.btn-outline,
.btn-default {
    background: var(--panel) !important;
    background-image: none !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}
.btn-secondary:hover:not(:disabled),
.btn-outline:hover:not(:disabled),
.btn-default:hover:not(:disabled) {
    background: var(--surface-muted) !important;
    border-color: var(--border-strong) !important;
    color: var(--text) !important;
}

.btn-ghost {
    background: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    color: var(--text-secondary) !important;
}
.btn-ghost:hover:not(:disabled) {
    background: var(--sidebar-item-hover) !important;
    color: var(--text) !important;
}

.btn-danger,
.btn-destructive {
    background: var(--danger, #dc2626) !important;
    background-image: none !important;
    border-color: var(--danger, #dc2626) !important;
    color: #ffffff !important;
}
.btn-danger:hover:not(:disabled),
.btn-destructive:hover:not(:disabled) {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.btn-success {
    background: var(--success, #3d8f5c) !important;
    background-image: none !important;
    border-color: var(--success, #3d8f5c) !important;
    color: #ffffff !important;
}
.btn-success:hover:not(:disabled) {
    background: var(--accent-2, #276843) !important;
    border-color: var(--accent-2, #276843) !important;
    color: #ffffff !important;
}

.btn-warning {
    background: var(--warning, #c4843a) !important;
    background-image: none !important;
    border-color: var(--warning, #c4843a) !important;
    color: #ffffff !important;
}
.btn-warning:hover:not(:disabled) {
    background: #a86a28 !important;
    border-color: #a86a28 !important;
    color: #ffffff !important;
}

.btn-info {
    background: var(--info, #5d8f86) !important;
    background-image: none !important;
    border-color: var(--info, #5d8f86) !important;
    color: #ffffff !important;
}
.btn-info:hover:not(:disabled) {
    background: #477169 !important;
    border-color: #477169 !important;
    color: #ffffff !important;
}

/* Button sizes */
.btn-sm {
    min-height: 1.875rem !important;
    padding: 0.25rem 0.65rem !important;
    font-size: 0.75rem !important;
}
.btn-lg {
    min-height: 2.5rem !important;
    padding: 0.55rem 1.15rem !important;
    font-size: 0.875rem !important;
}
.btn-icon {
    width: 2.25rem !important;
    min-width: 2.25rem !important;
    height: 2.25rem !important;
    min-height: 2.25rem !important;
    padding: 0 !important;
}
.btn-icon.btn-sm {
    width: 1.875rem !important;
    min-width: 1.875rem !important;
    height: 1.875rem !important;
    min-height: 1.875rem !important;
    padding: 0 !important;
}

/* ——— Form inputs / selects / textareas (shadcn/ui style standardization) ——— */
html:not(.is-guest-home) .field input,
html:not(.is-guest-home) .field textarea,
html:not(.is-guest-home) .field select,
html:not(.is-guest-home) input[type="text"]:not(.wh *),
html:not(.is-guest-home) input[type="search"]:not(.wh *),
html:not(.is-guest-home) input[type="email"]:not(.wh *),
html:not(.is-guest-home) input[type="password"]:not(.wh *),
html:not(.is-guest-home) input[type="number"]:not(.wh *),
html:not(.is-guest-home) input[type="date"]:not(.wh *),
html:not(.is-guest-home) input[type="tel"]:not(.wh *),
html:not(.is-guest-home) select:not(.wh *),
html:not(.is-guest-home) textarea:not(.wh *),
html:not(.is-guest-home) .form-control:not(.wh *) {
    box-sizing: border-box !important;
    border-radius: var(--radius-sm, 6px) !important;
    border: 1px solid var(--border-strong, #c3d5c9) !important;
    padding: 0.45rem 0.75rem !important;
    font-size: var(--fs-body, 14px) !important;
    font-family: inherit !important;
    background: var(--panel) !important;
    color: var(--text) !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    transition: border-color var(--ease), outline var(--ease) !important;
}
html:not(.is-guest-home) input[type="text"]:not(.wh *),
html:not(.is-guest-home) input[type="search"]:not(.wh *),
html:not(.is-guest-home) input[type="email"]:not(.wh *),
html:not(.is-guest-home) input[type="password"]:not(.wh *),
html:not(.is-guest-home) input[type="number"]:not(.wh *),
html:not(.is-guest-home) input[type="date"]:not(.wh *),
html:not(.is-guest-home) input[type="tel"]:not(.wh *),
html:not(.is-guest-home) select:not(.wh *),
html:not(.is-guest-home) .field input,
html:not(.is-guest-home) .field select {
    min-height: 2.25rem !important;
}
html:not(.is-guest-home) textarea:not(.wh *),
html:not(.is-guest-home) .field textarea {
    min-height: 5rem !important;
    resize: vertical !important;
}
html:not(.is-guest-home) input:focus:not(:focus-visible),
html:not(.is-guest-home) select:focus:not(:focus-visible),
html:not(.is-guest-home) textarea:focus:not(:focus-visible) {
    outline: none !important;
}
html:not(.is-guest-home) input:focus-visible:not(.wh *),
html:not(.is-guest-home) select:focus-visible:not(.wh *),
html:not(.is-guest-home) textarea:focus-visible:not(.wh *),
html:not(.is-guest-home) .form-control:focus {
    outline: 2px solid var(--accent, #2f7a4c) !important;
    outline-offset: 1px !important;
    border-color: var(--accent, #2f7a4c) !important;
    box-shadow: none !important;
}
html:not(.is-guest-home) input:disabled,
html:not(.is-guest-home) select:disabled,
html:not(.is-guest-home) textarea:disabled,
html:not(.is-guest-home) input[readonly],
html:not(.is-guest-home) textarea[readonly] {
    background: var(--surface-muted) !important;
    color: var(--muted) !important;
    cursor: not-allowed !important;
    opacity: 0.8 !important;
}
html:not(.is-guest-home) input::placeholder,
html:not(.is-guest-home) textarea::placeholder {
    color: var(--muted) !important;
    opacity: 0.85 !important;
}
html:not(.is-guest-home) input[type="checkbox"],
html:not(.is-guest-home) input[type="radio"] {
    accent-color: var(--accent, #2f7a4c) !important;
    cursor: pointer !important;
}

/* ——— Search inputs & filter toolbars ——— */
html:not(.is-guest-home) input[type="search"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235d6f64' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: 0.65rem center !important;
    background-size: 0.95rem 0.95rem !important;
    padding-left: 2.15rem !important;
}
html:not(.is-guest-home) .firms-list-toolbar__input {
    border-radius: var(--radius-sm, 6px) !important;
    border: 1px solid var(--border-strong) !important;
    min-height: 2.25rem !important;
    background-color: var(--panel) !important;
    color: var(--text) !important;
    font-size: var(--fs-body) !important;
}
html:not(.is-guest-home) .firms-list-toolbar__btn {
    border-radius: var(--radius-sm, 6px) !important;
    min-height: 2.25rem !important;
    border: 1px solid var(--border) !important;
    background: var(--panel) !important;
    color: var(--text) !important;
    font-weight: 550 !important;
    padding: 0 0.85rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    transition: background var(--ease), border-color var(--ease) !important;
}
html:not(.is-guest-home) .firms-list-toolbar__btn:hover {
    background: var(--surface-muted) !important;
    border-color: var(--border-strong) !important;
}
html:not(.is-guest-home) .firms-list-toolbar__btn.is-active {
    background: var(--sidebar-item-active) !important;
    border-color: var(--accent) !important;
    color: var(--accent-dim) !important;
}
html:not(.is-guest-home) .firms-list-toolbar__btn--primary {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}
html:not(.is-guest-home) .firms-list-toolbar__btn--primary:hover {
    background: var(--accent-2) !important;
    border-color: var(--accent-2) !important;
}

/* ——— Sidebar ——— */
.sidebar {
    width: var(--sidebar-w) !important;
    max-width: var(--sidebar-w) !important;
    background: var(--sidebar-bg) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-right: 1px solid var(--border) !important;
    box-shadow: none !important;
}
@media (min-width: 1025px) {
    .sidebar {
        width: var(--sidebar-w) !important;
        box-shadow: none !important;
    }
    .layout--sidebar-open .app-shell {
        padding-left: var(--sidebar-w) !important;
    }
    .layout--sidebar-open .app-shell > .topbar {
        left: var(--sidebar-w) !important;
    }
}

.sidebar-brand {
    /* Topbar ile aynı kutu yüksekliği; alt sınır navbar alt çizgisi ile aynı hizada */
    height: var(--topbar-h) !important;
    min-height: var(--topbar-h) !important;
    max-height: var(--topbar-h) !important;
    flex: 0 0 var(--topbar-h) !important;
    box-sizing: border-box !important;
    padding: 0 0.85rem !important;
    border-bottom: 1px solid var(--border) !important;
    background: var(--panel) !important;
    gap: 0.55rem !important;
    overflow: hidden !important;
    align-items: center !important;
}
@media (min-width: 1025px) {
    .layout--sidebar-open .sidebar,
    html.sidebar-pref-open .sidebar {
        transform: translateX(0) !important;
    }
}
.sidebar-brand__mark {
    width: 1.75rem !important;
    height: 1.75rem !important;
    border-radius: var(--radius-sm) !important;
    background: var(--accent) !important;
    background-image: none !important;
    box-shadow: none !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
}
.sidebar-brand__name {
    font-size: 0.8125rem !important;
    font-weight: 650 !important;
}
.sidebar-brand__sub {
    font-size: 0.625rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
}

.sidebar .acc-btn {
    border-radius: var(--radius-sm) !important;
    padding: 0.4rem 0.65rem !important;
    font-size: 0.8125rem !important;
    font-weight: 550 !important;
    margin: 0.05rem 0 !important;
    gap: 0.5rem !important;
    position: relative;
}
.sidebar .acc-btn:hover {
    background: var(--sidebar-item-hover) !important;
    color: var(--text) !important;
}
.sidebar .acc-btn.is-open {
    background: var(--sidebar-item-active) !important;
    color: var(--accent-dim) !important;
}
.sidebar .acc-btn.is-open::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 2px;
    border-radius: 1px;
    background: var(--accent);
}

.sidebar .nav a,
.sidebar .acc-list a,
.sidebar .nav-single-link {
    border-radius: var(--radius-sm) !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    padding: 0.32rem 0.65rem 0.32rem 1.85rem !important;
    margin: 0 !important;
}
.sidebar .nav a.active,
.sidebar .acc-list a.active {
    background: var(--sidebar-item-active) !important;
    color: var(--accent-dim) !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

.sidebar-nav-icon {
    width: 1.05rem !important;
    height: 1.05rem !important;
    color: var(--muted) !important;
    opacity: 1 !important;
}
.sidebar .acc-btn.is-open .sidebar-nav-icon,
.sidebar .nav a.active .sidebar-nav-icon {
    color: var(--accent) !important;
}

.nav-section-label,
.nav-group-title {
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    padding: 0.65rem 0.75rem 0.25rem !important;
    color: var(--muted) !important;
}

.sidebar-version {
    padding: 0.4rem 0.75rem !important;
    background: var(--panel2) !important;
    border-top: 1px solid var(--border) !important;
    backdrop-filter: none !important;
}
.sidebar-version__value {
    border-radius: var(--radius-xs) !important;
    font-size: 0.65rem !important;
    padding: 0.1rem 0.35rem !important;
    background: var(--sidebar-item-active) !important;
}

.sidebar-debug {
    display: none !important; /* normal UI'da gizli; super_admin için layout'ta açılır */
}
.sidebar-debug.is-allowed {
    display: block !important;
    background: var(--panel2) !important;
    border-top: 1px solid var(--border) !important;
}
.sidebar-debug__toggle,
.sidebar-debug__panel {
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
}

/* ——— Topbar ——— */
.topbar:not(.topbar--guest) {
    height: var(--topbar-h) !important;
    min-height: var(--topbar-h) !important;
    max-height: var(--topbar-h) !important;
    box-sizing: border-box !important;
    background: var(--panel) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: none !important;
    padding: 0 0.85rem !important;
    gap: 0.75rem !important;
}
/* Dikey çizgi sidebar border-right’ta; topbar sol border çift L çizgisi yapmasın */
.app-shell .topbar {
    border-left: none !important;
}

.topbar-brand {
    /* Logo sidebar'da; topbar'da breadcrumb öncelikli — logo kompakt */
    flex-shrink: 0;
}
@media (min-width: 1025px) {
    .topbar-brand {
        display: none !important;
    }
}

.topbar-crumb {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.05rem;
}
.topbar-crumb__path {
    font-size: var(--fs-secondary);
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}
.topbar-crumb__path a {
    color: var(--muted);
    text-decoration: none;
}
.topbar-crumb__path a:hover {
    color: var(--accent);
}
.topbar-crumb__sep {
    margin: 0 0.35rem;
    opacity: 0.5;
}
.topbar-crumb__current {
    color: var(--text);
    font-weight: 550;
}

.topbar-notif-btn {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    background: var(--panel) !important;
}
.topbar-menu {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 0.25rem !important;
}
.topbar-menu a,
.topbar-menu button {
    border-radius: var(--radius-sm) !important;
    font-size: 0.8125rem !important;
}

.sidebar-toggle {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    background: var(--panel) !important;
}

/* ——— Footer — compact ——— */
footer.app-footer {
    padding: 0.65rem 1rem !important;
    font-size: var(--fs-secondary) !important;
    background: var(--panel) !important;
    border-top: 1px solid var(--border) !important;
    min-height: var(--footer-h);
}
footer.app-footer .app-footer__card {
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}
footer.app-footer .app-footer__card:hover {
    border: none !important;
    box-shadow: none !important;
}

/* Hide bulky footer contact grids if present — keep legal strip */
footer.app-footer .guest-footer-grid,
footer.app-footer .app-footer__grid {
    display: none !important;
}

/* ——— Tables & pagination standardization (shadcn/ui style) ——— */
html:not(.is-guest-home) table.data,
html:not(.is-guest-home) table.table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: var(--fs-table, 13px) !important;
    width: 100% !important;
}
html:not(.is-guest-home) table.data th,
html:not(.is-guest-home) table.table th {
    background: var(--surface-muted) !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    padding: 0.5rem 0.75rem !important;
    border-bottom: 1px solid var(--border) !important;
    text-align: left !important;
    white-space: nowrap !important;
}
html:not(.is-guest-home) table.data td,
html:not(.is-guest-home) table.table td {
    padding: 0.5rem 0.75rem !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text) !important;
    vertical-align: middle !important;
}
html:not(.is-guest-home) table.data tbody tr:hover,
html:not(.is-guest-home) table.table tbody tr:hover {
    background: color-mix(in srgb, var(--surface-muted) 65%, var(--panel)) !important;
}

/* Pagination */
html:not(.is-guest-home) .pagination {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0.75rem 0 !important;
}
html:not(.is-guest-home) .pagination li a,
html:not(.is-guest-home) .pagination li span,
html:not(.is-guest-home) .page-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 2rem !important;
    min-height: 2rem !important;
    padding: 0 0.5rem !important;
    border-radius: var(--radius-sm, 6px) !important;
    border: 1px solid var(--border) !important;
    background: var(--panel) !important;
    color: var(--text) !important;
    font-size: 0.8125rem !important;
    font-weight: 550 !important;
    text-decoration: none !important;
    transition: background var(--ease), border-color var(--ease) !important;
}
html:not(.is-guest-home) .pagination li a:hover,
html:not(.is-guest-home) .page-link:hover {
    background: var(--surface-muted) !important;
    border-color: var(--border-strong) !important;
}
html:not(.is-guest-home) .pagination li.active span,
html:not(.is-guest-home) .pagination li.active .page-link,
html:not(.is-guest-home) .page-item.active .page-link {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #ffffff !important;
}
html:not(.is-guest-home) .pagination li.disabled span,
html:not(.is-guest-home) .page-item.disabled .page-link {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ——— Custom modals and dialog overlays standardization ——— */
html:not(.is-guest-home) .firm-evrak-modal-box,
html:not(.is-guest-home) .dialog-box,
html:not(.is-guest-home) .modal-box,
html:not(.is-guest-home) dialog {
    background: var(--panel) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg, 10px) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    color: var(--text) !important;
    font-family: var(--font) !important;
    max-height: calc(85vh - 2rem) !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}
html:not(.is-guest-home) dialog::backdrop {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* ——— SweetAlert2 unified shadcn/ui theme ——— */
.swal2-container {
    z-index: var(--osgb-z-dialog, 19100) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.swal2-container.swal-above-firm-menu {
    z-index: calc(var(--osgb-z-dialog, 19100) + 50) !important;
}
/* Modal dialogs get dark backdrop */
.swal2-container:not(.swal2-top-end):not(.swal2-top-right):not(.swal2-top):not(.swal2-top-start):not(.swal2-top-left):not(.swal2-bottom-end):not(.swal2-bottom-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-left) {
    background: rgba(15, 23, 42, 0.45) !important;
}
.swal2-container.swal2-backdrop-show:not(.swal2-top-end):not(.swal2-top-right):not(.swal2-top):not(.swal2-top-start):not(.swal2-top-left):not(.swal2-bottom-end):not(.swal2-bottom-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-left),
.swal2-container.swal2-noanimation:not(.swal2-top-end):not(.swal2-top-right):not(.swal2-top):not(.swal2-top-start):not(.swal2-top-left):not(.swal2-bottom-end):not(.swal2-bottom-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-left) {
    background: rgba(15, 23, 42, 0.45) !important;
}

/* Toast notifications MUST NEVER darken the screen or right side */
body.swal2-toast-shown .swal2-container,
.swal2-container.swal2-top-end,
.swal2-container.swal2-top-right,
.swal2-container.swal2-top,
.swal2-container.swal2-top-start,
.swal2-container.swal2-top-left,
.swal2-container.swal2-bottom-end,
.swal2-container.swal2-bottom-right,
.swal2-container.swal2-bottom,
.swal2-container.swal2-bottom-start,
.swal2-container.swal2-bottom-left,
.swal2-container:has(.swal2-toast),
.swal2-container.swal2-backdrop-show:has(.swal2-toast),
body.swal2-toast-shown .swal2-container.swal2-backdrop-show {
    background: transparent !important;
    background-color: transparent !important;
    pointer-events: none !important;
    box-shadow: none !important;
}
body.swal2-toast-shown .swal2-popup,
.swal2-container.swal2-top-end .swal2-popup,
.swal2-popup.swal2-toast {
    pointer-events: auto !important;
}

.swal2-popup {
    background: var(--panel, #ffffff) !important;
    border: 1px solid var(--border, #d5e3d9) !important;
    border-radius: var(--radius-lg, 10px) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    font-family: var(--font, 'Inter', system-ui, sans-serif) !important;
    color: var(--text, #1c2b22) !important;
    padding: 1.5rem !important;
    max-width: min(56rem, calc(100vw - 2rem)) !important;
    box-sizing: border-box !important;
    transform: translateZ(0);
    will-change: transform, opacity;
}
.swal2-show {
    animation: osgb-modal-in 0.12s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.swal2-hide {
    animation: osgb-modal-out 0.08s ease-in !important;
}
@keyframes osgb-modal-in {
    0% { opacity: 0; transform: scale(0.97); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes osgb-modal-out {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.97); }
}
.swal2-title {
    font-family: var(--font, 'Inter', system-ui, sans-serif) !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: var(--text, #1c2b22) !important;
    padding: 0 0 0.35rem 0 !important;
    line-height: 1.35 !important;
}
.swal2-html-container {
    font-family: var(--font, 'Inter', system-ui, sans-serif) !important;
    font-size: 0.875rem !important;
    color: var(--muted, #5d6f64) !important;
    line-height: 1.5 !important;
    margin: 0.35rem 0 0 0 !important;
}

/* Actions container: show only when not hidden, NEVER show on toast */
.swal2-actions:not([style*="display: none"]):not([style*="display:none"]) {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    margin: 1.25rem 0 0 0 !important;
    padding: 0 !important;
}
.swal2-actions[style*="display: none"],
.swal2-actions[style*="display:none"],
.swal2-popup.swal2-toast .swal2-actions,
body.swal2-toast-shown .swal2-actions {
    display: none !important;
}

/* Action buttons: show only when not hidden, NEVER show on toast */
.swal2-confirm:not([style*="display: none"]):not([style*="display:none"]),
.swal2-cancel:not([style*="display: none"]):not([style*="display:none"]),
.swal2-deny:not([style*="display: none"]):not([style*="display:none"]) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 2.25rem !important;
    padding: 0.45rem 1rem !important;
    border-radius: var(--radius-sm, 6px) !important;
    font-family: var(--font, 'Inter', system-ui, sans-serif) !important;
    font-size: 0.8125rem !important;
    font-weight: 550 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: background var(--ease), border-color var(--ease), color var(--ease) !important;
    border: 1px solid transparent !important;
    margin: 0 !important;
}
.swal2-confirm[style*="display: none"],
.swal2-confirm[style*="display:none"],
.swal2-cancel[style*="display: none"],
.swal2-cancel[style*="display:none"],
.swal2-deny[style*="display: none"],
.swal2-deny[style*="display:none"],
.swal2-popup.swal2-toast .swal2-confirm,
.swal2-popup.swal2-toast .swal2-cancel,
.swal2-popup.swal2-toast .swal2-deny,
body.swal2-toast-shown .swal2-confirm,
body.swal2-toast-shown .swal2-cancel,
body.swal2-toast-shown .swal2-deny {
    display: none !important;
}

/* Dedicated SweetAlert2 Toast styling: clean notification message without buttons */
.swal2-popup.swal2-toast {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    width: auto !important;
    max-width: min(24rem, calc(100vw - 2rem)) !important;
    padding: 0.85rem 1.15rem !important;
    border-radius: var(--radius-md, 8px) !important;
    background: var(--panel, #ffffff) !important;
    border: 1px solid var(--border, #d5e3d9) !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 4px 6px -4px rgba(15, 23, 42, 0.08) !important;
    overflow: hidden !important;
}
.swal2-popup.swal2-toast .swal2-title {
    font-size: 0.875rem !important;
    font-weight: 650 !important;
    color: var(--text, #1c2b22) !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.35 !important;
    text-align: left !important;
}
.swal2-popup.swal2-toast .swal2-html-container {
    font-size: 0.8125rem !important;
    color: var(--muted, #5d6f64) !important;
    margin: 0.2rem 0 0 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
    text-align: left !important;
}
.swal2-popup.swal2-toast .swal2-icon {
    margin: 0 0.5rem 0 0 !important;
    transform: scale(0.7) !important;
    transform-origin: left center !important;
}
.swal2-popup.swal2-toast .swal2-timer-progress-bar {
    background: var(--accent, #2f7a4c) !important;
    height: 3px !important;
}
/* Standard confirm button: sage green */
.swal2-confirm:not([style*="dc2626"]):not([style*="b91c1c"]):not([style*="EF4444"]):not([style*="ef4444"]):not([style*="c45454"]) {
    background-color: var(--accent, #2f7a4c) !important;
    border-color: var(--accent, #2f7a4c) !important;
    color: #ffffff !important;
}
.swal2-confirm:not([style*="dc2626"]):not([style*="b91c1c"]):not([style*="EF4444"]):not([style*="ef4444"]):not([style*="c45454"]):hover {
    background-color: var(--accent-2, #276843) !important;
    border-color: var(--accent-2, #276843) !important;
    color: #ffffff !important;
}
/* Danger confirm button */
.swal2-confirm[style*="dc2626"],
.swal2-confirm[style*="b91c1c"],
.swal2-confirm[style*="EF4444"],
.swal2-confirm[style*="ef4444"],
.swal2-confirm[style*="c45454"],
.swal2-popup.swal2-danger-confirm .swal2-confirm {
    background-color: var(--danger, #dc2626) !important;
    border-color: var(--danger, #dc2626) !important;
    color: #ffffff !important;
}
.swal2-confirm[style*="dc2626"]:hover,
.swal2-confirm[style*="b91c1c"]:hover,
.swal2-confirm[style*="EF4444"]:hover,
.swal2-confirm[style*="ef4444"]:hover,
.swal2-confirm[style*="c45454"]:hover,
.swal2-popup.swal2-danger-confirm .swal2-confirm:hover {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}
/* Cancel button */
.swal2-cancel {
    background-color: var(--panel, #ffffff) !important;
    border-color: var(--border, #d5e3d9) !important;
    color: var(--text, #1c2b22) !important;
}
.swal2-cancel:hover {
    background-color: var(--surface-muted, #eef5f0) !important;
    border-color: var(--border-strong, #c3d5c9) !important;
    color: var(--text, #1c2b22) !important;
}
/* Close button */
.swal2-close {
    font-family: inherit !important;
    color: var(--muted) !important;
    font-size: 1.35rem !important;
    line-height: 1 !important;
    transition: color var(--ease) !important;
}
.swal2-close:hover {
    color: var(--text) !important;
}
/* Scaled icons */
.swal2-icon {
    width: 2.75rem !important;
    height: 2.75rem !important;
    margin: 0 auto 0.75rem !important;
    border-width: 2.5px !important;
}
.swal2-icon .swal2-icon-content {
    font-size: 1.75rem !important;
    line-height: 2.75rem !important;
}
.swal2-icon.swal2-warning {
    border-color: var(--warning, #c4843a) !important;
    color: var(--warning, #c4843a) !important;
}
.swal2-icon.swal2-error {
    border-color: var(--danger, #dc2626) !important;
    color: var(--danger, #dc2626) !important;
}
.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: var(--danger, #dc2626) !important;
}
.swal2-icon.swal2-success {
    border-color: var(--accent, #2f7a4c) !important;
    color: var(--accent, #2f7a4c) !important;
}
.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: var(--accent, #2f7a4c) !important;
}
.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(47, 122, 76, 0.3) !important;
}
.swal2-icon.swal2-info,
.swal2-icon.swal2-question {
    border-color: var(--info, #5d8f86) !important;
    color: var(--info, #5d8f86) !important;
}
/* Inputs inside Swal */
.swal2-input,
.swal2-select,
.swal2-textarea {
    border: 1px solid var(--border-strong, #c3d5c9) !important;
    border-radius: var(--radius-sm, 6px) !important;
    background: var(--panel) !important;
    color: var(--text) !important;
    font-family: var(--font) !important;
    font-size: 0.875rem !important;
    padding: 0.45rem 0.75rem !important;
    box-shadow: none !important;
    margin: 0.75rem auto 0 !important;
}
.swal2-input:focus,
.swal2-select:focus,
.swal2-textarea:focus {
    outline: 2px solid var(--accent, #2f7a4c) !important;
    outline-offset: 1px !important;
    border-color: var(--accent, #2f7a4c) !important;
    box-shadow: none !important;
}
.swal2-validation-message {
    background: var(--surface-muted) !important;
    color: var(--danger, #dc2626) !important;
    font-size: 0.8125rem !important;
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
    border-radius: var(--radius-sm, 6px) !important;
    margin-top: 0.5rem !important;
}
/* SweetAlert Toast standardization */
.swal2-container.swal2-top-end,
.swal2-container.swal2-top-right {
    z-index: var(--osgb-z-toast, 18500) !important;
}
.swal2-popup.swal2-toast {
    background: var(--panel, #ffffff) !important;
    border: 1px solid var(--border, #d5e3d9) !important;
    border-radius: var(--radius-md, 8px) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
    color: var(--text, #1c2b22) !important;
    font-family: var(--font) !important;
    padding: 0.65rem 0.85rem !important;
}
.swal2-popup.swal2-toast .swal2-title {
    font-size: 0.8125rem !important;
    font-weight: 550 !important;
    color: var(--text) !important;
    padding: 0 !important;
}
.swal2-timer-progress-bar {
    background: var(--accent, #2f7a4c) !important;
}
/* Dark theme for Swal */
[data-theme="dark"] .swal2-popup {
    background: var(--panel, #1a2420) !important;
    border-color: var(--border, #2c3d34) !important;
    color: var(--text, #eef6f0) !important;
}
[data-theme="dark"] .swal2-title {
    color: var(--text, #eef6f0) !important;
}
[data-theme="dark"] .swal2-html-container {
    color: var(--muted, #a3b8aa) !important;
}
[data-theme="dark"] .swal2-cancel {
    background-color: var(--panel, #1a2420) !important;
    border-color: var(--border, #2c3d34) !important;
    color: var(--text, #eef6f0) !important;
}
[data-theme="dark"] .swal2-cancel:hover {
    background-color: var(--surface-muted, #22302a) !important;
}

/* Focus accessibility */
:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
}

@media (max-width: 1024px) {
    :root {
        --topbar-h: 52px;
        --main-pad-x: 0.75rem;
        --main-pad-y: 0.75rem;
    }
    .topbar-brand {
        display: flex !important;
    }
    .topbar-crumb {
        display: none;
    }
}
