/* ====== DCS  Debt Collection System Stylesheet ====== */

:root {
    --bg: #f0f2f5;
    --sidebar-bg: #ffffff;
    --sidebar-bg-soft: #f8fafc;
    --sidebar-hover: #f0fdfa;
    --sidebar-active: #0f766e;
    --sidebar-border: #e6ebf2;
    --sidebar-ink: #334155;
    --sidebar-ink-muted: #94a3b8;
    --sidebar-ink-soft: #64748b;
    --card: #ffffff;
    --ink: #1a1d26;
    --ink-secondary: #5f6577;
    --ink-muted: #8b90a0;
    --border: #e2e5ec;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --brand-light: #14b8a6;
    --brand-soft: #ccfbf1;
    --brand-bg: #f0fdfa;
    --red: #ef4444;
    --red-soft: #fef2f2;
    --orange: #f59e0b;
    --orange-soft: #fffbeb;
    --blue: #3b82f6;
    --blue-soft: #eff6ff;
    --green: #22c55e;
    --green-soft: #f0fdf4;
    --purple: #8b5cf6;
    --purple-soft: #f5f3ff;
    --teal-soft: #ccfbf1;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --topbar-h: 60px;
    --sidebar-w: 260px;
    --transition: 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', 'Inter', -apple-system, 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

body[dir="rtl"] {
    direction: rtl;
}

body[dir="ltr"] {
    direction: ltr;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: transparent;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: 14px;
}


/* ====== LAYOUT ====== */

.app {
    display: flex;
    min-height: 100vh;
}


/* ====== SIDEBAR (Ivory + Teal theme) ====== */

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-soft) 100%);
    color: var(--sidebar-ink);
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 0 0 1px var(--sidebar-border), 0 10px 30px rgba(15, 23, 42, 0.04);
}

body[dir="rtl"] .sidebar {
    right: 0;
    border-left: 1px solid var(--sidebar-border);
}

body[dir="ltr"] .sidebar {
    left: 0;
    border-right: 1px solid var(--sidebar-border);
}


/* decorative radial glow in the top of the sidebar */

.sidebar-glow {
    position: absolute;
    top: -80px;
    inset-inline-end: -60px;
    width: 240px;
    height: 240px;
    background: radial-gradient(closest-side, rgba(20, 184, 166, 0.18), rgba(20, 184, 166, 0) 70%);
    filter: blur(4px);
    pointer-events: none;
    z-index: 0;
}

.sidebar-logo {
    position: relative;
    z-index: 1;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo .logo-icon {
    position: relative;
    overflow: hidden;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.sidebar-logo .logo-icon-shine {
    position: absolute;
    top: -50%;
    inset-inline-start: -50%;
    width: 160%;
    height: 160%;
    background: linear-gradient(120deg, transparent 45%, rgba(255, 255, 255, 0.35) 50%, transparent 55%);
    transform: rotate(8deg);
    pointer-events: none;
}

.sidebar-logo .logo-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-logo .logo-text {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: 0.2px;
}

.sidebar-logo .logo-sub {
    font-size: 11px;
    color: var(--sidebar-ink-muted);
    font-weight: 500;
    margin-top: 2px;
}

.sidebar-nav {
    position: relative;
    z-index: 1;
    flex: 1;
    overflow-y: auto;
    padding: 14px 10px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #d9dfe8;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #c5ccd9;
}

.nav-section {
    margin-bottom: 10px;
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--sidebar-ink-muted);
    padding: 10px 14px 6px;
    font-weight: 700;
}

.nav-section-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
    flex-shrink: 0;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    margin: 2px 0;
    border-radius: 10px;
    color: var(--sidebar-ink-soft);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), transform var(--transition);
    text-decoration: none;
}

.nav-item .nav-indicator {
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0.2);
    width: 3px;
    height: 22px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--brand-light), var(--brand));
    opacity: 0;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--brand-dark);
    text-decoration: none;
}

.nav-item:hover .nav-icon {
    color: var(--brand);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-item.active .nav-icon {
    color: #fff;
}

.nav-item.active .nav-indicator {
    opacity: 1;
    transform: translateY(-50%) scaleY(1);
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-ink-muted);
    flex-shrink: 0;
    transition: color var(--transition);
}

.nav-item .nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-item .nav-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item .nav-badge {
    margin-inline-start: auto;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.nav-item.active .nav-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    box-shadow: none;
    backdrop-filter: blur(4px);
}

.sidebar-user-wrap {
    position: relative;
    z-index: 1;
    padding: 10px 12px 14px;
    border-top: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    border: 1px solid var(--sidebar-border);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.sidebar-user-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.25);
}

.sidebar-user-status {
    position: absolute;
    bottom: -2px;
    inset-inline-end: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
    border: 2px solid #ffffff;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 10.5px;
    color: var(--sidebar-ink-muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.sidebar-user-logout-form {
    margin: 0;
    padding: 0;
    display: flex;
    flex-shrink: 0;
}

.sidebar-user-logout {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--sidebar-ink-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-user-logout:hover {
    background: var(--red-soft);
    color: var(--red);
}

.sidebar-user-logout svg {
    width: 16px;
    height: 16px;
}

.sidebar-footer {
    padding: 10px 16px 12px;
    border-top: 1px solid var(--sidebar-border);
    font-size: 11px;
    color: var(--sidebar-ink-muted);
    text-align: center;
    line-height: 1.6;
}

.sidebar-footer a {
    color: var(--sidebar-ink-soft);
}

.sidebar-footer a:hover {
    color: var(--brand);
}


/* ====== MAIN ====== */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body[dir="rtl"] .main {
    margin-right: var(--sidebar-w);
}

body[dir="ltr"] .main {
    margin-left: var(--sidebar-w);
}


/* ====== TOPBAR ====== */

.topbar {
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.topbar-search input {
    width: 100%;
    padding: 8px 14px;
    padding-inline-start: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--ink);
    outline: none;
    transition: var(--transition);
}

.topbar-search input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.topbar-search .search-icon {
    position: absolute;
    inset-inline-start: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-muted);
    font-size: 14px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto;
}

.topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--ink-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: var(--transition);
    position: relative;
}

.topbar-btn:hover {
    background: var(--bg);
    color: var(--ink);
}

.topbar-btn .notif-dot {
    position: absolute;
    top: 6px;
    inset-inline-end: 8px;
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%;
    border: 2px solid var(--card);
}

.topbar-user {
    position: relative;
}

.topbar-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
}

