:root {
    --brand: #0b1f3a;
    --brand-soft: rgba(11, 31, 58, 0.08);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --surface: #ffffff;
    --surface-soft: #f6f8fb;
    --border: #dfe4ec;
    --text-primary: #1a2232;
    --text-muted: #62708a;
    --shadow-sm: 0 2px 10px rgba(24, 39, 75, 0.08);
    --shadow-lg: 0 14px 40px rgba(24, 39, 75, 0.14);
    --radius-sm: 10px;
    --radius-md: 14px;
    --sidebar-width: 248px;
}

:root[data-theme='dark'] {
    --brand: #78a2ff;
    --brand-soft: rgba(120, 162, 255, 0.14);
    --surface: #0f1b35;
    --surface-soft: #162447;
    --border: #27385f;
    --text-primary: #e7eeff;
    --text-muted: #a8b6d8;
    --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.24);
    --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
    background:
        radial-gradient(circle at 10% -10%, rgba(118, 147, 201, 0.15), transparent 32%),
        radial-gradient(circle at 90% -15%, rgba(208, 178, 87, 0.12), transparent 24%),
        var(--surface-soft);
    color: var(--text-primary);
}

a {
    color: var(--brand);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.app-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content > main {
    animation: pageFadeIn 0.26s ease;
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #1a2a4d 0%, #16233f 100%);
    color: #e9f0ff;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header {
    flex-shrink: 0;
    padding: 0.85rem 0.85rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand-title {
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

.sidebar-brand-subtitle {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.72;
}

.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 162, 255, 0.3) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(120, 162, 255, 0.3);
    border-radius: 999px;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-section {
    margin-bottom: 0.45rem;
}


.nav-section-title {
    color: #27304a;
    background: #e6eaf3;
    border-radius: 8px;
    border: 1px solid #d3dcea;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.66rem;
    font-weight: 700;
    padding: 0.45rem 0.55rem 0.25rem;
    margin-bottom: 0.15rem;
}

.nav-section-count {
    font-size: 0.62rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 0.08rem 0.35rem;
    color: rgba(233, 240, 255, 0.85);
    min-width: 22px;
    text-align: center;
}

.crm-link {
    color: #e9f0ff;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.42rem 0.62rem;
    gap: 0.56rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.18s;
}

.crm-link-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.92rem;
}

.crm-link-label {
    flex: 1;
    min-width: 0;
}

.crm-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateX(2px);
}

.crm-link.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(58, 128, 255, 0.48));
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 8px 20px rgba(36, 88, 255, 0.22);
}

.sidebar-foot {
    flex-shrink: 0;
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.14);
}

.sidebar-user .user-avatar,
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.82rem;
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid rgba(36, 88, 255, 0.22);
}

.sidebar-user .text-muted {
    color: rgba(233, 240, 255, 0.72) !important;
}

.sidebar-foot .btn-outline-secondary {
    color: #e9f0ff;
    border-color: rgba(255, 255, 255, 0.22);
}

.sidebar-foot .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.36);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 58px;
    padding: 0.65rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

:root[data-theme='dark'] .app-topbar {
    background: rgba(15, 27, 53, 0.84);
}

.topbar-title {
    min-width: 0;
    display: flex;
    align-items: center;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.topbar-breadcrumb .breadcrumb {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.topbar-breadcrumb .breadcrumb-item {
    color: var(--text-muted);
}

.topbar-breadcrumb .breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.topbar-breadcrumb .breadcrumb-item a:hover {
    color: var(--brand);
}

.topbar-breadcrumb .breadcrumb-item.active {
    color: var(--brand);
}

.topbar-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--text-muted);
}

.topbar-icon-btn {
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: var(--surface);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.topbar-icon-btn:hover {
    color: var(--brand);
    border-color: rgba(36, 88, 255, 0.35);
    background: var(--brand-soft);
}

.page-heading {
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem !important;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(235, 241, 255, 0.9));
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(36, 88, 255, 0.05);
    padding: 0.9rem 1rem 0.65rem;
}