.topbar-user-trigger:hover {
    background: var(--bg);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.user-info {
    line-height: 1.3;
    text-align: start;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
}

.user-role {
    font-size: 11px;
    color: var(--ink-muted);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 6px 0;
    z-index: 100;
    display: none;
}

.dropdown.open>.dropdown-menu {
    display: block;
}

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 16px;
    color: var(--ink);
    font-size: 13px;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--bg);
    text-decoration: none;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.btn-create {
    padding: 8px 18px;
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    text-decoration: none;
}

.btn-create:hover {
    background: var(--sidebar-active);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    color: #fff;
    text-decoration: none;
}


/* ====== CONTENT ====== */

.content {
    flex: 1;
    padding: 24px;
}

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

.page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.3;
}

.page-subtitle {
    font-size: 13px;
    color: var(--ink-muted);
    margin-top: 2px;
}

.page-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.page-actions>* {
    flex: 0 0 auto;
}


/* ====== STAT CARDS ====== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    margin-bottom: 12px;
}

.stat-card .stat-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 12.5px;
    color: var(--ink-muted);
    font-weight: 500;
}

.stat-card .stat-change {
    font-size: 11.5px;
    font-weight: 700;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card .stat-change.up {
    color: var(--green);
}

.stat-card .stat-change.down {
    color: var(--red);
}


/* ====== CARDS ====== */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
}

.card-body {
    padding: 0;
}

.card-body.padded {
    padding: 20px;
}


/* Debtors  CSV import panel */

.card-import-panel {
    margin-bottom: 20px;
    border-color: color-mix(in srgb, var(--brand) 22%, var(--border));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 8%, transparent), var(--shadow-sm);
    background: linear-gradient( 165deg, color-mix(in srgb, var(--brand) 7%, var(--card)) 0%, var(--card) 42%);
}

.card-import-panel__head {
    align-items: flex-start;
    background: color-mix(in srgb, var(--brand) 4%, transparent);
    border-bottom-color: color-mix(in srgb, var(--brand) 14%, var(--border));
}

.card-import-panel__titles {
    min-width: 0;
    flex: 1;
}

.card-import-panel__hint {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--ink-muted);
    max-width: 52rem;
}

.card-import-panel__close {
    flex-shrink: 0;
}

.import-panel-form {
    margin: 0;
}

.import-panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px 20px;
    align-items: end;
}

@media (max-width: 720px) {
    .import-panel-grid {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .import-panel-actions {
        justify-content: stretch;
    }
    .import-panel-actions .btn {
        width: 100%;
        text-align: center;
    }
}

.import-panel-file .form-label {
    margin-bottom: 6px;
}

.import-panel-file-input {
    padding: 10px 12px;
    cursor: pointer;
    max-width: 100%;
    width: 100%;
}

.import-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.import-panel-errors {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.import-panel-errors__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--red);
    margin-bottom: 12px;
}

.import-panel-errors__scroll {
    overflow-x: auto;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: #fff;
}

.import-panel-errors__table {
    margin: 0 !important;
    width: 100% !important;
}

.import-panel-errors__table th,
.import-panel-errors__table td {
    white-space: normal;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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


/* ====== FILTERS ====== */

.filters-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select,
.filter-input {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: #fff;
    color: var(--ink);
    font-size: 12.5px;
    outline: none;
    cursor: pointer;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--brand);
}


/* ====== TABLES ====== */

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

.data-table th,
.data-table td {
    padding: 11px 16px;
    text-align: start;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table th {
    background: #f8f9fb;
    color: var(--ink-muted);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* Arabic / RTL: keep header labels readable (uppercase distorts Arabic) */

body[dir="rtl"] .data-table th {
    text-transform: none;
    letter-spacing: normal;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #fafbfc;
}

.cell-main {
    font-weight: 600;
    color: var(--ink);
}

.cell-sub {
    font-size: 11.5px;
    color: var(--ink-muted);
    margin-top: 1px;
}


/* ====== DataTables  Custom DCS theme ====== */


/* Wrapper + toolbar */

div.dataTables_wrapper {
    padding: 4px 0 10px;
    font-size: 13px;
    color: var(--ink);
}

div.dataTables_wrapper .dataTables_length,
div.dataTables_wrapper .dataTables_filter,
div.dataTables_wrapper .dataTables_info,
div.dataTables_wrapper .dataTables_paginate {
    padding: 14px 20px;
    color: var(--ink-secondary);
    font-size: 12.5px;
    font-weight: 500;
}

div.dataTables_wrapper .dataTables_length {
    float: none;
    display: inline-block;
}

div.dataTables_wrapper .dataTables_filter {
    float: none;
    display: inline-block;
}

body[dir="rtl"] div.dataTables_wrapper .dataTables_length {
    float: right;
}

body[dir="rtl"] div.dataTables_wrapper .dataTables_filter {
    float: left;
}

body[dir="ltr"] div.dataTables_wrapper .dataTables_length {
    float: left;
}

body[dir="ltr"] div.dataTables_wrapper .dataTables_filter {
    float: right;
}


/* Length dropdown + search input */

div.dataTables_wrapper .dataTables_length select,
div.dataTables_wrapper .dataTables_filter input {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: #fff;
    color: var(--ink);
    font-size: 12.5px;
    outline: none;
    transition: var(--transition);
    margin: 0 6px;
    min-height: 34px;
}

div.dataTables_wrapper .dataTables_length select {
    padding-inline-end: 28px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%238b90a0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-position: right 10px center;
    background-size: 10px 7px;
    background-repeat: no-repeat;
}

body[dir="rtl"] div.dataTables_wrapper .dataTables_length select {
    background-position: left 10px center;
    padding-inline-end: 28px;
    padding-inline-start: 28px;
}

div.dataTables_wrapper .dataTables_filter input {
    min-width: 220px;
}

div.dataTables_wrapper .dataTables_length select:focus,
div.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}


/* Info text */

div.dataTables_wrapper .dataTables_info {
    padding-top: 16px;
    color: var(--ink-muted);
    font-size: 12.5px;
    font-weight: 500;
}


/* Bottom row layout */

div.dataTables_wrapper .dataTables_info {
    float: none;
    display: inline-block;
}

div.dataTables_wrapper .dataTables_paginate {
    float: none;
    display: inline-block;
}

body[dir="rtl"] div.dataTables_wrapper .dataTables_info {
    float: right;
}

body[dir="rtl"] div.dataTables_wrapper .dataTables_paginate {
    float: left;
}

body[dir="ltr"] div.dataTables_wrapper .dataTables_info {
    float: left;
}

body[dir="ltr"] div.dataTables_wrapper .dataTables_paginate {
    float: right;
}


/* Clear floats */

div.dataTables_wrapper::after {
    content: "";
    display: table;
    clear: both;
}


/* Pagination buttons */

div.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px !important;
    margin: 0 2px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-xs) !important;
    background: #fff !important;
    color: var(--ink-secondary) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: var(--transition);
    min-width: 34px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