.page-heading h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.18rem;
}

.page-heading .lead {
    margin-bottom: 0;
    font-size: 0.94rem;
    color: var(--text-muted);
}

.priority-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}

.priority-pill {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 0.62rem 0.72rem;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    box-shadow: var(--shadow-sm);
}

.priority-pill:hover {
    border-color: rgba(36, 88, 255, 0.32);
    background: var(--brand-soft);
}

.priority-pill-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.priority-pill-value {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--brand);
}

.critical-alert-list {
    display: grid;
    gap: 0.55rem;
}

.critical-alert {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 0.6rem;
    background: var(--surface);
}

.critical-alert-icon {
    color: var(--brand);
    text-align: center;
}

.critical-alert-text {
    font-size: 0.87rem;
    font-weight: 600;
}

.critical-alert-value {
    min-width: 32px;
    text-align: center;
    font-size: 0.83rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.1rem 0.48rem;
    background: var(--brand-soft);
    color: var(--brand);
}

.critical-alert-danger {
    border-color: rgba(239, 68, 68, 0.38);
}

.critical-alert-danger .critical-alert-icon,
.critical-alert-danger .critical-alert-value {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.14);
}

.critical-alert-warning {
    border-color: rgba(245, 158, 11, 0.4);
}

.critical-alert-warning .critical-alert-icon,
.critical-alert-warning .critical-alert-value {
    color: #a16207;
    background: rgba(245, 158, 11, 0.18);
}

.critical-alert-pending {
    border-color: rgba(59, 130, 246, 0.35);
}

.critical-alert-good {
    border-color: rgba(16, 185, 129, 0.35);
}

.critical-alert-good .critical-alert-icon,
.critical-alert-good .critical-alert-value {
    color: #047857;
    background: rgba(16, 185, 129, 0.16);
}

.stat-card {
    background: #fff;
    border: 1.5px solid #e0e7ef;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(36, 88, 255, 0.06);
    color: #22315a;
    margin-bottom: 0.5rem;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

:root[data-theme='dark'] .stat-card {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(36, 88, 255, 0.28);
    box-shadow: 0 18px 36px rgba(27, 45, 94, 0.12);
}

.stat-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.stat-card-link:hover {
    color: inherit;
}

.stat-title {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.stat-value {
    font-size: clamp(1.4rem, 1.5vw + 0.7rem, 2rem);
    font-weight: 800;
    margin-top: 0.15rem;
}

.stat-meta {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.9rem;
}

.stat-context {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    font-size: 0.73rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.26rem 0.6rem;
}

.stat-trend-positive {
    background: rgba(16, 185, 129, 0.13);
    color: #047857;
}

.stat-trend-negative {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.stat-trend-neutral {
    background: rgba(36, 88, 255, 0.1);
    color: var(--brand);
}

.stat-link-hint {
    margin-top: 0.65rem;
    color: var(--brand);
    font-size: 0.74rem;
    font-weight: 700;
}

.icon-pill {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.crm-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(36, 88, 255, 0.04);
    color: #22315a;
    border: 1px solid #e0e7ef;
}

:root[data-theme='dark'] .crm-card {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
}

.crm-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.93rem;
    padding: 0.55rem 0.9rem;
}

.crm-card .card-body {
    padding: 0.7rem 0.9rem;
}

.crm-table {
    color: var(--text-primary);
    margin-bottom: 0;
}

.crm-card .table-responsive {
    max-height: 62vh;
    overflow: auto;
}

.crm-table thead th {
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--surface);
    padding: 0.7rem 0.9rem;
    z-index: 2;
}

.crm-table tbody td {
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    padding: 0.65rem 0.9rem;
}

.crm-table tbody td.table-empty-cell {
    background: transparent;
}

.crm-table tbody td.table-empty-cell .empty-state {
    margin: 0.2rem 0;
}

/* --- Quick Action Card Styles --- */
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    background: #f9fbff;
    color: #22315a;
    border-radius: 14px;
    padding: 1.05rem 1rem;
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.1);
    font-weight: 600;
    border: 1.5px solid #e0e7ef;
    transition: background 0.22s, color 0.22s, box-shadow 0.22s, border-color 0.22s, transform 0.18s;
}

:root[data-theme='dark'] .quick-action {
    background: rgba(15, 27, 53, 0.88);
    color: var(--text-primary);
    border-color: var(--border);
}

.quick-action:hover {
    background: linear-gradient(90deg, #e0e7ff 60%, #f0f6ff 100%);
    color: #2563eb;
    box-shadow: 0 10px 32px rgba(37, 99, 235, 0.16);
    border-color: rgba(37, 99, 235, 0.28);
    transform: translateY(-2px);
}

:root[data-theme='dark'] .quick-action:hover {
    background: rgba(27, 42, 79, 0.95);
    color: var(--brand);
}

.quick-action .qa-title {
    font-weight: 700;
    margin-top: 0.4rem;
    font-size: 0.9rem;
}

.quick-action .qa-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.quick-action i {
    color: var(--brand);
}

/* --- Topbar Quick Action Button --- */
.topbar-quick-action {
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: #fff;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 800;
    padding: 0.52rem 0.68rem;
    border-radius: 10px;
    background: #0b1f3a;
    display: inline-flex;
    transition: background 0.22s, color 0.22s;
}

.topbar-quick-action:hover {
    color: #fff;
    background: #142a4b;
}

.empty-state {
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, var(--surface), var(--surface-soft));
    text-align: center;
    padding: 1.4rem 1rem;
}

.empty-state .empty-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 0.6rem;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
}