div.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--brand-bg) !important;
    border-color: var(--brand) !important;
    color: var(--brand) !important;
    box-shadow: none !important;
}

div.dataTables_wrapper .dataTables_paginate .paginate_button.current,
div.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(15, 118, 110, 0.25);
}

div.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
div.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background: #fff !important;
    border-color: var(--border) !important;
    color: #c9ced9 !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

div.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
div.dataTables_wrapper .dataTables_paginate .paginate_button.next,
div.dataTables_wrapper .dataTables_paginate .paginate_button.first,
div.dataTables_wrapper .dataTables_paginate .paginate_button.last {
    font-weight: 700;
}

div.dataTables_wrapper .dataTables_paginate .ellipsis {
    padding: 6px 4px;
    color: var(--ink-muted);
}


/* DataTable within a .card  tighten spacing */

.card .dataTables_wrapper {
    padding: 0;
}

.card .dataTables_wrapper .dataTables_length,
.card .dataTables_wrapper .dataTables_filter {
    padding: 14px 20px 10px;
}

.card .dataTables_wrapper .dataTables_info,
.card .dataTables_wrapper .dataTables_paginate {
    padding: 12px 20px 14px;
    border-top: 1px solid var(--border);
    background: #fbfcfe;
}

.card .dataTables_wrapper .dataTables_info {
    border-top: 1px solid var(--border);
}


/* Make the table inside the wrapper fit the card (no double borders) */

.card table.data-table.dataTable {
    border-collapse: collapse !important;
    margin: 0 !important;
    width: 100% !important;
}

.card .dataTables_wrapper table.dataTable thead th {
    border-bottom: 1px solid var(--border);
}


/* jquery.dataTables.min.css forces text-align:left on thead/tfoot  breaks RTL */

body[dir="rtl"] table.dataTable thead th,
body[dir="rtl"] table.dataTable thead td,
body[dir="rtl"] table.dataTable tfoot th,
body[dir="rtl"] table.dataTable tfoot td {
    text-align: start;
}

body[dir="rtl"] table.dataTable tbody th,
body[dir="rtl"] table.dataTable tbody td {
    text-align: start;
}


/* Remove DataTables default ugly sort arrows; replace with cleaner ones */

table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
table.dataTable thead .sorting_asc_disabled,
table.dataTable thead .sorting_desc_disabled {
    cursor: pointer;
    position: relative;
    background-image: none !important;
    padding-inline-end: 26px !important;
}

table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_desc::after {
    position: absolute;
    top: 50%;
    inset-inline-end: 10px;
    font-size: 10px;
    color: #c9ced9;
    line-height: 1;
    transform: translateY(-50%);
    opacity: 1;
}

table.dataTable thead .sorting::before {
    content: "?";
    margin-top: -7px;
}

table.dataTable thead .sorting::after {
    content: "?";
    margin-top: 2px;
}

table.dataTable thead .sorting_asc::before {
    content: "?";
    margin-top: -7px;
    color: var(--brand);
}

table.dataTable thead .sorting_asc::after {
    content: "?";
    margin-top: 2px;
    color: #c9ced9;
}

table.dataTable thead .sorting_desc::before {
    content: "?";
    margin-top: -7px;
    color: #c9ced9;
}

table.dataTable thead .sorting_desc::after {
    content: "?";
    margin-top: 2px;
    color: var(--brand);
}


/* Remove DataTables' own row striping (our .data-table handles hover) */

table.dataTable.no-footer {
    border-bottom: none !important;
}

table.dataTable tbody tr {
    background: transparent;
}

table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd {
    background-color: #fbfcfe;
}

table.dataTable.hover tbody tr:hover,
table.dataTable.display tbody tr:hover {
    background-color: #f5f7fb;
}


/* Mobile  stack filter/length above table */

@media (max-width: 640px) {
    div.dataTables_wrapper .dataTables_length,
    div.dataTables_wrapper .dataTables_filter,
    div.dataTables_wrapper .dataTables_info,
    div.dataTables_wrapper .dataTables_paginate {
        float: none !important;
        display: block;
        text-align: center;
        padding: 8px 16px;
    }
    div.dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin: 6px 0 0;
    }
    div.dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 5px 10px !important;
        margin: 2px !important;
    }
}


/* ====== DCS Pagination (Laravel server-side) ====== */

.dcs-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 4px;
}

.dcs-pagination__info {
    font-size: 12.5px;
    color: var(--ink-muted);
    font-weight: 500;
}

.dcs-pagination__info b {
    color: var(--ink);
    font-weight: 700;
}

.dcs-pagination__list {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.dcs-page>a,
.dcs-page>span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: #fff;
    color: var(--ink-secondary);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    line-height: 1;
}

.dcs-page>a:hover {
    background: var(--brand-bg);
    border-color: var(--brand);
    color: var(--brand);
    text-decoration: none;
    box-shadow: none;
}

.dcs-page.active>span {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 2px 6px rgba(15, 118, 110, 0.25);
    cursor: default;
}

.dcs-page.disabled>span {
    background: #fff;
    border-color: var(--border);
    color: #c9ced9;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 640px) {
    .dcs-pagination {
        justify-content: center;
    }
    .dcs-pagination__info {
        width: 100%;
        text-align: center;
    }
}


/* When pagination sits inside a .card .card-body */

.card .card-body>.dcs-pagination {
    padding: 12px 16px;
}


/* ====== BADGES ====== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-green {
    background: var(--green-soft);
    color: #15803d;
}

.badge-red {
    background: var(--red-soft);
    color: #dc2626;
}

.badge-orange {
    background: var(--orange-soft);
    color: #b45309;
}

.badge-blue {
    background: var(--blue-soft);
    color: #2563eb;
}

.badge-purple {
    background: var(--purple-soft);
    color: #7c3aed;
}

.badge-gray {
    background: #f1f3f5;
    color: #64748b;
}

.badge-teal {
    background: var(--brand-soft);
    color: var(--brand);
}

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-inline-end: 6px;
}

.priority-dot.critical {
    background: var(--red);
}

.priority-dot.high {
    background: var(--orange);
}

.priority-dot.normal {
    background: var(--blue);
}

.priority-dot.low {
    background: #94a3b8;
}


/* ====== BUTTONS ====== */

.btn {
    padding: 7px 16px;
    border-radius: var(--radius-xs);
    font-size: 12.5px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}

.btn:hover {
    background: #f8f9fb;
    text-decoration: none;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.btn-primary:hover {
    background: var(--brand-dark);
    color: #fff;
}

.btn-danger {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.btn-danger:hover {
    background: #dc2626;
    color: #fff;
}

.btn-ghost {
    border: none;
    background: none;
    color: var(--ink-muted);
}

.btn-ghost:hover {
    color: var(--ink);
    background: var(--bg);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink-secondary);
    font-size: 14px;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg);
    color: var(--ink);
}


/* ====== FORMS ====== */

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

.form-grid:has(input[type="checkbox"]) {
    align-items: center;
}

@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="search"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"],
.form-group input[type="month"],
.form-group input[type="week"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: #fff;
    outline: none;
    font-size: 13.5px;
    color: var(--ink);
    transition: var(--transition);
    font-family: inherit;
    line-height: 1.4;
    min-height: 38px;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="time"]::-webkit-calendar-picker-indicator,
.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.form-group input[type="month"]::-webkit-calendar-picker-indicator,
.form-group input[type="week"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.55;
    padding: 2px;
    border-radius: 4px;
    transition: var(--transition);
    filter: invert(22%) sepia(12%) saturate(780%) hue-rotate(180deg);
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover,
.form-group input[type="time"]::-webkit-calendar-picker-indicator:hover,
.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
.form-group input[type="month"]::-webkit-calendar-picker-indicator:hover,
.form-group input[type="week"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background: var(--brand-bg);
}

body[dir="rtl"] .form-group input[type="date"],
body[dir="rtl"] .form-group input[type="time"],
body[dir="rtl"] .form-group input[type="datetime-local"],
body[dir="rtl"] .form-group input[type="month"],
body[dir="rtl"] .form-group input[type="week"] {
    direction: ltr;
    text-align: right;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.form-group textarea {
    min-height: 90px;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
}


/* ====== VALIDATION (Bootstrap-like: triggered by .was-validated on the form) ====== */

.was-validated input:invalid,
.was-validated select:invalid,
.was-validated textarea:invalid,
.was-validated .form-group input:invalid,
.was-validated .form-group select:invalid,
.was-validated .form-group textarea:invalid,
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--red) !important;
    background-color: var(--red-soft);
    padding-inline-end: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 14px 14px;
}

body[dir="rtl"] .was-validated input:invalid,
body[dir="rtl"] .was-validated select:invalid,
body[dir="rtl"] .was-validated textarea:invalid,
body[dir="rtl"] .was-validated .form-group input:invalid,
body[dir="rtl"] .was-validated .form-group select:invalid,
body[dir="rtl"] .was-validated .form-group textarea:invalid,
body[dir="rtl"] input.is-invalid,
body[dir="rtl"] select.is-invalid,
body[dir="rtl"] textarea.is-invalid {
    background-position: right 10px center;
}

.was-validated input:invalid:focus,
.was-validated select:invalid:focus,
.was-validated textarea:invalid:focus,
input.is-invalid:focus,
select.is-invalid:focus,
textarea.is-invalid:focus {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.was-validated input:valid,
.was-validated select:valid,
.was-validated textarea:valid,
.was-validated .form-group input:valid,
.was-validated .form-group select:valid,
.was-validated .form-group textarea:valid,
input.is-valid,
select.is-valid,
textarea.is-valid {
    border-color: var(--green) !important;
    background-color: var(--green-soft);
    padding-inline-end: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' width='8' height='8' fill='none' stroke='%2322c55e' stroke-width='1.5'%3E%3Cpath d='M2.3 4.2l1.4 1.4 2.4-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 14px 14px;
}

body[dir="rtl"] .was-validated input:valid,
body[dir="rtl"] .was-validated select:valid,
body[dir="rtl"] .was-validated textarea:valid,
body[dir="rtl"] .was-validated .form-group input:valid,
body[dir="rtl"] .was-validated .form-group select:valid,
body[dir="rtl"] .was-validated .form-group textarea:valid,
body[dir="rtl"] input.is-valid,
body[dir="rtl"] select.is-valid,
body[dir="rtl"] textarea.is-valid {
    background-position: right 10px center;
}

.was-validated input:valid:focus,
.was-validated select:valid:focus,
.was-validated textarea:valid:focus,
input.is-valid:focus,
select.is-valid:focus,
textarea.is-valid:focus {
    border-color: var(--green) !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15) !important;
}


/* Skip icon for special inputs that have their own ornaments */

.was-validated input[type="checkbox"]:invalid,
.was-validated input[type="checkbox"]:valid,
.was-validated input[type="radio"]:invalid,
.was-validated input[type="radio"]:valid,
.was-validated input[type="file"]:invalid,
.was-validated input[type="file"]:valid,
.was-validated input[type="color"]:invalid,
.was-validated input[type="color"]:valid {
    background-image: none;
    padding-inline-end: inherit;
}

.was-validated input[type="checkbox"]:invalid,
.was-validated input[type="radio"]:invalid {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}


/* Select2 single-selection: color its rendered box based on the hidden <select> state */

.was-validated select:invalid+.select2-container .select2-selection,
select.is-invalid+.select2-container .select2-selection {
    border-color: var(--red) !important;
    background-color: var(--red-soft);
}

.was-validated select:valid+.select2-container .select2-selection,
select.is-valid+.select2-container .select2-selection {
    border-color: var(--green) !important;
    background-color: var(--green-soft);
}


/* ====== AGING BARS ====== */

.aging-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aging-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aging-label {
    width: 90px;
    font-size: 12px;
    color: var(--ink-muted);
    font-weight: 600;
    flex-shrink: 0;
}

.aging-track {
    flex: 1;
    height: 28px;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.aging-fill {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 6px 0 0 6px;
}

body[dir="rtl"] .aging-fill {
    border-radius: 0 6px 6px 0;
}

.aging-amount {
    font-size: 12.5px;
    font-weight: 700;
    min-width: 100px;
    text-align: end;
}


/* ====== STAGE BARS ====== */

.stage-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.stage-bar-wrap {
    flex: 1;
    height: 24px;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
}

.stage-bar-fill {
    height: 100%;
    border-radius: 6px;
}

.stage-count {
    font-weight: 700;
    font-size: 13px;
    min-width: 36px;
    text-align: end;
}


/* ====== ALERTS ====== */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 600;
}