.empty-state .empty-title {
    font-weight: 700;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.empty-state .empty-subtitle {
    color: var(--text-muted);
    margin-bottom: 0;
    font-size: 0.875rem;
}

.activity-item {
    border-bottom: 1px dashed var(--border);
    padding: 0.6rem 0;
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.76rem;
    margin-top: 0.1rem;
}

.badge-soft {
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid rgba(36, 88, 255, 0.2);
    font-size: 0.68rem;
}

.report-toolbar .card-body {
    padding: 1rem 1.05rem;
}

.report-toolbar-layout {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.report-toolbar-copy {
    flex: 1 1 320px;
}

.report-toolbar-title {
    font-size: 1rem;
    font-weight: 800;
    color: #1f2d48;
}

.report-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.report-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.46rem 0.78rem;
    border-radius: 999px;
    border: 1px solid #d9e3f1;
    background: #f8fbff;
    color: #5e708e;
    text-decoration: none;
    font-size: 0.76rem;
    font-weight: 700;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.report-chip:hover,
.report-chip.active {
    background: rgba(36, 88, 255, 0.1);
    border-color: rgba(36, 88, 255, 0.24);
    color: var(--brand);
    transform: translateY(-1px);
}

.report-custom-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.report-custom-form > div {
    min-width: 148px;
}

.report-progress {
    height: 8px;
    background: rgba(36, 88, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.report-progress .progress-bar {
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
}

.report-comparison-note {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

:root[data-theme='dark'] .report-chip {
    background: rgba(12, 24, 49, 0.95);
    border-color: var(--border);
    color: var(--text-muted);
}

:root[data-theme='dark'] .report-chip:hover,
:root[data-theme='dark'] .report-chip.active {
    background: rgba(36, 88, 255, 0.18);
    color: var(--text-primary);
}

:root[data-theme='dark'] .report-toolbar-title {
    color: var(--text-primary);
}

@media (max-width: 991.98px) {
    .report-custom-form {
        width: 100%;
    }

    .report-custom-form > div {
        flex: 1 1 180px;
    }
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.4rem;
}

.status-dot.pending { background: var(--warning); }
.status-dot.good { background: var(--success); }
.status-dot.warning { background: var(--danger); }

.text-muted-soft {
    color: var(--text-muted) !important;
}

.reveal {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.show {
    opacity: 1;
    transform: none;
}

.form-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(36, 88, 255, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(36, 88, 255, 0.14);
    background: var(--surface);
    color: var(--text-primary);
}

:root[data-theme='dark'] .form-control,
:root[data-theme='dark'] .form-select {
    background: #0c1831;
    color: var(--text-primary);
}

.btn-brand {
    background: linear-gradient(90deg, #2563eb 60%, #60a5fa 100%);
    color: #fff;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 700;
    padding: 0.62rem 1.35rem;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.2);
    transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
    letter-spacing: 0.01em;
}

.btn-brand:hover {
    background: linear-gradient(90deg, #1746a2 60%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.28);
    transform: translateY(-1px);
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.settings-section-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.settings-section-title {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.settings-section-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.settings-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.settings-field-row:last-child {
    border-bottom: none;
}

.settings-field-label {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.settings-field-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.theme-toggle {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.44rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
    display: inline-flex;
    align-items: center;
}

.theme-toggle:hover {
    color: var(--brand);
    border-color: rgba(36, 88, 255, 0.3);
    background: var(--brand-soft);
}

.theme-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.18s, box-shadow 0.18s;
    background: var(--surface);
    text-align: center;
}

.theme-card:hover {
    border-color: var(--brand);
}

.theme-card.active {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.theme-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--brand);
}

.theme-card-label {
    font-size: 0.85rem;
    font-weight: 700;
}

.role-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.profile-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--brand-soft);
    color: var(--brand);
    border: 3px solid var(--border);
    flex-shrink: 0;
}

.info-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row-label {
    color: var(--text-muted);
    font-weight: 600;
    min-width: 130px;
}

.info-row-value {
    font-weight: 500;
}

.audit-badge {
    display: inline-block;
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    white-space: nowrap;
    border: 1px solid transparent;
}

.audit-badge-auth { background: rgba(36, 88, 255, 0.1); color: var(--brand); border-color: rgba(36, 88, 255, 0.22); }
.audit-badge-create { background: rgba(16, 185, 129, 0.1); color: var(--success); border-color: rgba(16, 185, 129, 0.22); }
.audit-badge-delete { background: rgba(239, 68, 68, 0.1); color: var(--danger); border-color: rgba(239, 68, 68, 0.22); }
.audit-badge-update { background: rgba(245, 158, 11, 0.1); color: var(--warning); border-color: rgba(245, 158, 11, 0.22); }
.audit-badge-view { background: rgba(99, 102, 241, 0.1); color: #818cf8; border-color: rgba(99, 102, 241, 0.22); }
.audit-badge-default { background: var(--surface-soft); color: var(--text-muted); border-color: var(--border); }

.meta-pairs { display: flex; flex-direction: column; gap: 2px; }
.meta-key { font-size: 0.7rem; font-weight: 700; font-family: monospace; color: var(--brand); }
.meta-sep { color: var(--text-muted); font-size: 0.7rem; margin: 0 2px; }
.meta-val { font-size: 0.7rem; font-family: monospace; color: var(--text-primary); word-break: break-word; }
.meta-raw { font-size: 0.72rem; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 5px; padding: 0.1rem 0.3rem; color: var(--text-muted); word-break: break-all; cursor: help; }

.ip-code {
    font-size: 0.72rem;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.1rem 0.35rem;
    color: var(--text-muted);
    font-family: monospace;
    white-space: nowrap;
}

.audit-ts {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ts-date {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.ts-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: monospace;
}

.audit-table tbody .audit-row:hover td {
    background: var(--surface-soft);
}

.filter-chips-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.filter-chip {
    background: #e6edfa;
    color: #2458ff;
    border-radius: 5px;
    padding: 0.09rem 0.5rem;
    font-size: 0.74rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3em;
    border: 1px solid #dde5f2;
}

.role-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 0.85rem;
}

.preset-preview {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 0.65rem 0.75rem;
}

.preset-preview-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.7rem;
    margin-bottom: 0.5rem;
}

.preset-preview-grid {
    display: grid;
    gap: 0.35rem;
}

.preset-preview-row {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) auto auto auto;
    gap: 0.45rem;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 0.35rem 0.45rem;
}

.preset-preview-total {
    border-style: dashed;
}

.preset-role {
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.preset-impact-add,
.preset-impact-remove,
.preset-impact-target {
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.08rem 0.42rem;
    white-space: nowrap;
}

.preset-impact-add {
    color: #047857;
    background: rgba(16, 185, 129, 0.14);
}

.preset-impact-remove {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.14);
}

.preset-impact-target {
    color: var(--text-muted);
    background: var(--brand-soft);
}

.preset-mini-impact {
    display: inline-flex;
    gap: 0.25rem;
}

.role-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.role-card-title {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.07em;
}

.role-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.role-card-meta .btn {
    white-space: nowrap;
}

.role-import-input {
    min-width: 210px;
}

.chat-stream {
    max-height: 68vh;
    overflow: auto;
}

.chat-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.55rem;
    background: var(--surface-soft);
}

.chat-item-mine {
    background: var(--brand-soft);
    border-color: rgba(36, 88, 255, 0.3);
}

.chat-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.chat-item-author {
    font-weight: 700;
    color: var(--text-primary);
}

.chat-item-time {
    font-size: 0.72rem;
    white-space: nowrap;
}

.chat-item-body {
    white-space: normal;
    word-break: break-word;
}

.chat-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1100;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chat-fab-badge {
    position: absolute;
    right: -5px;
    top: -4px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.08rem 0.36rem;
    border-radius: 999px;
    background: #10b981;
    color: #fff;
}

.chat-popup {
    position: fixed;
    right: 20px;
    bottom: 88px;
    width: min(360px, calc(100vw - 24px));
    max-height: min(70vh, 620px);
    z-index: 1100;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-popup.open {
    display: flex;
}

.chat-popup-head {
    padding: 0.58rem 0.7rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--surface-soft);
}

.chat-popup-body {
    padding: 0.6rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.chat-popup-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    padding: 0.45rem 0.55rem;
}

.chat-popup-item-mine {
    background: var(--brand-soft);
    border-color: rgba(36, 88, 255, 0.28);
}

.chat-popup-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-bottom: 0.15rem;
}

.chat-popup-text {
    word-break: break-word;
    font-size: 0.86rem;
}

.chat-popup-form {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 0.6rem;
}

.direct-shell {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 0.8rem;
}

.direct-users {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 0.45rem;
    display: grid;
    gap: 0.35rem;
    max-height: 62vh;
    overflow-y: auto;
}

.direct-users-tools {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-soft);
    padding-bottom: 0.2rem;
}

.chat-live-pill {
    display: inline-block;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.16);
    color: #047857;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.08rem 0.42rem;
}

.chat-live-pill.offline {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}

.direct-user {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    text-decoration: none;
    color: var(--text-primary);
    padding: 0.45rem 0.55rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.direct-user:hover {
    border-color: rgba(36, 88, 255, 0.35);
    background: var(--brand-soft);
}

.direct-user.active {
    border-color: rgba(36, 88, 255, 0.45);
    background: var(--brand-soft);
}

.direct-user-name {
    font-size: 0.86rem;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.direct-user-unread {
    min-width: 22px;
    text-align: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.08rem 0.35rem;
}

.direct-chat {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    min-height: 330px;
}

.direct-chat-head {
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
    padding: 0.55rem 0.7rem;
}

.direct-stream {
    flex: 1 1 auto;
    overflow-y: auto;
    max-height: 52vh;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.direct-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    padding: 0.45rem 0.55rem;
}

.direct-item-mine {
    border-color: rgba(36, 88, 255, 0.35);
    background: var(--brand-soft);
}

.direct-item-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-bottom: 0.15rem;
}

.direct-item-body {
    font-size: 0.88rem;
    word-break: break-word;
}

.direct-composer {
    border-top: 1px solid var(--border);
    padding: 0.65rem;
}

#directSendFeedback,
#teamSendFeedback {
    min-height: 1em;
}

@media (max-width: 575.98px) {
    .chat-fab {
        right: 12px;
        bottom: 12px;
    }

    .chat-popup {
        right: 12px;
        bottom: 78px;
        width: calc(100vw - 24px);
    }
}

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

    .direct-users {
        max-height: 180px;
    }

    .direct-stream {
        max-height: 44vh;
    }
}