.alert-success {
    background: var(--green-soft);
    color: #15803d;
    border-color: #86efac;
}

.alert-danger {
    background: var(--red-soft);
    color: #b91c1c;
    border-color: #fca5a5;
}

.alert-info {
    background: var(--blue-soft);
    color: #1d4ed8;
    border-color: #93c5fd;
}


/* ====== LOGIN (v2  glass card on animated mesh) ====== */

.auth-body {
    min-height: 100vh;
    background: #f4f7fb;
    color: #1a1d26;
    overflow-x: hidden;
}

.auth-stage {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: 26px clamp(18px, 4vw, 56px);
    z-index: 1;
}


/* ---- Animated background ---- */

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(1100px 700px at 85% -10%, rgba(20, 184, 166, 0.18), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgba(99, 102, 241, 0.14), transparent 60%), linear-gradient(160deg, #f7fafd 0%, #eef4fa 50%, #f0fbf9 100%);
}

.auth-bg .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    will-change: transform;
    mix-blend-mode: multiply;
}

.auth-bg .orb-1 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, #5eead4 0%, transparent 65%);
    top: -140px;
    inset-inline-start: -120px;
    animation: orbFloat 18s ease-in-out infinite;
    opacity: 0.5;
}

.auth-bg .orb-2 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, #7dd3fc 0%, transparent 65%);
    bottom: -140px;
    inset-inline-end: -100px;
    animation: orbFloat 22s ease-in-out infinite reverse;
    opacity: 0.5;
}

.auth-bg .orb-3 {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, #c7d2fe 0%, transparent 65%);
    top: 45%;
    inset-inline-start: 55%;
    animation: orbFloat 26s ease-in-out infinite;
    opacity: 0.4;
}

.auth-bg .orb-4 {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, #fde68a 0%, transparent 65%);
    top: 10%;
    inset-inline-end: 30%;
    animation: orbFloat 30s ease-in-out infinite reverse;
    opacity: 0.4;
}

.auth-bg .grid-overlay {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(15, 118, 110, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 118, 110, 0.07) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 75% 55% at 50% 40%, #000 35%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 40%, #000 35%, transparent 100%);
}

.auth-bg .noise-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, transparent 0, rgba(15, 23, 42, 0.05) 100%);
    pointer-events: none;
}

@keyframes orbFloat {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(40px, -30px, 0) scale(1.08);
    }
}


/* ---- Top bar ---- */

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-logo-mark {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 30px rgba(20, 184, 166, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    overflow: hidden;
}

.auth-logo-mark .auth-logo-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
    transform: translateX(-120%);
    animation: logoShine 4.5s ease-in-out infinite;
}

@keyframes logoShine {
    0%,
    60% {
        transform: translateX(-120%);
    }
    80%,
    100% {
        transform: translateX(120%);
    }
}

.auth-logo-text strong {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.2px;
}

.auth-logo-text small {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.auth-lang {
    display: inline-flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 4px;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.auth-lang-pill {
    padding: 6px 14px;
    border-radius: 999px;
    color: #64748b;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.auth-lang-pill:hover {
    color: var(--brand);
    text-decoration: none;
}

.auth-lang-pill.is-active {
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    color: #fff;
    box-shadow: 0 6px 18px rgba(20, 184, 166, 0.35);
}


/* ---- Main area ---- */

.auth-main {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 30px 0;
}


/* ---- Glass card ---- */

.auth-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    padding: 36px clamp(22px, 4vw, 40px) 28px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.78) 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.12), 0 8px 24px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    overflow: hidden;
    isolation: isolate;
    animation: cardRise 0.6s ease-out both;
}

@keyframes cardRise {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card-glow {
    position: absolute;
    inset: -2px;
    z-index: -1;
    background: conic-gradient( from 180deg, transparent 0deg, rgba(20, 184, 166, 0.5) 90deg, transparent 180deg, rgba(99, 102, 241, 0.45) 270deg, transparent 360deg);
    filter: blur(26px);
    opacity: 0.55;
    animation: glowSpin 14s linear infinite;
    border-radius: 26px;
}

@keyframes glowSpin {
    to {
        transform: rotate(360deg);
    }
}

.auth-card-head {
    text-align: center;
    margin-bottom: 26px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.25);
    color: #0f766e;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.auth-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #14b8a6;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.2);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(20, 184, 166, 0);
    }
}

.auth-card-head h1 {
    margin: 14px 0 8px;
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.auth-card-head p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
    max-width: 360px;
    margin: 0 auto;
}


/* ---- Alert ---- */

.auth-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    margin-bottom: 18px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 600;
}

.auth-alert svg {
    flex-shrink: 0;
    color: #ef4444;
}


/* ---- Form ---- */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-field {
    display: block;
}

.auth-field-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.auth-field-control {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: var(--transition);
}

.auth-field-control:hover {
    border-color: #cbd5e1;
}

.auth-field-control:focus-within {
    border-color: #14b8a6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.15);
}

.auth-field-icon {
    position: absolute;
    inset-inline-start: 14px;
    color: #94a3b8;
    pointer-events: none;
    transition: var(--transition);
}

.auth-field-control:focus-within .auth-field-icon {
    color: #0f766e;
}

.auth-field-control input {
    width: 100%;
    padding: 13px 16px;
    padding-inline-start: 42px;
    padding-inline-end: 16px;
    background: transparent;
    border: none;
    outline: none;
    color: #0f172a;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
}

.auth-field-control input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.auth-field-control input:-webkit-autofill {
    -webkit-text-fill-color: #0f172a;
    -webkit-box-shadow: 0 0 0 30px #ffffff inset;
    caret-color: #0f172a;
}

.auth-field-control:has(.auth-field-toggle) input {
    padding-inline-end: 44px;
}

.auth-field-toggle {
    position: absolute;
    inset-inline-end: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    border-radius: 8px;
    transition: var(--transition);
}

.auth-field-toggle:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.auth-field-toggle.is-on {
    color: #0f766e;
}


/* ---- Row (remember + forgot) ---- */

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 4px;
    font-size: 13px;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-check-box {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.auth-check-box::after {
    content: "";
    width: 9px;
    height: 5px;
    border-inline-start: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
    opacity: 0;
    transition: var(--transition);
}

.auth-check input:checked+.auth-check-box {
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.4);
}

.auth-check input:checked+.auth-check-box::after {
    opacity: 1;
}

.auth-check input:focus-visible+.auth-check-box {
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.25);
}

.auth-link {
    color: #0f766e;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
}

.auth-link:hover {
    color: #14b8a6;
    text-decoration: none;
}


/* ---- Submit ---- */

.auth-submit {
    margin-top: 10px;
    position: relative;
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 60%, #6366f1 120%);
    background-size: 200% 100%;
    background-position: 0% 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: background-position 0.5s ease, transform 0.15s ease, box-shadow 0.25s ease;
    box-shadow: 0 14px 34px rgba(14, 165, 233, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.auth-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.25) 50%, transparent 60%);
    transform: translateX(-120%);
    transition: transform 0.6s ease;
}

.auth-submit:hover {
    background-position: 100% 50%;
    box-shadow: 0 18px 40px rgba(20, 184, 166, 0.45);
}

.auth-submit:hover::before {
    transform: translateX(120%);
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-submit-arrow {
    transition: transform 0.25s ease;
}

body[dir="rtl"] .auth-submit-arrow {
    transform: scaleX(-1);
}

.auth-submit:hover .auth-submit-arrow {
    transform: translateX(3px);
}

body[dir="rtl"] .auth-submit:hover .auth-submit-arrow {
    transform: scaleX(-1) translateX(3px);
}


/* ---- Chips (features inside card) ---- */

.auth-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px dashed rgba(15, 23, 42, 0.1);
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    color: #0f766e;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.3;
}

.auth-chip svg {
    color: #14b8a6;
}


/* ---- Stats strip (below card) ---- */

.auth-stats {
    display: inline-flex;
    align-items: center;
    gap: 26px;
    padding: 12px 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    flex-wrap: wrap;
    justify-content: center;
}

.auth-stat {
    text-align: center;
    min-width: 90px;
}

.auth-stat strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
    background: linear-gradient(135deg, #0f766e, #0ea5e9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.3px;
}

.auth-stat span {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
    font-weight: 500;
}

.auth-stat-sep {
    width: 1px;
    height: 24px;
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.15), transparent);
}


/* ---- Footer ---- */

.auth-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    color: #64748b;
    font-size: 12px;
    padding-top: 18px;
}

.auth-footer a {
    color: #0f766e;
    font-weight: 700;
}

.auth-footer a:hover {
    color: #14b8a6;
    text-decoration: none;
}

.auth-footer-dot {
    opacity: 0.5;
}


/* ---- Responsive ---- */

@media (max-width: 560px) {
    .auth-topbar {
        justify-content: center;
    }
    .auth-card {
        padding: 28px 20px 22px;
        border-radius: 20px;
    }
    .auth-stats {
        gap: 14px;
        padding: 10px 16px;
    }
    .auth-stat-sep {
        display: none;
    }
    .auth-footer {
        font-size: 11px;
    }
}


/* ====== SETTINGS LAYOUT ====== */

.settings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
}

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

.settings-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.settings-nav .nav-link:hover {
    background: var(--bg);
    text-decoration: none;
}

.settings-nav .nav-link.active {
    background: var(--brand-bg);
    color: var(--brand);
    font-weight: 700;
}

.settings-nav .nav-link .icon {
    width: 20px;
    text-align: center;
    font-size: 14px;
}


/* ====== APP FOOTER (bottom of content) ====== */

.app-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: #fff;
    font-size: 12.5px;
    color: var(--ink-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.app-footer a {
    color: var(--brand);
    font-weight: 700;
}


/* ====== RESPONSIVE MOBILE SIDEBAR ====== */

@media (max-width: 768px) {
    body[dir="rtl"] .sidebar {
        transform: translateX(100%);
    }
    body[dir="ltr"] .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0) !important;
    }
    body[dir="rtl"] .main,
    body[dir="ltr"] .main {
        margin: 0;
    }
}


/* ====== HELPERS ====== */

.text-muted {
    color: var(--ink-muted);
}

.text-bold {
    font-weight: 700;
}

.text-brand {
    color: var(--brand);
}

.text-red {
    color: var(--red);
}

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

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

.mt-2 {
    margin-top: 12px;
}

.mb-2 {
    margin-bottom: 12px;
}

.mt-3 {
    margin-top: 18px;
}

.mb-3 {
    margin-bottom: 18px;
}

.d-flex {
    display: flex;
}

.gap-2 {
    gap: 10px;
}

.w-100 {
    width: 100%;
}


/* ====== REPORTS / ANALYTICS ====== */

.aging-bar-track {
    flex: 1;
    height: 14px;
    background: var(--bg);
    border-radius: 999px;
    overflow: hidden;
}

.aging-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--brand);
    transition: var(--transition);
}

.aging-fill-0_30 {
    background: var(--green);
}

.aging-fill-31_60 {
    background: var(--blue);
}

.aging-fill-61_90 {
    background: var(--orange);
}

.aging-fill-91_180 {
    background: #ef4444;
}

.aging-fill-180plus {
    background: #991b1b;
}

.aging-val {
    min-width: 120px;
    text-align: end;
    font-weight: 700;
    font-size: 13px;
}

.ptp-stack {
    display: flex;
    height: 24px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg);
    margin-bottom: 10px;
}

.ptp-bar {
    height: 100%;
    transition: width .3s ease;
}

.ptp-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ink-muted);
}

.ptp-legend .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-inline-end: 6px;
    vertical-align: middle;
}

.mini-stat {
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    min-width: 120px;
}

.mini-label {
    font-size: 11.5px;
    color: var(--ink-muted);
    margin-bottom: 4px;
}

.mini-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
}


/* ====== USERS / ROLES ====== */

.user-row-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-bg);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.role-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--brand-bg);
    color: var(--brand);
    font-size: 11.5px;
    font-weight: 700;
    margin-inline-end: 4px;
}

.permission-matrix {
    display: grid;
    gap: 10px;
}

.permission-group {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    background: #fff;
}

.permission-group h4 {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--brand);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.permission-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 14px;
}

.permission-items label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}


/* ====== TIMELINE (reused by case + legal) ====== */

.timeline {
    position: relative;
    padding-inline-start: 18px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    inset-inline-start: 6px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding: 6px 0 18px;
}