.perm-group {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.65rem;
    background: var(--surface-soft);
}

.perm-group-title {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.perm-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    padding: 0.45rem 0.5rem;
    cursor: pointer;
}

.perm-check .form-check-input {
    margin-top: 0.2rem;
}

.perm-check-label {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.perm-check-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

.perm-check-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    word-break: break-word;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
}

.auth-wrap {
    width: min(1020px, 100%);
    display: grid;
    gap: 1rem;
    grid-template-columns: 1.1fr 1fr;
}

.auth-visual {
    border: 1px solid var(--border);
    border-radius: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(36, 88, 255, 0.22), transparent 42%),
        radial-gradient(circle at 80% 14%, rgba(16, 185, 129, 0.18), transparent 36%),
        linear-gradient(160deg, var(--surface), var(--surface-soft));
    box-shadow: var(--shadow-lg);
    padding: clamp(1.4rem, 2vw, 2rem);
    position: relative;
    overflow: hidden;
}

.auth-visual::after {
    content: '';
    position: absolute;
    right: -56px;
    bottom: -56px;
    width: 200px;
    height: 200px;
    border-radius: 30px;
    background: rgba(36, 88, 255, 0.1);
    transform: rotate(22deg);
}

.app-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(36, 88, 255, 0.24), rgba(36, 88, 255, 0.1));
    color: var(--brand);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.auth-kpi {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.46);
    padding: 0.8rem;
}

:root[data-theme='dark'] .auth-kpi {
    background: rgba(16, 28, 52, 0.62);
}

.login-card {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(170deg, var(--surface), var(--surface-soft));
    box-shadow: var(--shadow-lg);
}

.crm-toast-container {
    z-index: 1200;
}

.crm-toast {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    min-width: 260px;
}

.crm-toast .toast-header {
    background: var(--surface-soft);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.crm-toast.crm-toast-success .toast-header i { color: var(--success); }
.crm-toast.crm-toast-danger .toast-header i { color: var(--danger); }
.crm-toast.crm-toast-warning .toast-header i { color: var(--warning); }
.crm-toast.crm-toast-info .toast-header i { color: var(--brand); }

@media (max-width: 991.98px) {
    .app-sidebar {
        width: 78px;
    }

    .sidebar-header {
        justify-content: center;
    }

    .sidebar-header .fw-bold,
    .nav-section-title,
    .crm-link-label,
    .sidebar-user > div,
    .sidebar-foot .btn .theme-label {
        display: none;
    }

    .crm-link {
        justify-content: center;
        padding: 0.52rem;
    }

    .crm-link-icon {
        width: auto;
        font-size: 1rem;
    }

    .sidebar-foot {
        padding: 0.6rem;
    }

    .topbar-breadcrumb .breadcrumb {
        font-size: 0.68rem;
    }

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

    .preset-preview-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 767.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 260px !important;
        height: 100vh;
        z-index: 1050;
        transition: left 0.25s ease;
    }

    .app-sidebar.sidebar-open {
        left: 0;
    }

    .app-sidebar.sidebar-open .sidebar-header .fw-bold,
    .app-sidebar.sidebar-open .nav-section-title,
    .app-sidebar.sidebar-open .crm-link-label,
    .app-sidebar.sidebar-open .sidebar-user > div,
    .app-sidebar.sidebar-open .sidebar-foot .btn .theme-label {
        display: block;
    }

    .app-sidebar.sidebar-open .crm-link {
        justify-content: flex-start;
        padding: 0.5rem 0.75rem;
    }

    .app-sidebar.sidebar-open .sidebar-header {
        justify-content: flex-start;
    }

    .sidebar-nav {
        max-height: none;
    }

    .topbar-title img {
        display: none;
    }

    .topbar-search {
        width: min(200px, 100%);
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1049;
    cursor: pointer;
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--surface-soft);
}