.timeline-dot {
    position: absolute;
    inset-inline-start: -18px;
    top: 8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 3px #fff;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.timeline-title {
    font-weight: 700;
    font-size: 13.5px;
}

.timeline-sub {
    font-size: 12.5px;
    color: var(--ink-muted);
    margin-top: 2px;
}

.timeline-meta {
    font-size: 11.5px;
    color: var(--ink-muted);
    margin-top: 4px;
}


/* ====== TOASTS ====== */

.toast-host {
    position: fixed;
    top: 16px;
    inset-inline-end: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
    max-width: 380px;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    background: #fff;
    border: 1px solid var(--border);
    font-size: 13.5px;
    line-height: 1.5;
    animation: toast-enter .18s ease-out;
}

.toast-body {
    flex: 1;
    white-space: pre-wrap;
}

.toast-close {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: var(--ink-muted);
    padding: 0;
    margin: 2px 0 0;
}

.toast-success {
    border-inline-start: 4px solid #16a34a;
}

.toast-danger {
    border-inline-start: 4px solid #dc2626;
}

.toast-info {
    border-inline-start: 4px solid #2563eb;
}

.toast-leaving {
    animation: toast-leave .2s ease-in forwards;
}

@keyframes toast-enter {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-leave {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}


/* ====== CONFIRM DIALOG ====== */

.confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fade-in .15s ease-out;
}

.confirm-dialog {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    animation: pop-in .2s ease-out;
}

.confirm-body {
    padding: 20px 20px 8px;
    font-size: 14.5px;
    line-height: 1.55;
}

.confirm-actions {
    padding: 14px 20px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: scale(.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* ====== EMPTY STATE ====== */

.empty-state {
    text-align: center;
    padding: 36px 20px;
    color: var(--ink-muted);
    background: #fbfcfe;
    border: 1px dashed var(--border);
    border-radius: 12px;
}

.empty-state .empty-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.7;
}

.empty-state .empty-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    margin-bottom: 4px;
}

.empty-state .empty-sub {
    font-size: 13px;
    margin-bottom: 12px;
}


/* ---------- Phase 4: simple grid helpers ---------- */

.grid {
    display: grid;
    gap: 1rem;
}

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

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

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

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

.hidden {
    display: none !important;
}


/* ---------- Phase 4: loading spinner on submit buttons ---------- */

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dcs-spin .7s linear infinite;
    vertical-align: -2px;
    margin-inline-end: 6px;
}

@keyframes dcs-spin {
    to {
        transform: rotate(360deg);
    }
}

button.is-loading,
.btn.is-loading {
    opacity: .75;
    cursor: progress;
}


/* ---------- Focus ring  accessibility ---------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary, #2563eb);
    outline-offset: 2px;
    border-radius: 4px;
}


/* ====== Select2  match DCS form design ====== */

.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 38px;
    padding: 3px 6px;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-xs) !important;
    background: #fff;
    font-size: 13.5px;
    color: var(--ink);
    transition: var(--transition);
    box-shadow: none;
}

.select2-container--default .select2-selection--single {
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px;
    color: var(--ink);
    padding-inline-start: 4px;
    padding-inline-end: 24px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--ink-muted);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    top: 0;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow {
    left: 6px;
    right: auto;
}

.select2-container--default .select2-selection--multiple {
    padding: 2px 6px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--brand-soft);
    border: 1px solid var(--brand);
    color: var(--brand-dark);
    border-radius: var(--radius-xs);
    padding: 2px 8px;
    font-size: 12.5px;
    margin-top: 4px;
    margin-inline-end: 4px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--brand-dark);
    margin-inline-end: 4px;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
    outline: none;
}

.select2-dropdown {
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow);
    font-size: 13.5px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--brand);
    color: #fff;
}

.select2-container--default .select2-results__option[aria-selected=true],
.select2-container--default .select2-results__option--selected {
    background: var(--brand-bg);
    color: var(--brand-dark);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 6px 10px;
    outline: none;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}


/* Keep Select2 fitting inside our .form-group labels/grids */

.form-group .select2-container {
    display: block;
}


/* Select2 inside filter bars  keep them inline, not full-width */

.filters-bar .select2-container {
    width: auto !important;
    min-width: 160px;
    max-width: 100%;
    flex: 0 0 auto;
}

.filters-bar .select2-container .select2-selection--single {
    min-height: 34px;
    padding: 2px 6px;
}

.filters-bar .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 26px;
    font-size: 12.5px;
}

.filters-bar .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 32px;
}

/* ====== SWEETALERT2 ====== */

.swal2-container {
    z-index: 10000;
}

/* Toasts: no full-screen dimmer. Modals: dim only when not a toast. */
.swal2-container:has(.swal2-toast) {
    background: transparent !important;
    backdrop-filter: none !important;
}

.swal2-container.swal2-backdrop-show:not(:has(.swal2-toast)) {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(2px);
}

.dcs-swal.swal2-popup {
    font-family: inherit;
    width: 26rem;
    max-width: calc(100vw - 2rem);
    padding: 22px 24px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--ink);
}

.dcs-swal .swal2-icon {
    width: 56px;
    height: 56px;
    margin: 6px auto 14px;
    border-width: 3px;
}

.dcs-swal .swal2-icon .swal2-icon-content,
.dcs-swal .swal2-icon.swal2-warning {
    font-size: 2.2rem;
}

.dcs-swal .swal2-icon.swal2-warning {
    color: var(--orange);
    border-color: var(--orange);
    background: var(--orange-soft);
}

.dcs-swal .swal2-icon.swal2-success {
    border-color: var(--green);
}

.dcs-swal .swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: var(--green);
}

.dcs-swal .swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(34, 197, 94, 0.35);
}

.dcs-swal .swal2-icon.swal2-error {
    border-color: var(--red);
    background: var(--red-soft);
}

.dcs-swal .swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: var(--red);
}

.dcs-swal .swal2-icon.swal2-info {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--blue);
}

.dcs-swal .swal2-icon.swal2-question {
    border-color: var(--purple);
    background: var(--purple-soft);
    color: var(--purple);
}

.dcs-swal .dcs-swal__title,
.dcs-swal .swal2-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 6px;
    padding: 0;
    line-height: 1.45;
}

.dcs-swal .dcs-swal__text,
.dcs-swal .swal2-html-container {
    font-size: 13.5px;
    color: var(--ink-secondary);
    line-height: 1.6;
    margin: 0;
    padding: 0 4px;
}