.topbar-quick-action.dropdown-toggle::after {
    display: none;
}

.crm-quick-menu {
    min-width: 200px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.crm-quick-menu .dropdown-item {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.crm-quick-menu .dropdown-item:hover {
    background: var(--surface-soft);
}

@media (max-width: 575.98px) {
    .crm-table thead {
        display: none;
    }

    .crm-table,
    .crm-table tbody {
        display: block;
    }

    .crm-table tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        margin-bottom: 0.6rem;
        padding: 0.6rem 0.75rem;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .crm-table tbody td {
        display: block;
        border: none;
        padding: 0.18rem 0;
        font-size: 0.875rem;
    }

    .crm-table tbody td:first-child {
        font-weight: 600;
        font-size: 0.95rem;
        padding-bottom: 0.35rem;
        margin-bottom: 0.25rem;
        border-bottom: 1px solid var(--border);
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .reveal.show {
        opacity: 1;
        transform: none;
    }

    .app-sidebar {
        transition: none;
    }
}

@media (max-width: 575.98px) {
    .page-heading {
        padding: 0.75rem 0.75rem 0.55rem;
    }

    .page-heading .lead {
        font-size: 0.85rem;
    }

    .theme-toggle .theme-label {
        display: none !important;
    }

    .auth-wrap {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        display: none;
    }

    .priority-strip {
        grid-template-columns: 1fr;
    }
}

/* Sidebar & topbar design refinements */
.app-sidebar {
    width: 248px;
    background: #f8fafd;
    color: #32415f;
    border-right: 1px solid #e4e8ef;
}

.sidebar-header {
    padding: 1.1rem 1rem 0.85rem;
    border-bottom: 1px solid #e7ebf1;
}

.sidebar-brand-title {
    color: #1b2740;
    font-size: 0.98rem;
    font-weight: 800;
}

.sidebar-brand-subtitle {
    color: #74839f;
    letter-spacing: 0.08em;
    font-size: 0.64rem;
}

.nav-section-title {
    color: #6f7f99;
}

.nav-section-title-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-decoration: none;
    transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.nav-section-title-link:hover,
.nav-section-title-link.active {
    color: #27304a;
    background: #dde6f6;
    border-color: #c6d4ea;
}

.nav-section-count {
    color: #5f6f8a;
    border-color: #d3dcea;
    background: #eef3fb;
}

.crm-link {
    color: #4f607d;
    border-radius: 11px;
    font-size: 0.83rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.5rem 0.62rem;
}

.crm-link:hover {
    color: #1f2f4e;
    background: #eef3fb;
    border-color: #d8e0ee;
    transform: translateX(0);
}

.crm-link.active {
    color: #0f203d;
    background: #eaf0f9;
    border-color: #d2dced;
    box-shadow: none;
    border-right: 3px solid #d7aa38;
}

.sidebar-foot {
    background: #f6f9fe;
    border-top: 1px solid #e2e8f2;
}

.sidebar-user .text-muted {
    color: #6a7b97 !important;
}

.app-logo-icon {
    background: linear-gradient(150deg, rgba(11, 31, 58, 0.14), rgba(11, 31, 58, 0.06));
    color: #102442;
}

.app-topbar {
    min-height: 64px;
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid #e0e6ef;
    background: rgba(255, 255, 255, 0.9);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    flex: 1 1 auto;
}

.topbar-search {
    position: relative;
    width: min(500px, 100%);
}

.topbar-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a97ad;
    font-size: 0.83rem;
}

.topbar-search input {
    width: 100%;
    border: 1px solid #dfe6f2;
    border-radius: 11px;
    height: 38px;
    background: #f8fbff;
    padding: 0.42rem 0.72rem 0.42rem 2rem;
    font-size: 0.85rem;
    color: #243552;
}

.topbar-search input:focus {
    outline: none;
    border-color: #9bb0d6;
    box-shadow: 0 0 0 0.18rem rgba(66, 93, 141, 0.16);
    background: #fff;
}

.topbar-user {
    gap: 0.6rem;
}

.topbar-quick-action {
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: #fff;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 800;
    padding: 0.52rem 0.68rem;
    border-radius: 10px;
    background: #0b1f3a;
}

.topbar-quick-action:hover {
    color: #fff;
    background: #142a4b;
}

.topbar-profile {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.topbar-profile-meta {
    text-align: right;
}

.topbar-profile-name {
    font-size: 0.74rem;
    font-weight: 800;
    color: #1f2d48;
}

.topbar-profile-role {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #7684a0;
    font-weight: 700;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #dce7fb;
    color: #23406f;
}

.page-heading {
    background: linear-gradient(95deg, rgba(255, 255, 255, 0.96), rgba(242, 246, 252, 0.92));
    border: 1px solid #dfe6f1;
    border-radius: 16px;
    padding: 1rem 1.05rem 0.75rem;
    box-shadow: 0 10px 28px rgba(17, 34, 63, 0.07);
}

.crm-card,
.stat-card {
    border-radius: 16px;
    border: 1px solid #dde4ef;
    box-shadow: 0 10px 24px rgba(11, 31, 58, 0.06);
}

.crm-card .card-header {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #697a98;
    border-bottom: 1px solid #e4eaf4;
    padding: 0.72rem 0.95rem;
}

.crm-table thead th {
    background: #f9fbff;
    color: #7a88a3;
    font-size: 0.67rem;
    letter-spacing: 0.09em;
}

.crm-table tbody tr:hover td {
    background: #f6f9ff;
}

.form-control,
.form-select {
    border: 1px solid #d9e2ef;
    border-radius: 11px;
    min-height: 38px;
    background: #fff;
}

.btn-brand {
    background: linear-gradient(92deg, #0b1f3a, #213f73);
    border-radius: 11px;
}

.quick-action {
    border-radius: 14px;
    background: #f9fbff;
    border-color: #dce4f0;
}

.topbar-clock-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s;
    white-space: nowrap;
    border: 1.5px solid transparent;
    flex-shrink: 0;
}

.topbar-clock-btn:hover {
    transform: translateY(-1px);
}

.topbar-clock-in {
    color: #fff;
    border-color: #10b981;
    background: #10b981;
}

.topbar-clock-in:hover {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    color: #fff;
}

.topbar-clock-out {
    color: #fff;
    border-color: #ef4444;
    background: #ef4444;
}

.topbar-clock-out:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
    color: #fff;
}

.topbar-clock-done {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
    border: 1.5px solid rgba(16, 185, 129, 0.4);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .topbar-clock-btn span,
    .topbar-clock-done span {
        display: none;
    }

    .topbar-clock-btn,
    .topbar-clock-done {
        padding: 0.5rem 0.6rem;
    }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        width: 82px;
    }

    .topbar-search {
        display: none;
    }
}