.dcs-swal .swal2-actions,
.dcs-swal .dcs-swal__actions {
    margin: 20px 0 0;
    padding: 0;
    gap: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.dcs-swal .dcs-swal__btn {
    min-width: 110px;
    justify-content: center;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-xs);
    box-shadow: none;
    transition: var(--transition);
}

.dcs-swal .dcs-swal__btn:focus {
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.dcs-swal .dcs-swal__btn.btn-danger:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
}

.dcs-swal .dcs-swal__btn--ghost {
    background: #fff;
    color: var(--ink-secondary);
    border: 1px solid var(--border);
}

.dcs-swal .dcs-swal__btn--ghost:hover {
    background: var(--bg);
    color: var(--ink);
    border-color: #cbd5e1;
}

.dcs-swal .swal2-input,
.dcs-swal .swal2-textarea,
.dcs-swal .swal2-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 13.5px;
    padding: 9px 12px;
    box-shadow: none;
    color: var(--ink);
}

.dcs-swal .swal2-input:focus,
.dcs-swal .swal2-textarea:focus,
.dcs-swal .swal2-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
    outline: none;
}

.dcs-swal .swal2-validation-message {
    background: var(--red-soft);
    color: var(--red);
    border-radius: var(--radius-xs);
    font-size: 12.5px;
}

.dcs-swal .swal2-close {
    color: var(--ink-muted);
    transition: var(--transition);
}

.dcs-swal .swal2-close:hover {
    color: var(--red);
}

.dcs-swal .swal2-footer {
    color: var(--ink-muted);
    font-size: 12.5px;
    border-top: 1px dashed var(--border);
    margin-top: 16px;
    padding-top: 12px;
}

.dcs-swal--toast.swal2-toast {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    background: var(--card);
}

.dcs-swal--toast.swal2-toast .swal2-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 6px;
}

.dcs-swal--toast.swal2-toast .swal2-timer-progress-bar {
    background: var(--brand);
}

[dir="rtl"] .dcs-swal--toast.swal2-toast .swal2-icon {
    margin-left: 8px;
    margin-right: 0;
}

@media (max-width: 480px) {
    .dcs-swal .dcs-swal__btn {
        min-width: 0;
        flex: 1 1 auto;
    }
}

.btn-success {
    color: #fff;
    background-color: var(--success);
    border-color: var(--success);
}

.btn-success:hover {
    color: #fff !important;
    background-color: #04b386 !important;
    border-color: #04b386 !important;
}

.btn-success:focus,
.btn-success.focus {
    color: rgb(var(--white));
    background-color: #04b386;
    border-color: #04b386;
    box-shadow: 0 0 0 1px #04b386;
}

.btn-success.disabled,
.btn-success:disabled {
    color: var(--fixed-white);
    background-color: #04b386;
    border-color: #04b386;
}

.btn-success:not(:disabled):not(.disabled):active,
.btn-success:not(:disabled):not(.disabled).active {
    color: rgb(var(--white));
    background-color: #04b386;
    border-color: #04b386;
}


/* ====== FILE INPUTS ====== */

.form-group input[type="file"],
input[type="file"].form-input {
    width: 100%;
    font-size: 13px;
    color: var(--ink-secondary);
    padding: 0;
    border: 1px dashed var(--border);
    border-radius: var(--radius-xs);
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
    min-height: 38px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    font-family: inherit;
}

.form-group input[type="file"]:hover,
input[type="file"].form-input:hover {
    border-color: var(--brand);
    background: var(--brand-bg);
}

.form-group input[type="file"]:focus,
input[type="file"].form-input:focus {
    outline: none;
    border-color: var(--brand);
    border-style: solid;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.form-group input[type="file"]::file-selector-button,
input[type="file"].form-input::file-selector-button {
    padding: 8px 14px;
    margin-inline-end: 10px;
    border: none;
    background: var(--brand);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: 0;
    transition: var(--transition);
}

.form-group input[type="file"]::file-selector-button:hover,
input[type="file"].form-input::file-selector-button:hover {
    background: var(--brand-dark);
}

.form-group input[type="file"]::-webkit-file-upload-button,
input[type="file"].form-input::-webkit-file-upload-button {
    padding: 8px 14px;
    margin-inline-end: 10px;
    border: none;
    background: var(--brand);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: 0;
    transition: var(--transition);
}

body[dir="rtl"] .form-group input[type="file"],
body[dir="rtl"] input[type="file"].form-input {
    text-align: right;
}


/* ====== ICON BUTTON VARIANTS ====== */

.btn-icon--danger {
    color: var(--red);
    border-color: var(--red-soft);
    background: var(--red-soft);
}

.btn-icon--danger:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}


/* ====== ATTACHMENTS PANEL ====== */

.attachments-panel .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.attachments-panel__icon {
    margin-inline-end: 6px;
    font-size: 16px;
}

.attachments-panel__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 11.5px;
    font-weight: 700;
}

.attachments-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 1fr) minmax(180px, 1.8fr) auto;
    gap: 12px 14px;
    align-items: end;
    padding: 14px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--sidebar-bg-soft);
}

.attachments-form .form-group {
    margin: 0;
}

.attachments-form__submit .btn {
    width: 100%;
    justify-content: center;
    padding: 9px 16px;
}

@media (max-width: 900px) {
    .attachments-form {
        grid-template-columns: 1fr 1fr;
    }
    .attachments-form__file,
    .attachments-form__desc,
    .attachments-form__submit {
        grid-column: span 2;
    }
}

@media (max-width: 520px) {
    .attachments-form {
        grid-template-columns: 1fr;
    }
    .attachments-form__file,
    .attachments-form__category,
    .attachments-form__desc,
    .attachments-form__submit {
        grid-column: span 1;
    }
}

.attachments-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.attachments-table {
    width: 100%;
    margin: 0;
}

.attachments-table thead th {
    background: var(--sidebar-bg-soft);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--ink-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.attachments-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}

.attachments-table tbody tr:last-child td {
    border-bottom: none;
}

.attachments-table tbody tr:hover {
    background: var(--brand-bg);
}

.attachment-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.attachment-name__icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 16px;
    flex-shrink: 0;
}

.attachment-name strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
    word-break: break-word;
}

.attachment-name__desc {
    font-size: 12px;
    color: var(--ink-muted);
    margin-top: 2px;
}

.attachment-actions {
    display: inline-flex;
    gap: 6px;
    justify-content: flex-end;
}
