/* ==========================================================================
   GLOBAL THEME SYSTEM & 4-COLOR PALETTES
   Themes: Indigo (Modern Tech), Emerald (Medical Mint), Sapphire (Ocean Clinical), Amethyst (Royal Luxury)
   ========================================================================== */

:root {
    /* Base Color Tokens (Default: Indigo Modern) */
    --primary: #4f46e5;
    --primary-rgb: 79, 70, 229;
    --primary-strong: #4338ca;
    --primary-soft: #eef2ff;
    --primary-glow: rgba(var(--primary-rgb), 0.18);
    --primary-border: rgba(var(--primary-rgb), 0.28);
    --sidebar-accent: #818cf8;

    /* Semantic Status Colors */
    --secondary: #0d9488;
    --secondary-soft: #ccfbf1;
    --amber: #d97706;
    --amber-soft: #fef3c7;
    --danger: #ef4444;
    --danger-soft: #fee2e2;
    --success: #16a34a;
    --success-soft: #dcfce7;
    --info: #0284c7;
    --info-soft: #e0f2fe;
    --purple: #9333ea;
    --purple-rgb: 147, 51, 234;
    --purple-soft: #f3e8ff;
    --purple-text: #6b21a8;
    --purple-border: #e9d5ff;

    /* Theme Surfaces & Backgrounds - Light */
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --surface-hover: #f1f5f9;
    --bg: #f8fafc;
    --bg-strong: #eef2f6;
    --bg-gradient: radial-gradient(ellipse at 15% 5%, rgba(var(--primary-rgb), 0.06), transparent 40%),
        radial-gradient(ellipse at 85% 80%, rgba(20, 184, 166, 0.04), transparent 35%),
        linear-gradient(180deg, #f8fafc 0%, #f0f4ff 100%);
    --card-bg: #ffffff;
    --card-border: rgba(148, 163, 184, 0.18);
    --topbar-bg: rgba(255, 255, 255, 0.90);
    --topbar-border: rgba(148, 163, 184, 0.16);
    --modal-bg: #ffffff;
    --dropdown-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --sidebar-bg: #ffffff;
    --sidebar-bg-2: #f8fafc;
    --table-hover-bg: rgba(var(--primary-rgb), 0.03);
    --table-header-bg: #f8fafc;

    /* Typography & Content Colors - Light */
    --text: #0f172a;
    --text-heading: #0f172a;
    --text-soft: #334155;
    --muted: #64748b;
    --border: rgba(148, 163, 184, 0.22);
    --border-subtle: rgba(148, 163, 184, 0.14);
    --surface-card: #ffffff;

    /* Shadows - Light */
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.06);
    --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
    --shadow-card-hover: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-dropdown: 0 16px 36px -4px rgba(15, 23, 42, 0.12), 0 6px 12px -2px rgba(15, 23, 42, 0.06);

    /* Radii & Layout Tokens */
    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --topbar-height: 60px;

    /* Compatibility Aliases */
    --text-main: var(--text);
    --text-muted: var(--muted);
    --border-color: var(--border);
    --page: var(--bg);
    --line: var(--border);
    --ink: var(--text);
    --soft-text: var(--text-soft);
    --green: var(--success);
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.07);


    /* Extended Semantic Tokens */
    --text-disabled: #94a3b8;
    --surface-elevated: #ffffff;
    --divider: rgba(148, 163, 184, 0.18);
    --focus-ring: 0 0 0 3px var(--primary-glow);
    --input-focus-border: var(--primary);
    --input-placeholder: #94a3b8;
    --btn-disabled-bg: #e2e8f0;
    --btn-disabled-text: #94a3b8;
    --btn-disabled-border: #e2e8f0;
    --icon-default: #64748b;
    --icon-active: var(--primary);
    --icon-hover: var(--text);
    --icon-disabled: #cbd5e1;
    --link-color: var(--primary);
    --link-hover: var(--primary-strong);
    --badge-font-size: 0.72rem;
    --badge-font-weight: 600;
    --badge-radius: 6px;
    --label-font-size: 0.78rem;
    --label-font-weight: 600;
    --label-color: var(--text-soft);


    /* Missing Variable Definitions */
    --brand-primary: var(--primary);
    --brand-gradient: linear-gradient(135deg, var(--primary), var(--primary-strong));
    --primary-dark: var(--primary-strong);
    --font-mono: 'Courier New', Consolas, monospace;
    --shadow-hover: 0 10px 30px rgba(15, 23, 42, 0.12);
    --success-rgb: 22, 163, 74;

    /* Animation tokens */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 0.15s;
    --duration-normal: 0.25s;
    --duration-slow: 0.4s;
}

/* Per-color dark palette overrides → handled by assets/css/themes/dark-*.css */

/* ===== Keyframe Animations ===== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 var(--primary-glow);
    }

    50% {
        box-shadow: 0 0 0 8px transparent;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility animation classes */
.animate-fade-in {
    animation: fadeIn 0.4s var(--ease-smooth) both;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s var(--ease-smooth) both;
}

.animate-slide-down {
    animation: slideDown 0.35s var(--ease-smooth) both;
}

.animate-scale-in {
    animation: scaleIn 0.3s var(--ease-spring) both;
}

.animate-delay-1 {
    animation-delay: 0.05s;
}

.animate-delay-2 {
    animation-delay: 0.1s;
}

.animate-delay-3 {
    animation-delay: 0.15s;
}

.animate-delay-4 {
    animation-delay: 0.2s;
}

.animate-delay-5 {
    animation-delay: 0.25s;
}

.animate-delay-6 {
    animation-delay: 0.3s;
}

.animate-delay-7 {
    animation-delay: 0.35s;
}

.animate-delay-8 {
    animation-delay: 0.4s;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg-gradient);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.25s ease, color 0.2s ease;
}

body {
    line-height: 1.55;
    letter-spacing: -0.01em;
}

img {
    max-width: 100%;
    display: block;
}

/* Table responsiveness fixes: ensure DataTables and large tables scroll instead of overflowing layout */
.table-responsive,
.ticket-table-wrap {
    overflow-x: auto !important;
    max-width: 100%;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
    color: var(--text);
}

.table th,
.table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    vertical-align: middle;
}

@media (max-width: 900px) {

    .table th,
    .table td {
        white-space: normal;
        word-break: break-word;
        max-width: 100%;
    }
}

p,
span,
div,
input,
textarea,
select,
button,
label,
td,
th,
a {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Unified Modern Headings System */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.025em;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
}

h1,
.h1 {
    font-size: clamp(1.6rem, 1.8vw, 2.1rem);
    letter-spacing: -0.03em;
    font-weight: 700;
}

h2,
.h2 {
    font-size: clamp(1.35rem, 1.5vw, 1.7rem);
    letter-spacing: -0.025em;
    font-weight: 700;
}

h3,
.h3 {
    font-size: clamp(1.15rem, 1.3vw, 1.4rem);
    letter-spacing: -0.02em;
    font-weight: 600;
}

h4,
.h4 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}

h5,
.h5 {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h6,
.h6 {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0;
}

/* Text Hierarchy */
p {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-soft);
    margin-bottom: 0.75rem;
}

/* Form Labels Standards */
label,
.form-label {
    font-size: 0.775rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    color: var(--text) !important;
    margin-bottom: 0.35rem;
    display: inline-block;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-strong);
}

.app-body {
    background:
        radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.12), transparent 24%),
        radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.12), transparent 22%),
        var(--bg-gradient);
    color: var(--text);
}

.app-shell {
    display: flex;
    min-height: 100vh;
    background: transparent;
}

.main-panel {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
}

.content-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 1rem 1.5rem;
    min-height: calc(100vh - 72px);
    width: 100%;
}

.modern-page-shell {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.content-wrapper>.container-fluid,
.content-wrapper>.row,
.content-wrapper>.container {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.page-header,
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.2rem 0;
}

.page-header h1,
.page-header h2,
.page-header h3,
.section-header h2,
.section-header h3 {
    font-size: clamp(1.4rem, 2vw, 2rem);
    letter-spacing: -0.05em;
}

.card,
.card-body,
.table-responsive,
.list-group,
.modal-content,
.form-control,
.form-select,
.form-check-input,
.input-group,
.dropdown-menu {
    transition: box-shadow var(--duration-normal) var(--ease-smooth),
        border-color var(--duration-normal) var(--ease-smooth),
        transform var(--duration-normal) var(--ease-smooth);
}

.card {
    background: var(--input-bg);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px);
    animation: fadeInUp 0.45s var(--ease-smooth) both;
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary-border);
}

.card-header {
    background: rgba(248, 250, 252, 0.5);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    color: var(--text);
    padding: 1rem 1.25rem;
    font-weight: 700;
    border-radius: 1rem 1rem 0 0;
}

.card-body {
    padding: 1.25rem;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    width: 100%;
    max-width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    table-layout: auto;
}

.table thead th {
    background: var(--table-header-bg);
    color: var(--text-soft);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.7rem 0.85rem;
    vertical-align: middle;
}

.table tbody td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    vertical-align: middle;
    color: var(--text);
    font-size: 0.87rem;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 220px;
}

.table tbody tr {
    transition: background var(--duration-fast) ease;
}

.table tbody tr:hover {
    background: var(--table-hover-bg);
}

.btn {
    border-radius: 0.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: all var(--duration-normal) var(--ease-smooth);
    box-shadow: none;
    padding: 0.55rem 0.9rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    border-color: transparent;
    box-shadow: 0 12px 22px rgba(var(--primary-rgb), 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-strong) 0%, var(--primary) 100%);
}

.btn-success {
    background: var(--success);
    border-color: transparent;
}

.btn-outline-secondary {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(148, 163, 184, 0.2);
}

.form-control,
.form-select,
.input-group-text {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.65rem;
    background: var(--input-bg);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    min-height: 2.5rem;
    transition: border-color var(--duration-normal) var(--ease-smooth),
        box-shadow var(--duration-normal) var(--ease-smooth),
        background var(--duration-normal) var(--ease-smooth);
}

.indent-form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5.5 7.5L10 12l4.5-4.5' stroke='%236b7280' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 0.9rem;
    padding-right: 2.5rem;
    border: 1px solid var(--primary-border);
    background-color: var(--input-bg);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.04);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--surface);
}

.indent-form-select:focus {
    border-color: rgba(var(--primary-rgb), 0.7);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-rgb), 0.12);
}

.input-group-text {
    background: var(--primary-soft);
    color: var(--text-soft);
    font-weight: 600;
}

.badge {
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.alert {
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
    animation: slideDown 0.35s var(--ease-smooth) both;
}

.modal-content {
    background-color: var(--modal-bg, #ffffff) !important;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 1.25rem;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16), 0 8px 16px rgba(15, 23, 42, 0.08);
    overflow: visible;
    animation: scaleIn 0.25s var(--ease-spring) both;
}

.modal-header,
.modal-footer {
    border-color: rgba(148, 163, 184, 0.1);
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-dialog-scrollable .modal-content {
    overflow: visible;
}

.modal-dialog-scrollable .modal-body {
    max-height: 75vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-backdrop.show {
    backdrop-filter: blur(4px);
}

.dropdown-menu {
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 0.85rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
    padding: 0.4rem;
    animation: slideDown 0.2s var(--ease-smooth) both;
}

.dropdown-item {
    border-radius: 0.55rem;
    padding: 0.5rem 0.75rem;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.dropdown-item:hover {
    background: var(--primary-soft);
}

.action-panel,
.metric-card,
.stat-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem 0.9rem 1.5rem;
    }

    .page-header,
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {

    .card-body,
    .modal-body {
        padding: 0.9rem;
    }

    .table thead th,
    .table tbody td {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }
}

.permission-toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.permission-toggle-option {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.permission-toggle-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.permission-toggle-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: var(--surface);
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    transition: all 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.permission-toggle-option span::before {
    content: "\f0c8";
    font-family: "Font Awesome 6 Free";
    font-weight: 400;
    margin-right: 8px;
    font-size: 0.82rem;
    opacity: 0.55;
    flex-shrink: 0;
}

.permission-toggle-option:hover span {
    border-color: rgba(var(--primary-rgb), 0.34);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.08);
}

.permission-toggle-option input:checked+span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.22);
}

.permission-toggle-option input:checked+span::before {
    content: "\f14a";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    opacity: 1;
    color: #fff;
}

.permission-toggle-option input:focus-visible+span {
    outline: 3px solid rgba(var(--primary-rgb), 0.2);
    outline-offset: 2px;
}

@media (max-width: 576px) {
    .permission-toggle-grid {
        grid-template-columns: 1fr;
    }
}

.auth-main {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.16), transparent 24%),
        radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.13), transparent 22%),
        linear-gradient(180deg, var(--surface) 0%, var(--primary-soft) 100%);
}

.login-box {
    width: min(100%, 470px);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.login-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 22px 40px rgba(var(--primary-rgb), 0.28);
}

/* Layout Shell & Main Panel */
.app-shell {
    display: flex;
    min-height: 100vh;
    background: transparent;
    width: 100%;
}

.main-panel {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    flex-direction: column;
    background: transparent;
    overflow-x: hidden;
}

.topbar {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1040;
    background: var(--topbar-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--topbar-border);
    padding: 0.65rem 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.content-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 2rem;
    min-height: calc(100vh - 65px);
    width: 100%;
    flex: 1 1 auto;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 0.85rem 0.85rem 1.5rem;
    }

    .topbar {
        padding: 0.5rem 0.85rem;
    }
}

/* Dashboard specific tweaks for clearer tables and spacing */
.dashboard-card .table {
    margin-bottom: 0;
}

.dashboard-card .table th,
.dashboard-card .table td {
    padding: 10px 12px;
    vertical-align: middle;
    font-size: 0.95rem;
}

.dashboard-card .table thead th {
    font-weight: 800;
    color: var(--text-soft);
    font-size: 0.85rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 18px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: var(--shadow-card);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
}

.stat-card .icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-strong);
    background: linear-gradient(135deg, var(--primary-soft), var(--primary-border));
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.stat-card h3 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.08;
    color: var(--text);
    letter-spacing: -0.05em;
}

.stat-card p {
    margin: 5px 0 0;
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.btn,
button.btn,
[type="submit"].btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 40px;
    width: auto;
    max-width: 100%;
    white-space: nowrap;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 700;
    padding: 0.65rem 1.1rem;
    font-size: 0.84rem;
    letter-spacing: -0.01em;
    line-height: 1.2;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
    flex-shrink: 0;
}

.btn-sm,
button.btn-sm,
[type="button"].btn-sm,
[type="submit"].btn-sm {
    min-height: 32px !important;
    padding: 0.35rem 0.75rem !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
}

.btn-xs,
button.btn-xs {
    min-height: 26px !important;
    padding: 0.2rem 0.5rem !important;
    font-size: 0.72rem !important;
    border-radius: 6px !important;
}

.btn-close,
button.btn-close {
    min-height: auto !important;
    width: 1em !important;
    height: 1em !important;
    padding: 0.25em !important;
    box-shadow: none !important;
    border: 0 !important;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.btn-close:hover {
    opacity: 1;
    transform: none !important;
}

.btn>*,
button>* {
    pointer-events: none;
}

.btn:not(.btn-close):hover,
[type="submit"]:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

.btn:focus-visible,
button.btn:focus-visible,
[type="submit"]:focus-visible {
    outline: 3px solid rgba(var(--primary-rgb), 0.18);
    outline-offset: 2px;
}

.btn-primary,
button.btn-primary,
[type="submit"].btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 22px rgba(var(--primary-rgb), 0.2);
}

.btn-primary:hover,
button.btn-primary:hover,
[type="submit"].btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-strong), var(--primary));
    color: #fff;
}

/* Normalize other page-specific primary button classes to match the global primary styling */
.btn-primary-action,
.btn-primary-pill,
.ny-btn-primary,
.custom-action-btn,
.btn-primary-action:link,
.btn-primary-action:visited {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong)) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 12px 22px rgba(var(--primary-rgb), 0.18) !important;
    text-decoration: none !important;
}

.btn-primary-action:hover,
.btn-primary-pill:hover,
.ny-btn-primary:hover,
.custom-action-btn:hover {
    background: linear-gradient(135deg, var(--primary-strong), var(--primary)) !important;
    transform: translateY(-1px) !important;
    color: #fff !important;
}

.btn-secondary,
button.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 18px rgba(20, 184, 166, 0.18);
}

.btn-secondary:hover,
button.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary), var(--secondary));
    color: #fff;
}

.btn-success,
button.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 18px rgba(34, 197, 94, 0.18);
}

.btn-success:hover,
button.btn-success:hover {
    background: linear-gradient(135deg, var(--success), var(--success));
    color: #fff;
}

.btn-danger,
button.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 18px rgba(239, 68, 68, 0.18);
}

.btn-danger:hover,
button.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger), var(--danger));
    color: #fff;
}

.btn-outline-primary,
button.btn-outline-primary {
    border-color: rgba(var(--primary-rgb), 0.22);
    background: var(--surface);
    color: var(--primary);
}

.btn-outline-primary:hover,
button.btn-outline-primary:hover {
    background: rgba(var(--primary-rgb), 0.06);
    border-color: rgba(var(--primary-rgb), 0.28);
    color: var(--primary);
}

.btn-outline-secondary,
button.btn-outline-secondary {
    border-color: rgba(20, 184, 166, 0.22);
    background: var(--surface);
    color: var(--secondary);
}

.btn-outline-secondary:hover,
button.btn-outline-secondary:hover {
    background: rgba(20, 184, 166, 0.06);
    color: var(--secondary);
}

.btn-light,
button.btn-light {
    background: var(--surface);
    border-color: rgba(148, 163, 184, 0.28);
    color: var(--text-soft);
}

.btn-light:hover,
button.btn-light:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.btn-sm {
    padding: 0.52rem 0.8rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.95rem 1.35rem;
    font-size: 0.92rem;
}

.btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--primary);
    box-shadow: none;
}

.btn-link:hover {
    background: transparent;
    color: var(--primary-strong);
    text-decoration: underline;
}

.form-control,
.form-select,
textarea {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 0.85rem 0.95rem;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
    font-size: 0.95rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: rgba(var(--primary-rgb), 0.44);
    box-shadow: 0 0 0 0.22rem rgba(var(--primary-rgb), 0.12);
}

.label,
.form-label {
    display: block;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.55rem;
}

.table {
    margin: 0;
}

.table thead th {
    background: var(--table-header-bg);
    color: var(--text-soft);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    padding: 0.9rem 1rem;
    font-weight: 800;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    vertical-align: middle;
    color: var(--text);
    font-size: 0.95rem;
}

.table tbody tr:hover {
    background: rgba(var(--primary-rgb), 0.02);
}

.customer-page-shell {
    width: 100%;
    min-height: 100%;
}

.customer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 18px;
    padding: 0;
}

.page-search-field,
.customer-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 420px);
    height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.page-search-field i,
.customer-search-field i {
    color: var(--muted);
    font-size: 13px;
}

.page-search-field input,
.customer-search-field input {
    border: none;
    background: transparent;
    color: var(--text);
    width: 100%;
    font-size: 13px;
    outline: none;
    box-shadow: none;
}

/* =========================================================================
   CUSTOMERS & PATIENTS DIRECTORY STYLES
   ========================================================================= */
.customer-page-shell {
    min-height: calc(100vh - 70px);
}

#customerCardGrid {
    display: flex;
    flex-wrap: wrap;
}

#customerCardGrid.d-none {
    display: none !important;
}

#customerTableViewContainer.d-none {
    display: none !important;
}

#customersPaginationWrap.d-none {
    display: none !important;
}

.customer-card-item {
    display: flex !important;
    flex-direction: column !important;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.customer-card {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-height: 175px !important;
    width: 100% !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    background: #ffffff !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.customer-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

.customer-card .badge {
    font-weight: 500;
    line-height: 1.35;
}

.customer-table-row {
    transition: background-color 0.15s ease;
}

.customer-table-row:hover {
    background-color: rgba(248, 250, 252, 0.8) !important;
}

.badge-source {
    font-size: 0.65rem;
    padding: 0.2rem 0.45rem;
}

.mw-180 {
    max-width: 180px;
}

.mw-160 {
    max-width: 160px;
}

.mw-150 {
    max-width: 150px;
}

.mw-140 {
    max-width: 140px;
}

.mw-100 {
    max-width: 100px;
}

.col-hidden {
    display: none !important;
}

.table-compact th,
.table-compact td {
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
    font-size: 0.775rem !important;
}

.table-compact .badge {
    font-size: 0.65rem !important;
    padding: 0.15rem 0.35rem !important;
}

.table-compact .rounded-circle {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.7rem !important;
}

.table-compact .btn-xs {
    padding: 0.15rem 0.35rem !important;
    font-size: 0.68rem !important;
}

#batchActionBar {
    border-left: 4px solid #4f46e5 !important;
}

#customersPaginationWrap {
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.customer-details-modal .modal-content {
    border-radius: 18px;
}

.customer-detail-summary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.customer-detail-box {
    background: var(--surface-alt);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.customer-detail-box span {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.customer-detail-box strong {
    font-size: 1.2rem;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--text);
}

.customer-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.customer-detail-panel {
    background: var(--surface-alt);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    padding: 14px;
}

.customer-detail-panel h6 {
    margin: 0 0 12px;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text);
}

.customer-detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.customer-detail-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 10px;
}

.customer-detail-list li span {
    color: var(--text-soft);
    font-size: 0.75rem;
    font-weight: 700;
}

.customer-detail-list li strong {
    color: var(--text);
    font-size: 0.8rem;
    text-align: right;
}

.ticket-detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ticket-detail-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 10px;
}

.ticket-detail-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.ticket-detail-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.ticket-detail-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.42rem 0.7rem;
    border-radius: 8px;
    background: rgba(var(--primary-rgb), 0.06);
    border: 1px solid rgba(var(--primary-rgb), 0.16);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 800;
    text-decoration: none;
}

.ticket-detail-action i {
    font-size: 0.68rem;
}

.ticket-pill {
    display: inline-flex;
    width: fit-content;
    padding: 0.28rem 0.5rem;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.ticket-detail-copy strong {
    color: var(--text);
    font-size: 0.8rem;
    line-height: 1.4;
}

.ticket-detail-copy small {
    color: var(--text-soft);
    font-size: 0.72rem;
}

.ticket-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: fit-content;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.status-open {
    background: var(--primary-soft);
    color: var(--info);
}

.status-pending,
.status-in_progress,
.status-on_hold {
    background: rgba(245, 158, 11, 0.12);
    color: var(--amber);
}

.status-resolved,
.status-closed {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.empty-state {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.8rem;
}

.customer-card.hidden {
    display: none;
}

.customer-empty-state {
    display: none;
    padding: 18px 16px;
    margin-bottom: 16px;
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px dashed rgba(148, 163, 184, 0.28);
    color: var(--text-soft);
    font-weight: 700;
    text-align: center;
}

@media (max-width: 680px) {

    .customer-detail-summary-row,
    .customer-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .customer-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .customer-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .customer-search-field {
        width: 100%;
    }

    .customer-card-grid {
        grid-template-columns: 1fr;
    }
}

.ticket-list-page {
    width: 100%;
    padding: 0 0 18px;
}

.ticket-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 14px;
    padding: 0 4px;
}

.ticket-page-header h1 {
    font-size: clamp(1.7rem, 2vw, 2.2rem);
    margin: 0;
    color: var(--text);
    letter-spacing: -0.05em;
}

.ticket-table-shell {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.ticket-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--surface);
    box-sizing: border-box;
}

.ticket-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.merge-control-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 4px;
}

.bulk-ticket-actions {
    display: block;
    width: 100%;
    margin: 0;
}

.merge-selected-btn {
    min-width: 160px;
    font-weight: 800;
    border: none;
    background: var(--amber);
    color: #fff;
    box-shadow: 0 10px 18px rgba(245, 158, 11, 0.2);
}

.merge-selected-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.merge-selected-btn.is-enabled {
    background: var(--amber);
}

.merge-selected-count {
    font-size: 12px;
    line-height: 1.2;
    color: var(--text-soft);
    font-weight: 700;
    white-space: nowrap;
}

.table-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    max-width: 320px;
    flex: 1;
    padding: 0.72rem 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    background: var(--surface-alt);
    color: var(--text-soft);
}

.table-search-field i {
    font-size: 12px;
    color: var(--muted);
}

.table-search-field input {
    border: none;
    background: transparent;
    color: var(--text);
    width: 100%;
    font-size: 13px;
    outline: none;
    box-shadow: none;
}

.table-filter-select {
    min-width: 150px;
    padding: 0.72rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: var(--surface);
    color: var(--text-soft);
    font-size: 13px;
    outline: none;
}

.ticket-table-caption {
    padding: 14px 18px 0;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 600;
}

.ticket-table-wrap {
    padding: 10px 0 0;
}

.ticket-data-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: separate;
    border-spacing: 0;
}

.ticket-data-table thead th {
    background: var(--surface-alt);
    color: var(--text-soft);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    font-weight: 800;
}

.ticket-data-table tbody td {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    color: var(--text);
    font-size: 14px;
    vertical-align: middle;
}

.checkbox-column {
    width: 34px;
    text-align: center;
}

.checkbox-column input {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.ticket-id-cell a,
.customer-name,
.ticket-subject {
    font-weight: 700;
    color: var(--text);
}

.ticket-id-cell a {
    color: var(--primary);
    text-decoration: none;
}

.subject-cell,
.customer-cell {
    min-width: 180px;
}

.ticket-subject {
    display: block;
    margin-bottom: 4px;
}

.subject-cell small,
.customer-cell small {
    color: var(--muted);
    font-size: 11px;
}

.customer-name {
    margin-bottom: 4px;
}

.action-cell {
    width: 80px;
    text-align: center;
}

.action-eye {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
}

.action-eye:hover {
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.dataTables_wrapper .dataTables_paginate {
    padding: 0;
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: none;
    border-radius: 8px;
    background: var(--surface-alt);
    color: var(--text-soft);
    padding: 0.45rem 0.8rem;
    margin: 0;
    font-size: 12px;
    line-height: 1;
    box-shadow: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary);
    border: none;
    color: #fff;
    box-shadow: none;
}

.dataTables_info {
    display: none;
}

.ticket-table-wrap .dataTables_filter {
    display: none;
}

.ticket-table-wrap .dataTables_length {
    display: none;
}

.ticket-data-table tbody tr td:first-child,
.ticket-data-table thead th:first-child {
    padding-left: 18px;
}

.ticket-data-table thead th:last-child,
.ticket-data-table tbody td:last-child {
    padding-right: 18px;
}

.ticket-data-table .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 0.44rem 0.7rem;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0;
    font-weight: 800;
}

@media (max-width: 900px) {
    .ticket-table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ticket-toolbar-left {
        width: 100%;
    }

    .table-search-field {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}

.ticket-body {
    background: var(--table-header-bg);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: 18px;
    padding: 18px;
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.reply-box {
    border-left: 4px solid var(--primary);
    background: var(--table-header-bg);
    padding: 14px 16px;
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.03);
}

.badge {
    border-radius: 999px;
    padding: 0.46rem 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
}

.list-group-item {
    border-color: rgba(148, 163, 184, 0.14);
    padding: 1rem 1.1rem;
}

.list-group-item-action:hover {
    background: var(--table-header-bg);
}

.alert {
    border-radius: 14px;
    border: none;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
    font-weight: 600;
}

.ticket-view-page {
    padding: 0;
    width: 100%;
}

.ticket-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 4px 2px;
    color: var(--text);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-soft);
    text-decoration: none;
}

.back-link:hover {
    color: var(--primary);
}

.ticket-title-code {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.ticket-view-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: start;
}

.ticket-side-panel,
.ticket-right-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ticket-panel-block {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
    padding: 18px 18px 16px;
}

.panel-heading {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-label {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 800;
}

.detail-value {
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.5;
    font-weight: 600;
}

.subject-value {
    font-size: 1.02rem;
    font-weight: 700;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 600;
}

.mini-tag i {
    font-size: 0.52rem;
    color: var(--muted);
}

.customer-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-card-grid .customer-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 182px;
    padding: 18px 18px 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.02);
    gap: 0;
    align-items: stretch;
}

.customer-block .customer-card {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.customer-contact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    color: var(--text-soft);
    font-size: 0.8rem;
}

.customer-contact-label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.customer-contact-value {
    color: var(--text);
    font-weight: 600;
}

.customer-avatar,
.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.18);
}

.message-avatar.own {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.customer-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.customer-name {
    font-weight: 800;
    color: var(--text);
    font-size: 0.96rem;
}

.customer-email {
    color: var(--muted);
    font-size: 0.76rem;
}

.customer-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    color: var(--text-soft);
    font-size: 0.87rem;
}

.customer-stat-label {
    font-weight: 600;
}

.customer-stat-value {
    font-weight: 700;
    color: var(--text);
}

.sla-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--text-soft);
    font-size: 0.83rem;
}

.sla-label {
    color: var(--text-soft);
    font-weight: 700;
}

.sla-status {
    color: var(--info);
    font-weight: 700;
}

.sla-status.danger {
    color: var(--amber);
}

.sla-progress-block {
    margin-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    padding-top: 12px;
}

.time-left-label {
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 8px;
}

.progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg-strong);
    position: relative;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: inherit;
    background: var(--amber);
}

.time-left-value {
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--amber);
}

.ticket-center-panel {
    min-width: 0;
}

.conversation-card {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
    padding: 20px 18px 14px;
}

.conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.conversation-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.conversation-header span {
    color: var(--muted);
    font-size: 0.8rem;
}

.conversation-thread {
    position: relative;
    padding: 10px 0 0 12px;
    margin-bottom: 18px;
}

.conversation-thread::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 12px;
    width: 2px;
    background: rgba(148, 163, 184, 0.25);
}

.message-row {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 18px;
    padding-left: 22px;
}

.message-row.outgoing {
    justify-content: flex-end;
    padding-left: 0;
    padding-right: 22px;
}

.message-row.outgoing .message-bubble {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    border-color: transparent;
    color: #fff;
}

.message-row.outgoing .message-name,
.message-row.outgoing .message-time,
.message-row.outgoing .message-body {
    color: rgba(255, 255, 255, 0.94);
}

.message-bubble {
    max-width: 72%;
    background: var(--surface-alt);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px 16px 16px 4px;
    padding: 12px 14px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.02);
}

.message-row.outgoing .message-bubble {
    border-radius: 16px 16px 4px 16px;
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.message-name {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text);
}

.message-time {
    font-size: 0.7rem;
    color: var(--muted);
}

.message-body {
    color: var(--text);
    font-size: 0.93rem;
    line-height: 1.55;
    white-space: pre-line;
}

.ticket-attachments-panel {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 8px;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: inherit;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.attachment-item:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.28);
    text-decoration: none;
}

.attachment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    color: inherit;
    flex-shrink: 0;
}

.attachment-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.attachment-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: inherit;
    word-break: break-word;
}

.attachment-size {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.8);
}

.attachment-download {
    color: inherit;
    font-size: 0.9rem;
    opacity: 0.9;
}

.message-row.outgoing .ticket-attachments-panel,
.message-row.outgoing .attachment-item,
.message-row.outgoing .attachment-icon,
.message-row.outgoing .attachment-name,
.message-row.outgoing .attachment-size,
.message-row.outgoing .attachment-download {
    color: #fff;
}

.message-row.outgoing .attachment-item {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
}

.message-row.outgoing .attachment-icon {
    background: rgba(255, 255, 255, 0.14);
}

.message-row.outgoing .attachment-size {
    color: rgba(255, 255, 255, 0.8);
}

.system-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-left: 22px;
    margin-top: 10px;
}

.system-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--amber-soft);
    color: var(--amber);
    font-size: 0.8rem;
}

.system-card {
    background: var(--amber-soft);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 14px;
    padding: 10px 12px;
    max-width: 72%;
}

.system-title {
    font-size: 0.7rem;
    color: var(--amber);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.system-message {
    font-size: 0.9rem;
    color: var(--text-soft);
    line-height: 1.5;
}

.reply-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.reply-editor-shell {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
}

.reply-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--surface-alt);
}

.format-button {
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: var(--surface);
    color: var(--text-soft);
    font-weight: 700;
    border-radius: 8px;
    padding: 0.38rem 0.7rem;
    min-width: 42px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.format-button:hover {
    background: var(--primary-soft);
    border-color: rgba(var(--primary-rgb), 0.28);
    color: var(--primary);
}

.tool-button {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-soft);
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.58rem 0.9rem;
    cursor: pointer;
}

.tool-button.ghost {
    background: var(--primary-soft);
    border-color: rgba(var(--primary-rgb), 0.2);
    color: var(--primary);
}

.reply-form {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: var(--surface-alt);
    padding: 12px 12px 10px;
}

.reply-form textarea {
    width: 100%;
    border: none;
    background: transparent;
    resize: vertical;
    min-height: 110px;
    padding: 8px 4px 10px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
}

.reply-form textarea::placeholder {
    color: var(--muted);
}

.formatted-message {
    color: var(--text);
    line-height: 1.7;
}

.formatted-message p,
.formatted-message h4,
.formatted-message ul,
.formatted-message blockquote {
    margin: 0 0 0.8rem;
}

.formatted-message strong {
    font-weight: 800;
}

.formatted-message em {
    font-style: italic;
}

.formatted-message h4 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
}

.formatted-message ul {
    padding-left: 1.2rem;
    margin-bottom: 0.8rem;
}

.formatted-message blockquote {
    border-left: 3px solid rgba(var(--primary-rgb), 0.35);
    padding-left: 0.8rem;
    color: var(--text-soft);
}

.reply-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.attach-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-weight: 700;
    cursor: pointer;
}

#replyAttachmentsInput {
    display: none;
}

.send-button {
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    font-weight: 800;
    padding: 0.72rem 1rem;
    box-shadow: 0 12px 20px rgba(var(--primary-rgb), 0.22);
}

.control-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-label {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.field-select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    padding: 0.8rem 0.9rem;
    font-size: 0.93rem;
}

.save-button {
    width: 100%;
    margin-top: 4px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    font-weight: 800;
    padding: 0.8rem 1rem;
    box-shadow: 0 12px 22px rgba(var(--primary-rgb), 0.18);
}

.inline-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.secondary-button,
.danger-button {
    width: 100%;
    border-radius: 12px;
    padding: 0.72rem 0.9rem;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: var(--surface-alt);
    color: var(--text-soft);
}

.danger-button {
    background: var(--danger-soft);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--danger);
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.activity-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.activity-dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    display: inline-block;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.activity-dot.info {
    background: var(--info);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.activity-dot.warning {
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.activity-list strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text);
    margin-bottom: 2px;
}

.activity-list small {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.5;
}

.activity-time {
    display: block;
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 0.68rem;
    font-weight: 600;
}

.dataTables_wrapper {
    width: 100%;
    padding: 0;
}

.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    color: var(--text-soft);
    font-weight: 600;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    background: var(--surface);
    color: var(--text);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
    min-width: 220px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: rgba(var(--primary-rgb), 0.55);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.12);
    outline: none;
}

.dataTables_wrapper .dataTables_paginate {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin-top: 0.75rem;
}

.dataTables_wrapper .dataTables_paginate ul.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.dataTables_wrapper .dataTables_paginate .page-item,
.dataTables_wrapper .dataTables_paginate .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button {
    min-width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-soft) !important;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .previous .page-link,
.dataTables_wrapper .dataTables_paginate .next .page-link {
    min-width: 5.1rem;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.dataTables_wrapper .dataTables_paginate .page-link:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--surface-alt) !important;
    border-color: var(--input-border) !important;
    color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(var(--primary-rgb), 0.18);
}

.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    opacity: 0.55;
    cursor: not-allowed;
    background: var(--surface-alt) !important;
    border-color: var(--border) !important;
    color: var(--text-soft) !important;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 0.5rem 0.7rem;
    background: var(--surface);
    color: var(--text);
    min-width: 72px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    color: var(--text-soft);
    font-weight: 600;
}

.dataTables_wrapper .dataTables_info {
    display: flex;
    align-items: center;
    margin: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.75rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_paginate {
    padding-top: 0.25rem;
}

@media (max-width: 576px) {
    .dataTables_wrapper .dataTables_filter {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter label {
        display: block;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        min-width: 100%;
        margin-top: 0.5rem;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: left;
        justify-content: flex-start;
    }

    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
    }
}

@media (max-width: 992px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    }

    .content-wrapper {
        padding: 20px 16px 28px;
    }

    .topbar {
        padding: 16px 20px;
    }
}

@media (max-width: 576px) {
    .login-box {
        border-radius: 20px;
    }

    .card-body {
        padding: 18px;
    }

    .navbar-brand {
        font-size: 1.3rem !important;
    }

    .search-box {
        min-width: auto;
        width: 100%;
    }
}

/* HelpDesk Pro dashboard system */
:root {
    --ink: var(--text);
    --line: var(--border);
    --page: var(--bg);
    --sidebar: var(--sidebar-bg);
    --soft-text: var(--text-soft);
    --green: var(--success);
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
}

html,
body {
    background: var(--bg-gradient);
    font-family: Inter, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    letter-spacing: 0;
    font-size: 13px;
    line-height: 1.45;
}

.app-shell {
    background: transparent;
}

/* Sidebar styles are centrally defined in Section 2 (line 11294+) */

.main-panel {
    background: transparent;
}

.topbar {
    height: 60px;
    padding: 0 16px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    backdrop-filter: none;
}

.topbar-inner {
    height: 100%;
}

.navbar-brand {
    font-size: 16px !important;
    letter-spacing: -.02em;
}

.sidebar-toggle {
    width: 22px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
}

.sidebar-toggle:hover {
    background: transparent;
    box-shadow: none;
    color: var(--ink);
}

.topbar-actions {
    gap: 12px;
}

.search-box {
    min-width: 200px;
    height: 32px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--surface-alt);
    border-color: var(--border);
    box-shadow: none;
}

.search-box i {
    font-size: 13px;
}

.search-box input {
    font-size: 12px;
}

.icon-button {
    position: relative;
    width: 30px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.icon-button:hover {
    background: transparent;
}

.notification-button::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    top: 5px;
    right: 5px;
    background: var(--primary);
    border: 1px solid white;
    border-radius: 50%;
}

.profile-box {
    padding-left: 0;
}

.profile-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    box-shadow: none;
    font-size: 11px;
}

.profile-name {
    font-size: 12px;
}

.profile-text small {
    font-size: 10px;
    display: block;
    line-height: 1;
}

.content-wrapper {
    padding: var(--space-5);
}

.card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: none;
}

.card-header {
    min-height: 48px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.card-header h5,
.card-header h4 {
    font-size: 14px;
    letter-spacing: -.02em;
}

.card-body {
    padding: var(--space-4);
}

.btn {
    border-radius: 10px;
    padding: .65rem .9rem;
    font-size: 12px;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-strong), var(--primary));
}

.btn-outline-primary {
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.22);
}

.form-control,
.form-select,
textarea {
    border-radius: 7px;
    padding: .6rem .75rem;
    font-size: 13px;
}

.table thead th {
    padding: .7rem .9rem;
    font-size: 10px;
    letter-spacing: .07em;
}

.table tbody td {
    padding: .8rem .9rem;
    font-size: 13px;
}

.badge {
    padding: .25rem .5rem;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
}

.dashboard-page {
    display: grid;
    gap: var(--space-5);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
}

.stat-card {
    min-height: 110px;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--space-4);
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface) !important;
    box-shadow: none;
}

.stat-card:hover {
    transform: none;
    box-shadow: none;
}

.stat-card h3 {
    margin-top: 3px;
    font-size: 27px;
    line-height: 1.1;
    letter-spacing: -.05em;
}

.stat-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.stat-card .icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 8px;
    box-shadow: none;
    font-size: 17px;
}

.stat-indigo .icon {
    background: var(--primary-soft);
    color: var(--primary);
}

.stat-cyan .icon {
    background: var(--info-soft);
    color: var(--info);
}

.stat-green .icon {
    background: var(--success-soft);
    color: var(--success);
}

.stat-red .icon {
    background: var(--danger-soft);
    color: var(--danger);
}

.stat-orange .icon {
    background: var(--amber-soft);
    color: var(--amber);
}

.stat-purple .icon {
    background: var(--primary-soft);
    color: var(--primary);
}

.trend {
    display: block;
    margin-top: 9px;
    font-size: 10px;
    font-weight: 600;
}

.trend span {
    color: var(--muted);
    font-weight: 400;
}

.trend.up {
    color: var(--success);
}

.trend.down {
    color: var(--danger);
}

.trend.neutral {
    color: var(--muted);
    font-weight: 400;
}

.agent-panel-page {
    display: grid;
    gap: 22px;
}

.agent-summary-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.agent-summary-stats .stat-card {
    min-height: 112px;
    padding: 18px 20px;
}

.agent-summary-stats .stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    width: 100%;
}

.agent-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(260px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.agent-ticket-card {
    overflow: hidden;
    border-radius: 12px;
}

.agent-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 18px 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    min-height: 52px;
}

.agent-filter-btn {
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    padding: 10px 2px 12px;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    line-height: 1;
    transition: color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.agent-filter-btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 10px;
}

.agent-filter-btn.active {
    color: var(--primary);
    border-color: var(--primary);
}

.agent-ticket-list {
    display: flex;
    flex-direction: column;
}

.agent-ticket-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--border);
    min-height: 116px;
    width: 100%;
}

.agent-ticket-item:last-child {
    border-bottom: 0;
}

.ticket-main-info {
    flex: 1;
    min-width: 0;
}

.ticket-top-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ticket-code {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.ticket-priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.ticket-priority.medium {
    background: var(--amber-soft);
    color: var(--amber);
}

.ticket-priority.high {
    background: var(--danger-soft);
    color: var(--danger);
}

.ticket-priority.critical {
    background: var(--bg-strong);
    color: var(--text);
}

.agent-ticket-item h4 {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.45;
    letter-spacing: -0.03em;
    color: var(--text);
}

.ticket-meta {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.ticket-side-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    min-width: 118px;
    padding-left: 18px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.status-open {
    background: var(--success-soft);
    color: var(--success);
}

.status-pending {
    background: var(--amber-soft);
    color: var(--amber);
}

.status-progress {
    background: var(--info-soft);
    color: var(--info);
}

.open-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-soft);
}

.open-link i {
    font-size: 10px;
}

.team-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.team-card .card-body,
.quick-card .card-body {
    padding: 0;
}

.panel-header {
    min-height: 52px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.panel-header h5 {
    font-size: 14px;
    letter-spacing: -0.02em;
}

.team-member-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.team-member-row:last-child {
    border-bottom: 0;
}

.member-status-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: none;
    letter-spacing: 0;
}

.member-main-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.member-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    flex-shrink: 0;
}

.bg-primary-subtle.text-primary {
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
}

.bg-warning-subtle.text-warning {
    background: var(--amber-soft) !important;
    color: var(--amber) !important;
}

.bg-success-subtle.text-success {
    background: var(--success-soft) !important;
    color: var(--success) !important;
}

.member-info {
    min-width: 0;
}

.member-info strong {
    display: block;
    font-size: 12px;
    letter-spacing: -0.02em;
    color: var(--text);
}

.member-info small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}

.member-count-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    min-width: 42px;
}

.member-ticket-count {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.member-count-box small {
    font-size: 9px;
    color: var(--muted);
    line-height: 1;
}

.quick-actions {
    display: grid;
    gap: 10px;
    padding: 12px 16px 16px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
    padding: 10px 12px;
    cursor: pointer;
}

.quick-action-btn.secondary {
    color: var(--amber);
    border-color: rgba(245, 158, 11, 0.35);
    background: var(--amber-soft);
}

.quick-action-btn.tertiary {
    color: var(--text-soft);
}

.quick-action-btn:hover {
    border-color: rgba(var(--primary-rgb), 0.32);
    background: var(--primary-soft);
}

.dashboard-grid {
    display: grid;
    gap: 16px;
}

.dashboard-insights {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
}

.dashboard-bottom {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
}

.dashboard-page h5 {
    font-size: 13px;
}

.card-subtitle {
    margin: 3px 0 14px;
    color: var(--muted);
    font-size: 11px;
}

.chart-card .card-body {
    height: 320px;
}

.bar-chart {
    height: 205px;
    padding: 0 16px 0 44px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 18px;
    align-items: end;
    border-bottom: 1px dashed var(--border);
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 34px, var(--border) 35px, transparent 36px);
}

.bar-column {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    gap: 5px;
}

.bar-value {
    height: 170px;
    display: flex;
    align-items: end;
}

.bar-value span {
    width: 12px;
    min-height: 10px;
    display: block;
    border-radius: 4px 4px 0 0;
    background: var(--success);
}

.bar-column small {
    color: var(--muted);
    font-size: 10px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 13px;
    margin-top: 12px;
    color: var(--text-soft);
    font-size: 10px;
}

.chart-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 4px;
    background: var(--primary);
}

.chart-legend span+span i {
    background: var(--success);
}

.status-card .card-body {
    min-height: 320px;
}

.donut {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 26px auto 17px;
    border-radius: 50%;
}

.donut::after {
    content: '';
    position: absolute;
    inset: 35px;
    background: var(--surface);
    border-radius: 50%;
}

.status-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px 14px;
    color: var(--text-soft);
    font-size: 10px;
}

.status-legend i {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.dot-open {
    background: var(--primary);
}

.dot-progress {
    background: var(--info);
}

.dot-pending {
    background: var(--amber);
}

.dot-resolved {
    background: var(--success);
}

.dot-closed {
    background: var(--muted);
}

.recent-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.recent-card .card-header a {
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
}

.recent-ticket {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}

.recent-ticket:last-child {
    border-bottom: 0;
}

.recent-ticket span,
.recent-ticket small {
    display: block;
    font-size: 10px;
    color: #ffffff;
}

.recent-ticket strong {
    display: block;
    margin: 2px 0;
    font-size: 12px;
}

.ticket-state {
    display: flex;
    flex-direction: column;
    align-items: end;
    gap: 4px;
}

.quick-card .card-body {
    display: grid;
    gap: 10px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px;
    border-radius: 7px;
    color: var(--text-soft);
    background: var(--surface-alt);
    font-size: 12px;
    font-weight: 600;
}

.ticket-panel-block,
.conversation-card {
    background: var(--surface);
    border-color: var(--line);
    border-radius: 12px;
    box-shadow: none;
}

.ticket-view-layout {
    gap: 16px;
}

.ticket-topbar {
    margin-bottom: 14px;
}

.ticket-panel-block {
    padding: 16px;
}

.panel-heading,
.detail-label {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .08em;
}

.detail-value {
    font-size: 13px;
}

.message-bubble,
.reply-form {
    border-radius: 9px;
    box-shadow: none;
}

.message-bubble {
    background: var(--surface-alt);
}

.ticket-body {
    background: var(--surface-alt);
    border-color: var(--line);
    border-radius: 9px;
    box-shadow: none;
}

.reply-box {
    box-shadow: none;
    border-radius: 8px;
}

.tool-button,
.field-select,
.secondary-button,
.danger-button,
.save-button,
.send-button {
    border-radius: 7px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_length select {
    border-radius: 7px;
}

@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main-panel {
        width: 100%;
    }
}

@media (max-width: 992px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex-basis: auto;
        border-radius: 0;
    }

    .sidebar-nav {
        max-height: none;
    }

    .dashboard-insights,
    .dashboard-bottom {
        grid-template-columns: 1fr;
    }

    .content-wrapper {
        padding: 16px;
    }

    .topbar {
        padding: 14px 16px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 640px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .topbar {
        height: auto;
        min-height: 60px;
    }

    .search-box,
    .profile-text {
        display: none;
    }

    .content-wrapper {
        padding: 12px;
    }

    .dashboard-grid {
        gap: 12px;
    }

    .bar-chart {
        gap: 7px;
        padding-left: 20px;
    }

    .topbar-inner {
        gap: 10px;
        flex-wrap: wrap;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .navbar-brand {
        font-size: 1rem !important;
    }
}

.department-page {
    width: 100%;
}

.department-summary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.department-summary-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.department-summary-box span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.department-summary-box strong {
    font-size: 1.55rem;
    line-height: 1.1;
    letter-spacing: -0.05em;
    color: var(--text);
}

.department-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.department-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.department-search-field {
    width: min(100%, 280px);
}

.department-page-title h2 {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--text);
    margin: 0;
}

.department-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    padding: 0.8rem 1.15rem;
    font-size: 0.9rem;
    box-shadow: 0 12px 24px rgba(var(--primary-rgb), 0.2);
}

.department-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.department-card {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    padding: 18px 18px 14px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.department-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
}

.department-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.department-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--text-soft);
    background: var(--bg-strong);
}

.department-edit-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    color: var(--text-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.department-card-body {
    display: block;
}

.department-name-block {
    margin-bottom: 16px;
}

.department-name-block h3 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
    margin-bottom: 6px;
}

.department-name-block p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.5;
}

.department-description {
    margin-top: 8px !important;
    color: var(--muted) !important;
    font-size: 0.72rem !important;
    line-height: 1.55;
}

.department-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.metric-box {
    background: var(--surface-alt);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    padding: 12px 8px 10px;
    text-align: center;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.metric-icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    font-size: 10px;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 3px;
}

.metric-label {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.department-resolution {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.department-resolution span {
    font-size: 0.76rem;
    color: var(--text-soft);
    font-weight: 700;
}

.progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.department-resolution strong {
    font-size: 0.82rem;
    color: var(--text-soft);
    font-weight: 800;
}

.department-card-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.department-detail-btn {
    border-radius: 10px;
    min-height: 36px;
    padding: 0.6rem 0.9rem;
    font-size: 0.76rem;
    font-weight: 700;
}

.department-detail-summary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.department-detail-box {
    background: var(--surface-alt);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.department-detail-box span {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.department-detail-box strong {
    font-size: 1.6rem;
    line-height: 1.05;
    letter-spacing: -0.05em;
    color: var(--text);
}

.department-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.department-detail-panel {
    background: var(--surface-alt);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    padding: 14px;
}

.department-detail-panel h6 {
    margin: 0 0 12px;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text);
}

.department-detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.department-detail-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.member-detail-copy,
.ticket-detail-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.member-name,
.ticket-number {
    display: block;
    font-weight: 700;
    color: var(--text);
}

.member-role,
.ticket-subject,
.ticket-detail-copy small {
    display: block;
    font-size: 0.72rem;
    color: var(--text-soft);
}

.department-member-actions,
.department-ticket-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.member-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.5rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.member-status.active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.member-status.inactive {
    background: rgba(245, 158, 11, 0.12);
    color: var(--amber);
}

.department-detail-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.42rem 0.7rem;
    border-radius: 8px;
    background: rgba(var(--primary-rgb), 0.06);
    border: 1px solid rgba(var(--primary-rgb), 0.16);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 800;
    text-decoration: none;
}

.department-detail-action i {
    font-size: 0.68rem;
}

.ticket-list li {
    align-items: flex-start;
}

.ticket-subject {
    margin-top: 4px;
    line-height: 1.4;
}

.ticket-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.status-open {
    background: var(--primary-soft);
    color: var(--info);
}

.status-pending,
.status-in_progress,
.status-on_hold {
    background: rgba(245, 158, 11, 0.12);
    color: var(--amber);
}

.status-resolved,
.status-closed {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.empty-state {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-soft);
}

@media (max-width: 760px) {

    .department-detail-summary-row,
    .department-detail-grid {
        grid-template-columns: 1fr;
    }
}

.department-card-blue .progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--primary-strong));
}

.department-card-green .progress-fill {
    background: var(--secondary);
}

.department-card-amber .progress-fill {
    background: var(--amber);
}

.department-card-purple .progress-fill {
    background: var(--primary);
}

.department-card-teal .progress-fill {
    background: var(--success);
}

.department-card-rose .progress-fill {
    background: var(--danger);
}

.department-card-blue .department-icon {
    background: rgba(var(--primary-rgb), 0.10);
    color: var(--primary);
}

.department-card-green .department-icon {
    background: rgba(20, 184, 166, 0.10);
    color: var(--secondary);
}

.department-card-amber .department-icon {
    background: rgba(245, 158, 11, 0.10);
    color: var(--amber);
}

.department-card-purple .department-icon {
    background: rgba(139, 92, 246, 0.10);
    color: var(--primary);
}

.department-card-teal .department-icon {
    background: rgba(16, 185, 129, 0.10);
    color: var(--success);
}

.department-card-rose .department-icon {
    background: rgba(244, 63, 94, 0.10);
    color: var(--danger);
}

.department-alert {
    margin-bottom: 18px;
}

@media (max-width: 1100px) {
    .department-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .department-summary-row {
        grid-template-columns: 1fr;
    }

    .department-header {
        flex-direction: column;
        align-items: stretch;
    }

    .department-page-title h2 {
        font-size: 1.6rem;
    }

    .department-grid {
        grid-template-columns: 1fr;
    }
}

.agent-page {
    display: block;
}

.agent-page-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 0 4px;
    flex-wrap: wrap;
}

.agent-search-field {
    width: min(100%, 280px);
    flex: 1 1 220px;
}

.agent-filter-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    padding: 6px;
    border-radius: 14px;
    width: fit-content;
    max-width: 100%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.agent-filter-pill {
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    border-radius: 10px;
    padding: 8px 12px;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.agent-filter-pill:hover {
    color: var(--primary-strong);
    background: rgba(var(--primary-rgb), 0.06);
}

.agent-filter-pill.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #fff;
    box-shadow: 0 10px 18px rgba(var(--primary-rgb), 0.18);
}

.add-agent-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.7rem 1rem;
    font-weight: 700;
    font-size: 12px;
    border-radius: 10px;
}

.agent-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.agent-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 18px 16px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.agent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.agent-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.agent-personal {
    min-width: 0;
    flex: 1;
}

.agent-personal h4 {
    margin: 0;
    font-size: 15px;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.agent-email {
    font-size: 12px;
    color: var(--soft-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-role-block {
    margin-left: auto;
}

.badge.bg-soft-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.badge.bg-soft-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.agent-meta {
    font-size: 12px;
    color: var(--soft-text);
    padding: 0 0 16px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}

.agent-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.stat-box {
    background: var(--surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px 8px 10px;
    text-align: center;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(77, 96, 233, 0.08);
    color: var(--primary);
    font-size: 10px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.04em;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 10px;
    color: var(--soft-text);
}

.agent-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.agent-action-btn {
    flex: 1;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
}

.btn-success-soft {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.16);
    color: var(--success);
}

.btn-success-soft:hover {
    background: rgba(34, 197, 94, 0.18);
}

@media (max-width: 1100px) {
    .agent-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .agent-page-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .agent-filter-list {
        width: 100%;
    }

    .agent-card-grid {
        grid-template-columns: 1fr;
    }
}

.dataTables_filter {
    float: inline-end;
}

/* ============================================================================
   FIGMA-GRADE MODERN UI/UX ENHANCEMENTS
   ============================================================================ */

/* Surface & Card Elevation */
.figma-card {
    background-color: var(--surface);
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.figma-card:hover {
    border-color: var(--primary-border);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    transform: translateY(-2px);
}

/* Modern Pill Badges */
.badge-figma {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
}

.badge-figma-primary {
    background-color: var(--primary-soft);
    color: var(--primary-strong);
    border: 1px solid var(--primary-border);
}

.badge-figma-success {
    background-color: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-figma-warning {
    background-color: var(--amber-soft);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-figma-danger {
    background-color: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Modern Form Inputs */
.figma-input {
    width: 100%;
    padding: 0.6rem 0.95rem;
    font-size: 0.875rem;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background-color: var(--surface);
    color: var(--text);
    outline: none;
    transition: all 0.2s ease;
}

.figma-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Glass Header Panels */
.figma-header-panel {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 18px;
}

/* Smooth Table Row Enhancements */
.figma-table-row {
    transition: background-color 0.18s ease;
}

.figma-table-row:hover {
    background-color: var(--surface-alt) !important;
}

/* Primary Gradient Action Button */
.btn-figma-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #ffffff !important;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-figma-primary:hover {
    background: linear-gradient(135deg, var(--primary-strong) 0%, var(--primary) 100%);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.35);
    transform: translateY(-1px);
}

.btn-figma-primary:active {
    transform: scale(0.98);
}

/* ============================================================
   GLOBAL THEME SYSTEM & DARK MODE OVERRIDES
   ============================================================ */

/* Theme Toggle Button Styling */
.theme-toggle-btn {
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

/* Ticket ID Tag (Universal) */
.ticket-id-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
    font-size: 0.8rem;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    text-decoration: none;
    transition: all 0.15s ease;
}

.ticket-id-tag:hover {
    color: var(--primary-dark);
    filter: brightness(1.1);
}

/* User Status Indicator & Live Pulse Dot */
.user-status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--surface, #ffffff);
    background: #16a34a;
}

.user-status-indicator.active {
    background: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.35);
}

.user-status-indicator.inactive {
    background: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.35);
}

.status-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.35;
        transform: scale(0.85);
    }
}

/* ==========================================================================
   DEEP PROFESSIONAL 4-THEME COMPONENT ADAPTATIONS
   ========================================================================== */

/* Primary Buttons */
.btn-primary,
button.btn-primary,
input[type="submit"].btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px var(--primary-glow) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, var(--primary-strong) 0%, var(--primary) 100%) !important;
    border-color: var(--primary-strong) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px var(--primary-glow) !important;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px var(--primary-glow) !important;
}

/* Badges & Pills */
.badge-primary,
.badge.bg-primary,
.badge-soft-primary {
    background-color: var(--primary-soft) !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary-border) !important;
}

/* Form Controls Focus */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    outline: 0;
}

.form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Nav Pills & Active Tabs (Unified Pill Style) */
.nav-pills {
    gap: 0.4rem;
}

.nav-pills .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.825rem;
    font-weight: 600 !important;
    padding: 0.45rem 1.15rem !important;
    border-radius: 9999px !important;
    color: var(--text-soft, #475569) !important;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border-subtle, #e2e8f0) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.nav-pills .nav-link i,
.nav-pills .nav-link svg {
    color: var(--muted, #64748b);
    transition: color 0.18s ease;
}

.nav-pills .nav-link:hover {
    color: var(--text, #0f172a) !important;
    background: rgba(15, 23, 42, 0.04) !important;
    border-color: var(--border, #cbd5e1) !important;
}

.nav-pills .nav-link:hover i,
.nav-pills .nav-link:hover svg {
    color: var(--text, #0f172a);
}

.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    border-radius: 9999px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px -2px var(--primary-glow), 0 2px 6px -1px rgba(var(--primary-rgb), 0.3) !important;
}

.nav-pills .nav-link.active i,
.nav-pills .nav-link.active svg,
.nav-pills .nav-link.active span,
.nav-pills .nav-link.active .badge {
    color: #ffffff !important;
}

.nav-pills .nav-link.active .badge {
    background: rgba(255, 255, 255, 0.25) !important;
}

.nav-tabs {
    border-bottom: 2px solid var(--border-subtle, #e2e8f0);
    gap: 0.5rem;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.6rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    background: transparent;
    border-radius: 0;
    transition: all 0.18s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--text-heading, #0f172a);
    border-bottom-color: var(--border, #cbd5e1);
}

.nav-tabs .nav-link.active {
    color: var(--primary) !important;
    background: transparent !important;
    border-bottom: 2px solid var(--primary) !important;
    font-weight: 700 !important;
}

/* DataTables & Pagination */
.page-item.active .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px var(--primary-glow) !important;
}

/* Stepper & Milestone Indicators */
.step-item.active .step-circle,
.timeline-dot.active {
    background: var(--primary) !important;
    border-color: var(--surface) !important;
    box-shadow: 0 0 0 4px var(--primary-glow) !important;
}

/* Theme Customizer Swatch Interactions */
.theme-color-swatch {
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease !important;
}

.theme-color-swatch:hover {
    transform: scale(1.15) !important;
    filter: brightness(1.08);
}

.theme-mode-btn {
    transition: all 0.18s ease;
}

.theme-mode-btn.active {
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    font-weight: 700 !important;
}

/* Theme text & icon highlights */
.text-primary {
    color: var(--primary) !important;
}

.bg-primary-soft {
    background-color: var(--primary-soft) !important;
}

/* ==========================================================================
   UNIFIED TYPOGRAPHY SYSTEM
   Font: Plus Jakarta Sans (headings), Inter (body/UI)
   ========================================================================== */

body,
html {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
.h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.025em;
    color: var(--text);
}

h2,
.h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text);
}

h3,
.h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.015em;
    color: var(--text);
}

h4,
.h4 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--text);
}

h5,
.h5 {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}

h6,
.h6 {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-soft);
}

/* Body text variants */
.text-body,
p {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-soft);
}

.text-sm,
small {
    font-size: 0.78rem;
    line-height: 1.45;
}

.text-xs {
    font-size: 0.72rem;
    line-height: 1.4;
}

.text-lg {
    font-size: 1rem;
    line-height: 1.5;
}

/* Labels */
label,
.form-label {
    font-family: 'Inter', sans-serif;
    font-size: var(--label-font-size, 0.78rem);
    font-weight: var(--label-font-weight, 600);
    color: var(--label-color, var(--text-soft));
    letter-spacing: 0.01em;
}

/* Captions */
.caption,
figcaption {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.02em;
}

/* Buttons text */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

/* Navigation text */
.nav-link {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
}

/* Table text */
th {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

td {
    font-size: 0.82rem;
    color: var(--text-soft);
}

/* Badge text */
.badge {
    font-family: 'Inter', sans-serif;
    font-size: var(--badge-font-size, 0.72rem);
    font-weight: var(--badge-font-weight, 600);
    letter-spacing: 0.02em;
}

/* ==========================================================================
   COMPONENT STATE SYSTEM - Default/Hover/Focus/Active/Selected/Disabled/Error/Success
   ========================================================================== */

/* Disabled state - global */
.disabled,
[disabled],
:disabled {
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Focus state - global */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible {
    box-shadow: var(--focus-ring) !important;
    outline: none;
}

/* Form validation states */
.is-invalid,
.form-control.is-invalid {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.is-valid,
.form-control.is-valid {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12) !important;
}

.invalid-feedback {
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 4px;
}

.valid-feedback {
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 4px;
}

/* Link states */
a {
    color: var(--link-color, var(--primary));
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--link-hover, var(--primary-strong));
}

/* Selected row/item state */
.selected,
tr.selected,
.list-item.selected {
    background: var(--primary-soft) !important;
    border-color: var(--primary-border) !important;
}

/* ==========================================================================
   SPACING SYSTEM - Consistent 4px base grid
   ========================================================================== */

:root {
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
}

.content-wrapper {
    padding: var(--space-6) var(--space-6) var(--space-10);
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: var(--space-4) var(--space-3) var(--space-8);
    }
}

/* ==========================================================================
   UNIFIED DYNAMIC THEME SYSTEM - TABLES, BUTTONS, CARDS, LABELS & BADGES
   Ensures ALL components immediately adapt across Indigo, Emerald, Sapphire,
   Amethyst, Light & Dark modes without exception.
   ========================================================================== */

/* 1. Dynamic Primary Utility Classes (Tailwind & Bootstrap Overrides) */
.bg-indigo-600,
.bg-indigo-700,
.bg-indigo-500,
.bg-primary {
    background-color: var(--primary) !important;
}

.text-indigo-600,
.text-indigo-700,
.text-indigo-500,
.text-indigo-400,
.text-primary {
    color: var(--primary) !important;
}

.bg-indigo-50,
.bg-indigo-100,
.bg-primary-soft,
.bg-primary-subtle {
    background-color: var(--primary-soft) !important;
}

.border-indigo-200,
.border-indigo-300,
.border-indigo-500,
.border-indigo-600,
.border-primary {
    border-color: var(--primary-border) !important;
}

.hover\:bg-indigo-500:hover,
.hover\:bg-indigo-700:hover {
    background-color: var(--primary-strong) !important;
}

.focus\:border-indigo-500:focus,
.focus\:ring-indigo-500:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

.shadow-indigo-600\/30,
.shadow-indigo-500\/20 {
    box-shadow: 0 8px 20px -4px var(--primary-glow) !important;
}

/* 2. Unified Badges and Status Pills across all list views */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-decoration: none;
    box-shadow: none;
    transition: all 0.2s ease;
}

.badge.text-dark {
    color: inherit !important;
}

/* Global Dark Theme: Override .text-dark to crisp white */
[data-theme="dark"] .text-dark,
.dark .text-dark,
[data-theme="dark"] .text-dark-emphasis,
.dark .text-dark-emphasis,
[data-theme="dark"] .badge.text-dark,
.dark .badge.text-dark,
[data-theme="dark"] span.text-dark,
.dark span.text-dark,
[data-theme="dark"] div.text-dark,
.dark div.text-dark,
[data-theme="dark"] p.text-dark,
.dark p.text-dark,
[data-theme="dark"] strong.text-dark,
.dark strong.text-dark,
[data-theme="dark"] h1.text-dark,
[data-theme="dark"] h2.text-dark,
[data-theme="dark"] h3.text-dark,
[data-theme="dark"] h4.text-dark,
[data-theme="dark"] h5.text-dark,
[data-theme="dark"] h6.text-dark,
.dark h1.text-dark,
.dark h2.text-dark,
.dark h3.text-dark,
.dark h4.text-dark,
.dark h5.text-dark,
.dark h6.text-dark {
    color: #ffffff !important;
}

[data-theme="dark"] a.text-dark,
.dark a.text-dark {
    color: #ffffff !important;
}

[data-theme="dark"] a.text-dark:hover,
.dark a.text-dark:hover {
    color: var(--primary, #38bdf8) !important;
}

[data-theme="dark"] .text-slate-900,
[data-theme="dark"] .text-slate-800,
[data-theme="dark"] .text-slate-700,
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-gray-800,
.dark .text-slate-900,
.dark .text-slate-800,
.dark .text-slate-700,
.dark .text-gray-900,
.dark .text-gray-800 {
    color: #ffffff !important;
}

/* Open / Primary Badge */
.badge.bg-primary,
.badge-soft-primary,
.badge-primary {
    background-color: var(--primary-soft) !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary-border) !important;
}

/* Resolved / Closed / Success Badge */
.badge.bg-success,
.badge-soft-success,
.badge-success {
    background-color: var(--success-soft) !important;
    color: var(--success) !important;
    border: 1px solid rgba(22, 163, 74, 0.25) !important;
}

/* Pending / Medium / Warning Badge */
.badge.bg-warning,
.badge-soft-warning,
.badge-warning {
    background-color: var(--amber-soft) !important;
    color: var(--amber) !important;
    border: 1px solid rgba(217, 119, 6, 0.25) !important;
}

/* High / Danger Badge */
.badge.bg-danger,
.badge-soft-danger,
.badge-danger {
    background-color: var(--danger-soft) !important;
    color: var(--danger) !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

/* Critical Priority Badge */
.badge.bg-dark,
.badge-dark,
.badge-critical {
    background-color: rgba(239, 68, 68, 0.18) !important;
    color: var(--danger) !important;
    border: 1px solid var(--danger) !important;
    font-weight: 800 !important;
}

/* In Progress / Info Badge */
.badge.bg-info,
.badge-soft-info,
.badge-info {
    background-color: var(--info-soft) !important;
    color: var(--info) !important;
    border: 1px solid rgba(2, 132, 199, 0.25) !important;
}

/* Secondary / Light / Low / Unassigned Badge */
.badge.bg-secondary,
.badge.bg-light,
.badge-soft-secondary,
.badge-secondary,
.badge-light {
    background-color: var(--surface-hover) !important;
    color: var(--muted) !important;
    border: 1px solid var(--border) !important;
}

/* Solid High-Contrast Badges with White Text (Prevents white-on-white pastel collision) */
.badge.bg-primary.text-white,
.badge-solid-primary {
    background-color: var(--brand-primary, #4f46e5) !important;
    color: #ffffff !important;
    border: none !important;
}

.badge.bg-success.text-white,
.badge-solid-success {
    background-color: var(--success, #16a34a) !important;
    color: #ffffff !important;
    border: none !important;
}

.badge.bg-warning.text-white,
.badge-solid-warning {
    background-color: var(--amber, #d97706) !important;
    color: #ffffff !important;
    border: none !important;
}

.badge.bg-danger.text-white,
.badge-solid-danger {
    background-color: var(--danger, #dc2626) !important;
    color: #ffffff !important;
    border: none !important;
}

.badge.bg-info.text-white,
.badge-solid-info {
    background-color: var(--info, #0284c7) !important;
    color: #ffffff !important;
    border: none !important;
}

.badge.bg-secondary.text-white,
.badge-solid-secondary {
    background-color: #64748b !important;
    color: #ffffff !important;
    border: none !important;
}

.badge.bg-dark.text-white,
.badge-solid-dark {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border: none !important;
}

.badge.rounded-circle.bg-danger {
    background-color: var(--danger, #dc2626) !important;
}

.badge.rounded-circle.bg-primary {
    background-color: var(--brand-primary, #4f46e5) !important;
}

.badge.rounded-circle.bg-info {
    background-color: var(--info, #0284c7) !important;
}

.badge.rounded-circle.bg-success {
    background-color: var(--success, #16a34a) !important;
}

.badge.rounded-circle.bg-warning {
    background-color: var(--amber, #d97706) !important;
}

.badge.rounded-circle.bg-secondary {
    background-color: #64748b !important;
}

/* 3. Universal Table Styling */
.table,
.custom-table,
.custom-data-table,
.ticket-data-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    width: 100%;
    margin-bottom: 0;
    color: var(--text) !important;
    border-color: var(--border) !important;
    background-color: transparent !important;
}

.table thead th,
.custom-table th,
.custom-data-table thead th,
.ticket-data-table thead th {
    background-color: var(--table-header-bg) !important;
    color: var(--text-soft) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    border-top: none !important;
    padding: 0.85rem 1rem !important;
    vertical-align: middle !important;
}

.table tbody td,
.custom-table td,
.custom-data-table tbody td,
.ticket-data-table tbody td {
    padding: 0.95rem 1rem !important;
    border-bottom: 1px solid var(--border) !important;
    border-top: none !important;
    vertical-align: middle !important;
    color: var(--text) !important;
    font-size: 0.875rem !important;
    background-color: transparent !important;
}

.table tbody tr:hover,
.table-hover tbody tr:hover,
.custom-table tr:hover,
.custom-data-table tbody tr:hover,
.ticket-data-table tbody tr:hover,
.table tbody tr:hover td,
.table-hover tbody tr:hover td,
.custom-table tr:hover td,
.custom-data-table tbody tr:hover td {
    background-color: var(--table-hover-bg) !important;
}

/* 4. Universal Cards */
.card,
.table-card,
.dashboard-card,
.stat-card,
.filter-panel-card,
.glass-filter-card,
.figma-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    color: var(--text);
    box-shadow: var(--shadow-card) !important;
}

.card:hover,
.table-card:hover,
.dashboard-card:hover,
.stat-card:hover,
.figma-card:hover {
    border-color: var(--primary-border) !important;
}

.card-header {
    background-color: var(--surface-alt) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    color: var(--text) !important;
}

.card-footer {
    background-color: var(--surface-alt) !important;
    border-top: 1px solid var(--border-subtle) !important;
    color: var(--text-soft) !important;
}

/* 5. Universal Buttons */
.btn-primary,
button.btn-primary,
.btn-gradient-primary,
.btn-figma-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    border: 1px solid var(--primary-strong) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px var(--primary-glow) !important;
}

.btn-primary:hover,
button.btn-primary:hover,
.btn-gradient-primary:hover,
.btn-figma-primary:hover {
    background: linear-gradient(135deg, var(--primary-strong) 0%, var(--primary) 100%) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px var(--primary-glow) !important;
}

.btn-outline-primary,
button.btn-outline-primary {
    background: transparent !important;
    border: 1px solid var(--primary-border) !important;
    color: var(--primary) !important;
}

.btn-outline-primary:hover,
button.btn-outline-primary:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px var(--primary-glow) !important;
}

.btn-secondary,
.btn-outline-secondary,
.btn-light,
button.btn-light {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-soft) !important;
}

.btn-secondary:hover,
.btn-outline-secondary:hover,
.btn-light:hover,
button.btn-light:hover {
    background: var(--surface-hover) !important;
    border-color: var(--primary-border) !important;
    color: var(--text) !important;
}

/* 6. Form Controls and Labels */
.label,
.form-label,
label {
    color: var(--text, #1e293b) !important;
    font-weight: 600;
}

.form-control,
.form-select,
.custom-select,
.search-input,
.figma-input {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--text) !important;
}

.form-control:focus,
.form-select:focus,
.custom-select:focus,
.search-input:focus,
.figma-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    background-color: var(--input-bg) !important;
    color: var(--text) !important;
}

/* ==========================================================================
   Universal Checkbox-Button Component System (Requirement 4)
   Transforms checkboxes into button-style controls with clear icon indicators
   ========================================================================== */
.btn-checkbox,
.checkbox-btn,
.checkbox-button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 0.65rem;
    background: var(--surface);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-checkbox:hover,
.checkbox-btn:hover,
.checkbox-button:hover {
    border-color: var(--primary-border);
    background: var(--primary-soft);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-checkbox input[type="checkbox"],
.checkbox-btn input[type="checkbox"],
.checkbox-button input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.15rem;
    height: 1.15rem;
    border: 1.5px solid var(--border-subtle);
    border-radius: 0.35rem;
    outline: none;
    margin: 0;
    display: inline-grid;
    place-items: center;
    background: var(--bg);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.18s ease-in-out;
}

.btn-checkbox input[type="checkbox"]::before,
.checkbox-btn input[type="checkbox"]::before,
.checkbox-button input[type="checkbox"]::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.68rem;
    color: #ffffff;
    transform: scale(0);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-checkbox input[type="checkbox"]:checked,
.checkbox-btn input[type="checkbox"]:checked,
.checkbox-button input[type="checkbox"]:checked {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-checkbox input[type="checkbox"]:checked::before,
.checkbox-btn input[type="checkbox"]:checked::before,
.checkbox-button input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.btn-checkbox:has(input[type="checkbox"]:checked),
.checkbox-btn:has(input[type="checkbox"]:checked),
.checkbox-button:has(input[type="checkbox"]:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

/* Global Form Checkbox Button Style with Checked Icon (Excludes form-switch toggles) */
.form-check:not(.form-switch) .form-check-input[type="checkbox"],
input[type="checkbox"].ticket-select-checkbox,
#select-all-tickets,
.custom-table input[type="checkbox"],
.table input[type="checkbox"],
input[type="checkbox"].field-required {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    aspect-ratio: 1 / 1 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    align-self: center !important;
    border: 1.5px solid var(--border, #cbd5e1) !important;
    border-radius: 5px !important;
    outline: none !important;
    display: inline-grid !important;
    place-items: center !important;
    background: var(--surface, #ffffff) !important;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    vertical-align: middle;
    margin: 0 auto !important;
    position: relative;
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"]::before,
input[type="checkbox"].ticket-select-checkbox::before,
#select-all-tickets::before,
.custom-table input[type="checkbox"]::before,
.table input[type="checkbox"]::before,
input[type="checkbox"].field-required::before {
    content: "\f00c" !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 0.65rem !important;
    color: #ffffff !important;
    transform: scale(0) !important;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    line-height: 1 !important;
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"]:checked,
input[type="checkbox"].ticket-select-checkbox:checked,
#select-all-tickets:checked,
.custom-table input[type="checkbox"]:checked,
.table input[type="checkbox"]:checked,
input[type="checkbox"].field-required:checked {
    background-color: var(--primary, #0ea5e9) !important;
    border-color: var(--primary, #0ea5e9) !important;
    background-image: none !important;
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"]:checked::before,
input[type="checkbox"].ticket-select-checkbox:checked::before,
#select-all-tickets:checked::before,
.custom-table input[type="checkbox"]:checked::before,
.table input[type="checkbox"]:checked::before,
input[type="checkbox"].field-required:checked::before {
    transform: scale(1) !important;
}

.form-check-inline.btn-checkbox-wrap {
    margin-right: 0.5rem;
}

/* ==========================================================================
   Item Decision Segmented Button Groups (indents-approval.php)
   Replaces raw radio inputs with tactile, high-contrast decision buttons
   ========================================================================== */
.item-decision-group {
    display: inline-flex;
    align-items: center;
    background: var(--surface-alt);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--border);
    gap: 4px;
}

.item-decision-group input[type="radio"].btn-check,
.item-decision-group input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.item-decision-group .item-decision-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    border-radius: 6px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    user-select: none;
    line-height: 1.3;
    margin: 0;
}

/* Approve Button */
.item-decision-group .btn-decision-approve {
    color: #16a34a;
    background: transparent;
}

.item-decision-group .btn-decision-approve:hover {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.25);
}

.item-decision-group input[type="radio"]:checked+.btn-decision-approve {
    background: #16a34a !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
}

/* Hold Button */
.item-decision-group .btn-decision-hold {
    color: #d97706;
    background: transparent;
}

.item-decision-group .btn-decision-hold:hover {
    background: rgba(217, 119, 6, 0.12);
    border-color: rgba(217, 119, 6, 0.25);
}

.item-decision-group input[type="radio"]:checked+.btn-decision-hold {
    background: #d97706 !important;
    color: #ffffff !important;
    border-color: #d97706 !important;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35);
}

/* Reject Button */
.item-decision-group .btn-decision-reject {
    color: #dc2626;
    background: transparent;
}

.item-decision-group .btn-decision-reject:hover {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.25);
}

.item-decision-group input[type="radio"]:checked+.btn-decision-reject {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

/* ==========================================================================
   Horizontal Multi-Level Approval Pipeline Track System (view.php)
   Provides an ultra-compact, panoramic horizontal stage progression view
   ========================================================================== */
.horizontal-pipeline-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.h-pipeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.h-pipeline-scroll-wrap {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
    padding: 4px 2px 10px 2px;
    gap: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    -webkit-overflow-scrolling: touch;
}

.h-pipeline-scroll-wrap::-webkit-scrollbar {
    height: 6px;
}

.h-pipeline-scroll-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.h-pipeline-scroll-wrap::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

.h-pipeline-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.h-pipeline-step {
    min-width: 200px;
    max-width: 235px;
    flex: 0 0 215px;
    background: var(--surface-alt);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.h-pipeline-step:hover {
    border-color: var(--primary-border);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.h-pipeline-step.completed {
    border-color: rgba(22, 163, 74, 0.35);
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.04) 0%, var(--surface-alt) 100%);
}

.h-pipeline-step.active {
    border-color: var(--primary);
    background: linear-gradient(180deg, var(--primary-soft) 0%, var(--surface-alt) 100%);
    box-shadow: 0 0 0 2px var(--primary-soft), 0 4px 12px var(--primary-glow);
}

.h-pipeline-step.rejected {
    border-color: rgba(220, 38, 38, 0.35);
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.04) 0%, var(--surface-alt) 100%);
}

.h-pipeline-step.on-hold {
    border-color: rgba(217, 119, 6, 0.35);
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.04) 0%, var(--surface-alt) 100%);
}

.h-pipeline-step.pending {
    opacity: 0.82;
}

.h-pipeline-step-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.h-pipeline-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.h-pipeline-step.completed .h-pipeline-icon {
    background: #16a34a;
    color: #ffffff;
}

.h-pipeline-step.active .h-pipeline-icon {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 0 3px var(--primary-soft);
    animation: hPulse 2s infinite ease-in-out;
}

.h-pipeline-step.rejected .h-pipeline-icon {
    background: #dc2626;
    color: #ffffff;
}

.h-pipeline-step.on-hold .h-pipeline-icon {
    background: #d97706;
    color: #ffffff;
}

.h-pipeline-step.pending .h-pipeline-icon {
    background: var(--border);
    color: var(--muted);
}

@keyframes hPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.h-pipeline-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--muted);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h-pipeline-status {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    white-space: nowrap;
}

.h-pipeline-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h-pipeline-person {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h-pipeline-time {
    font-size: 0.68rem;
    color: var(--muted);
    font-family: var(--font-mono, monospace);
}

.h-pipeline-quote {
    margin-top: 5px;
    padding: 3px 6px;
    border-left: 2px solid var(--primary);
    background: var(--surface);
    font-size: 0.68rem;
    color: var(--text);
    border-radius: 0 4px 4px 0;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Horizontal Connector with Indicator Arrow */
.h-pipeline-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    position: relative;
}

.h-pipeline-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.h-pipeline-connector i {
    z-index: 2;
    background: var(--surface);
    padding: 2px 4px;
    border-radius: 999px;
    font-size: 0.65rem;
    color: var(--muted);
}

.h-pipeline-connector.completed .h-pipeline-line {
    background: #16a34a;
}

.h-pipeline-connector.completed i {
    color: #16a34a;
}

.h-pipeline-connector.active .h-pipeline-line {
    background: linear-gradient(90deg, #16a34a 0%, var(--primary) 100%);
}

.h-pipeline-connector.active i {
    color: var(--primary);
}

.h-pipeline-connector.rejected .h-pipeline-line {
    background: #dc2626;
}

.h-pipeline-connector.rejected i {
    color: #dc2626;
}

/* Compact Scroll Container for Requisition Line Items */
.indent-items-scroll-box {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    scrollbar-width: thin;
}

.indent-items-scroll-box table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-alt) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   GLOBAL FORM FIELDS: PROFESSIONAL BORDER-RADIUS & ELEVATION
   ========================================================================== */
.form-control,
.form-select,
textarea.form-control,
input.form-control,
input.search-input,
select.custom-select,
.input-group .form-control,
.input-group .form-select {
    border-radius: 10px !important;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input-group> :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group> :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group-text {
    border-radius: 10px !important;
}

/* ==========================================================================
   GLOBAL SEGMENTED NAVIGATION & TABS (ALL SCREENS)
   ========================================================================== */
.segmented-nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem !important;
}

.segmented-nav {
    display: inline-flex;
    align-items: center;
    background: var(--surface, #ffffff) !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    padding: 3px 4px !important;
    border-radius: 9999px !important;
    gap: 4px !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03) !important;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.segmented-nav::-webkit-scrollbar {
    display: none;
}

.segmented-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.45rem 1.15rem !important;
    border-radius: 9999px !important;
    font-size: 0.825rem;
    font-weight: 600 !important;
    color: var(--text-soft, #475569) !important;
    text-decoration: none !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    white-space: nowrap;
    cursor: pointer;
}

.segmented-nav-item i,
.segmented-nav-item svg {
    color: var(--muted, #64748b);
    transition: color 0.18s ease;
}

.segmented-nav-item:hover {
    color: var(--text, #0f172a) !important;
    background: rgba(15, 23, 42, 0.05) !important;
    text-decoration: none !important;
}

.segmented-nav-item:hover i,
.segmented-nav-item:hover svg {
    color: var(--text, #0f172a);
}

/* Active State - Rich Vibrant Capsule Pill with Dynamic Theme Glow and Crisp White Text/Icon */
.segmented-nav-item.active,
.segmented-nav-item.active:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 1px solid transparent !important;
    border-radius: 9999px !important;
    box-shadow: 0 4px 14px -2px var(--primary-glow), 0 2px 6px -1px rgba(var(--primary-rgb), 0.3) !important;
}

.segmented-nav-item.active i,
.segmented-nav-item.active svg,
.segmented-nav-item.active span {
    color: #ffffff !important;
}

/* Badges inside Tabs */
.segmented-nav-item .nav-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 9999px;
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-soft, #475569);
    transition: all 0.18s ease;
    line-height: 1.2;
}

.segmented-nav-item.active .nav-count-badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* --- Segmented Nav Dropdown (+ More Departments) --- */
.segmented-nav-dropdown-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.segmented-nav-dropdown-btn {
    border-radius: 9999px !important;
    border: 1px dashed rgba(100, 116, 139, 0.35) !important;
    background: transparent !important;
    color: var(--text-soft, #475569) !important;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.82rem;
}

.segmented-nav-dropdown-btn:hover,
.segmented-nav-dropdown-btn[aria-expanded="true"] {
    border-style: solid !important;
    border-color: var(--primary) !important;
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
}

.segmented-nav-dropdown-btn.active,
.segmented-nav-dropdown-btn.active:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    color: #ffffff !important;
    border: 1px solid transparent !important;
    border-radius: 9999px !important;
    box-shadow: 0 4px 14px -2px var(--primary-glow), 0 2px 6px -1px rgba(var(--primary-rgb), 0.3) !important;
}

.segmented-nav-dropdown-btn.active i,
.segmented-nav-dropdown-btn.active span {
    color: #ffffff !important;
}

/* Hide Bootstrap's default dropdown caret - we use custom chevron icon */
.segmented-nav-dropdown-btn.dropdown-toggle::after {
    display: none !important;
}

.segmented-nav-dropdown-btn .fa-chevron-down {
    font-size: 9px;
    opacity: 0.6;
    transition: transform 0.25s ease;
}

.segmented-nav-dropdown-btn[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Dropdown Menu Panel */
.segmented-dropdown-menu {
    min-width: 320px !important;
    max-width: 380px !important;
    max-height: 440px !important;
    border-radius: 16px !important;
    border: 1px solid var(--border-subtle, rgba(226, 232, 240, 0.8)) !important;
    background: var(--surface, #ffffff) !important;
    box-shadow:
        0 20px 50px -12px rgba(15, 23, 42, 0.18),
        0 8px 20px -4px rgba(15, 23, 42, 0.08),
        0 0 0 1px rgba(15, 23, 42, 0.04) !important;
    z-index: 1070 !important;
    padding: 0 !important;
    overflow: hidden !important;
    animation: dropdownSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Dropdown Search Header */
.segmented-dropdown-menu>.p-2 {
    padding: 0.85rem 0.85rem 0.65rem !important;
    margin-bottom: 0 !important;
    border-bottom: 1px solid var(--border-subtle, #e2e8f0) !important;
    background: var(--surface-alt, #f8fafc);
}

.segmented-dropdown-menu .input-group {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-subtle, #e2e8f0);
    background: var(--surface, #ffffff);
    transition: all 0.2s ease;
}

.segmented-dropdown-menu .input-group:focus-within {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 3px var(--primary-glow, rgba(99, 102, 241, 0.12));
}

.segmented-dropdown-menu .input-group-text {
    background: transparent !important;
    border: none !important;
    padding: 0.45rem 0.6rem 0.45rem 0.75rem !important;
    color: var(--muted, #94a3b8) !important;
    font-size: 0.8rem !important;
}

.segmented-dropdown-menu .input-group .form-control {
    background: transparent !important;
    border: none !important;
    padding: 0.45rem 0.75rem 0.45rem 0 !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    color: var(--text, #0f172a) !important;
    box-shadow: none !important;
}

.segmented-dropdown-menu .input-group .form-control::placeholder {
    color: var(--muted, #94a3b8);
    font-weight: 400;
}

/* Department List Container */
.dept-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.4rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.dept-dropdown-list::-webkit-scrollbar {
    width: 5px;
}

.dept-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.dept-dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 10px;
}

.dept-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

/* Department Dropdown Items */
.dept-dropdown-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.6rem 0.85rem !important;
    margin: 1px 0 !important;
    border-radius: 10px !important;
    font-size: 0.835rem !important;
    font-weight: 500 !important;
    color: var(--text, #1e293b) !important;
    text-decoration: none !important;
    transition: all 0.15s ease !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    cursor: pointer !important;
}

.dept-dropdown-item:hover {
    background: var(--surface-hover, #f1f5f9) !important;
    color: var(--primary, #4f46e5) !important;
    border-color: rgba(99, 102, 241, 0.08) !important;
}

.dept-dropdown-item:hover i {
    color: var(--primary, #6366f1) !important;
}

.dept-dropdown-item.active {
    background: var(--primary-soft, rgba(99, 102, 241, 0.1)) !important;
    color: var(--primary, #4f46e5) !important;
    font-weight: 700 !important;
    border-color: rgba(99, 102, 241, 0.15) !important;
}

.dept-dropdown-item.active i {
    color: var(--primary, #6366f1) !important;
}

.dept-dropdown-item i {
    color: var(--muted, #94a3b8);
    font-size: 0.8rem;
    transition: color 0.15s ease;
}

/* Department Count Badge inside dropdown */
.dept-dropdown-item .badge {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    padding: 0.2rem 0.55rem !important;
    border-radius: 20px !important;
    min-width: 26px !important;
    text-align: center !important;
    line-height: 1.3 !important;
    transition: all 0.15s ease !important;
}

.dept-dropdown-item .badge.bg-primary-subtle {
    background: var(--primary-soft, rgba(99, 102, 241, 0.12)) !important;
    color: var(--primary, #4f46e5) !important;
}

.dept-dropdown-item .badge.bg-light {
    background: rgba(100, 116, 139, 0.1) !important;
    color: var(--muted, #94a3b8) !important;
}

.dept-dropdown-item:hover .badge.bg-light {
    background: rgba(99, 102, 241, 0.08) !important;
    color: var(--primary, #6366f1) !important;
}

/* Empty state */
#noDeptFoundMsg {
    padding: 1.5rem 1rem !important;
    color: var(--muted, #94a3b8) !important;
    font-size: 0.82rem !important;
}

/* ==========================================================================
   GLOBAL BUTTONS: CRISP BORDERS & ELEVATION
   ========================================================================== */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 4px 14px var(--primary-glow) !important;
    text-decoration: none !important;
}

.btn-gradient-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px var(--primary-glow) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   HIGH-CONTRAST STATUS DETAILS, LABELS & TICKET CODES
   ========================================================================== */
/* Ticket Codes */
.ticket-badge,
.ticket-id-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Priority Badges - Clear, Bright Contrast (Scoped so container cards stay clean) */
.priority-critical:not(.ticket-row-item),
.badge-priority-critical {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
}

.priority-high:not(.ticket-row-item),
.badge-priority-high {
    background: rgba(249, 115, 22, 0.18) !important;
    color: #fdba74 !important;
    border: 1px solid rgba(249, 115, 22, 0.45) !important;
}

.priority-medium:not(.ticket-row-item),
.badge-priority-medium {
    background: rgba(14, 165, 233, 0.18) !important;
    color: #7dd3fc !important;
    border: 1px solid rgba(14, 165, 233, 0.45) !important;
}

.priority-low:not(.ticket-row-item),
.badge-priority-low {
    background: rgba(148, 163, 184, 0.18) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

/* ==========================================================================
   UNIVERSAL TAB STYLING HARMONIZATION (AGENT PANEL & ALL SCREENS)
   ========================================================================== */
.tab-switcher {
    display: inline-flex !important;
    align-items: center !important;
    background: rgba(15, 23, 42, 0.06) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    padding: 4px !important;
    border-radius: 12px !important;
    gap: 4px !important;
}

.tab-btn {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.5rem 1.15rem !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: var(--muted, #64748b) !important;
    text-decoration: none !important;
    border: 1px solid transparent !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    background: transparent !important;
}

.tab-btn:hover {
    color: var(--text, #0f172a) !important;
    background: rgba(0, 0, 0, 0.04) !important;
}

.tab-btn.active {
    background: #ffffff !important;
    color: var(--primary, #4338ca) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.tab-badge,
.nav-count-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.15rem 0.55rem !important;
    font-size: 0.725rem !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    margin-left: 0.4rem !important;
    background: rgba(100, 116, 139, 0.15) !important;
    color: var(--muted, #64748b) !important;
}

.tab-btn.active .tab-badge,
.segmented-nav-item.active .nav-count-badge {
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
}

/* ==========================================================================
   AGENT ACTION PATHWAY COMPONENT (SERVICE / REPLACE / CREATE INDENT)
   ========================================================================== */
.agent-pathway-card {
    background: var(--surface-card, #ffffff);
    border: 1.5px solid var(--primary-border, rgba(99, 102, 241, 0.35));
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.agent-pathway-header {
    background: var(--primary-soft, rgba(99, 102, 241, 0.1));
    border-bottom: 1px solid var(--primary-border, rgba(99, 102, 241, 0.25));
    padding: 1rem 1.25rem;
}

.agent-pathway-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}

.pathway-option-card {
    border: 1.5px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    padding: 1.15rem;
    background: var(--surface, #ffffff);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.pathway-option-card:hover {
    border-color: var(--primary, #6366f1);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -4px var(--primary-glow, rgba(99, 102, 241, 0.25));
}

.pathway-option-card.active-selected {
    border-color: var(--primary, #6366f1) !important;
    background: var(--primary-soft, rgba(99, 102, 241, 0.12)) !important;
    box-shadow: 0 0 0 2px var(--primary, #6366f1), 0 8px 24px var(--primary-glow) !important;
}

.pathway-icon-bubble {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.85rem;
}

.replace-workflow-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.replace-step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.04), rgba(255, 255, 255, 0.9));
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.replace-step::after {
    content: "";
    position: absolute;
    right: -0.62rem;
    top: 50%;
    width: 0.7rem;
    height: 1px;
    background: rgba(148, 163, 184, 0.75);
    transform: translateY(-50%);
}

.replace-step:last-child::after {
    display: none;
}

.replace-step span {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary, #4f46e5);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.replace-step small {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text, #0f172a);
    text-transform: uppercase;
    font-size: 0.675rem;
}

.replace-step.active {
    border-color: rgba(59, 130, 246, 0.36);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.98));
}

.replace-step.active span {
    background: var(--primary, #4f46e5);
    color: #ffffff;
}

@media (max-width: 767.98px) {
    .replace-workflow-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .replace-step::after {
        display: none;
    }
}

button.segmented-nav-item {
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    outline: none;
}

/* ==========================================================================
   MODERN CHECKBOX CARDS & DYNAMIC VIEW CUSTOMIZER (AGENTS UI/UX)
   ========================================================================== */
.agent-modern-check-card,
.agent-modern-perm-card {
    position: relative;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.28));
    border-radius: 10px;
    background-color: var(--surface, #ffffff);
    padding: 0.65rem 0.85rem;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.agent-modern-check-card:hover,
.agent-modern-perm-card:hover {
    border-color: var(--primary, #4f46e5);
    background-color: var(--surface-hover, #f8fafc);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.06);
}

.agent-modern-check-card.is-checked,
.agent-modern-perm-card.is-checked {
    border-color: var(--primary, #4f46e5) !important;
    background-color: rgba(var(--primary-rgb, 79, 70, 229), 0.05) !important;
    box-shadow: 0 0 0 1.5px var(--primary, #4f46e5), 0 4px 14px rgba(var(--primary-rgb, 79, 70, 229), 0.12) !important;
}

.modern-chk-indicator {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.modern-chk-indicator .modern-hidden-chk {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

.modern-chk-indicator .chk-custom-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--border, #cbd5e1);
    background-color: #ffffff;
    color: #ffffff;
    font-size: 11px;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.modern-chk-indicator .chk-custom-box i {
    transform: scale(0);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modern-chk-indicator .modern-hidden-chk:checked+.chk-custom-box,
.agent-modern-check-card.is-checked .chk-custom-box,
.agent-modern-perm-card.is-checked .chk-custom-box {
    background-color: var(--primary, #4f46e5);
    border-color: var(--primary, #4f46e5);
    color: #ffffff;
}

.modern-chk-indicator .modern-hidden-chk:checked+.chk-custom-box i,
.agent-modern-check-card.is-checked .chk-custom-box i,
.agent-modern-perm-card.is-checked .chk-custom-box i {
    transform: scale(1);
}

.dept-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(var(--primary-rgb, 79, 70, 229), 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Custom View Switcher Dropdown & Panels */
.stats-overview-card {
    position: relative;
    z-index: 40;
    overflow: visible !important;
}

.stats-overview-card.is-dropdown-open,
.stats-overview-card:has(.custom-view-dropdown.show) {
    z-index: 1050 !important;
}

.custom-view-dropdown {
    position: relative;
}

.custom-view-dropdown.show {
    z-index: 1060 !important;
}

.custom-view-panel {
    border: 1px solid var(--border, rgba(148, 163, 184, 0.25)) !important;
    background: var(--surface, #ffffff);
    box-shadow: 0 20px 40px -4px rgba(15, 23, 42, 0.18), 0 8px 16px -2px rgba(15, 23, 42, 0.08);
    z-index: 1070 !important;
}

.custom-toggle-item {
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.custom-toggle-item:hover {
    background-color: var(--surface-hover, #f1f5f9) !important;
    border-color: var(--border, #cbd5e1) !important;
}

.custom-toggle-item .form-check-input {
    cursor: pointer;
    width: 2.2em;
    height: 1.2em;
}

/* Dynamic Visibility Control via Classes */
#agentTableView.hide-col-agent-info .col-agent-info {
    display: none !important;
}

#agentTableView.hide-col-agent-empid .col-agent-empid {
    display: none !important;
}

#agentTableView.hide-col-agent-branch .col-agent-branch {
    display: none !important;
}

#agentTableView.hide-col-agent-staff .col-agent-staff {
    display: none !important;
}

#agentTableView.hide-col-agent-depts .col-agent-depts {
    display: none !important;
}

#agentTableView.hide-col-agent-perms .col-agent-perms {
    display: none !important;
}

#agentTableView.hide-col-agent-role .col-agent-role {
    display: none !important;
}

#agentTableView.hide-col-agent-status .col-agent-status {
    display: none !important;
}

#agentTableView.hide-col-agent-actions .col-agent-actions {
    display: none !important;
}

#agentCardsView.hide-card-detail-empid .card-detail-empid {
    display: none !important;
}

#agentCardsView.hide-card-detail-branch .card-detail-branch {
    display: none !important;
}

#agentCardsView.hide-card-detail-staff .card-detail-staff {
    display: none !important;
}

#agentCardsView.hide-card-detail-depts .card-detail-depts {
    display: none !important;
}

#agentCardsView.hide-card-detail-perms .card-detail-perms {
    display: none !important;
}

#agentCardsView.hide-card-detail-contact .card-detail-contact {
    display: none !important;
}

#agentCardsView.hide-card-detail-role .card-detail-role {
    display: none !important;
}

#agentCardsView.hide-card-detail-actions .card-detail-actions {
    display: none !important;
}

/* ==========================================================================
   TICKETS MODULE & VIEW STYLES (MERGED & UNIFIED)
   ========================================================================== */

/* ==========================================================================
   TICKETS MODULE DYNAMIC STYLES (MY, INDEX, VIEW, CREATE)
   Centralized from in-page styles into dynamic stylesheet
   ========================================================================== */

/* --- Unified Ticket List & Workspace Styles (tickets/my.php & tickets/index.php) --- */
.app-workspace,
.ticket-list-page {
    margin: 0 auto;
}

/* Workspace Header & Action Groups */
.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.title-group h1 {
    font-size: 1.875rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-heading);
    margin: 0;
}

.title-group p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-gradient-primary {
    background: var(--brand-gradient);
    color: #ffffff !important;
    border: none;
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    box-shadow: 0 8px 20px -4px var(--primary-glow);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-gradient-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -4px var(--primary-glow);
    color: #ffffff !important;
}

.export-btn-group {
    display: inline-flex;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 3px;
    box-shadow: var(--shadow-soft);
}

.export-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.export-btn:hover {
    background: var(--surface-hover);
    color: var(--text-heading);
}

/* Interactive KPI Metric Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-strong);
}

.metric-card.open-card:hover::before {
    background: var(--info);
}

.metric-card.progress-card:hover::before {
    background: var(--amber);
}

.metric-card.resolved-card:hover::before {
    background: var(--success);
}

.icon-box {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.icon-box.blue {
    background: var(--info-soft);
    color: var(--info);
}

.icon-box.amber {
    background: var(--amber-soft);
    color: var(--amber);
}

.icon-box.emerald {
    background: var(--success-soft);
    color: var(--success);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-heading);
    line-height: 1.2;
}

.metric-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Glassmorphic Filter & Bulk Actions Bar */
.glass-filter-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.filter-bar-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 260px;
}

.search-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.9rem;
}

.search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.6rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg);
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--brand-primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.custom-select {
    padding: 0.65rem 2.2rem 0.65rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    transition: all 0.2s ease;
}

.custom-select:focus {
    border-color: var(--brand-primary);
}

.btn-filter-action {
    background: var(--surface-hover);
    border: 1px solid var(--border-subtle);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-filter-action:hover {
    background: var(--border);
}

.btn-clear-filter {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
}

/* Unified Top-Level Table Header Bar (Side by Side) */
.table-top-bar {
    background: var(--surface-card, #ffffff);
    min-height: 52px;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-subtle, #e2e8f0);
}

.dt-length-inline .dataTables_length {
    margin-bottom: 0 !important;
}

.dt-length-inline .dataTables_length label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    font-size: 0.825rem !important;
    font-weight: 500 !important;
    color: var(--text-muted, #64748b) !important;
    margin-bottom: 0 !important;
}

.dt-length-inline .dataTables_length select {
    display: inline-block !important;
    width: auto !important;
    padding: 0.35rem 1.8rem 0.35rem 0.65rem !important;
    font-size: 0.825rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-subtle, #e2e8f0) !important;
    background-color: var(--surface-alt, #f8fafc) !important;
    color: var(--text-heading, #0f172a) !important;
}

.bulk-actions-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
}

.btn-merge-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--amber, #f59e0b);
    color: #ffffff;
    border: none;
    padding: 0.42rem 0.95rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.55;
    line-height: 1.25;
}

.btn-merge-action.is-enabled {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

/* Remove sort indicators from no-sort table columns (Select-All & Actions) */
th.no-sort::before,
th.no-sort::after,
th.sorting_disabled::before,
th.sorting_disabled::after {
    display: none !important;
    content: none !important;
}

th.no-sort {
    padding-right: 0.75rem !important;
    cursor: default !important;
}

/* Table Design */
.table-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background: var(--bg);
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.custom-table td {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    font-size: 0.875rem;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover {
    background-color: var(--surface-alt);
}

.ticket-badge {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--brand-primary);
    background: var(--primary-soft);
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ticket-badge:hover {
    background: var(--brand-primary);
    color: #ffffff;
}

/* Avatar Monogram Indicator */
.assignee-avatar,
.user-avatar-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft, rgba(99, 102, 241, 0.12));
    color: var(--primary, #6366f1);
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0;
    user-select: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Avatar Circle Sizing Modifiers */
.avatar-circle-sm {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.65rem !important;
}

.avatar-circle-md {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.8rem !important;
}

.avatar-circle-lg {
    width: 40px !important;
    height: 40px !important;
    font-size: 0.9rem !important;
}

/* Avatar Circle Color Variants */
.avatar-circle-neutral {
    background: var(--border, #e2e8f0);
    color: var(--text-heading, #1e293b);
}

.avatar-circle-gradient {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #ffffff;
}

/* Status Indicator Dots */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.775rem;
    font-weight: 600;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.dot-open {
    background: var(--info);
    box-shadow: 0 0 0 2px var(--info-soft);
}

.dot-progress {
    background: var(--amber);
    box-shadow: 0 0 0 2px var(--amber-soft);
}

.dot-resolved {
    background: var(--success);
    box-shadow: 0 0 0 2px var(--success-soft);
}

/* Action Buttons */
.btn-action-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--surface-hover);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-action-icon:hover {
    background: var(--brand-primary);
    color: #ffffff;
    transform: scale(1.05);
}

.empty-state-box {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 1rem;
}

/* DataTables Clean Integration Overrides */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--brand-primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Prevent search box duplicate rendering from DataTables */
.dataTables_wrapper .dataTables_filter {
    display: none;
}


/* Clean Modern Table System */
table,
.table,
.custom-table,
.ticket-data-table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

table th,
table td,
.table th,
.table td,
.custom-table th,
.custom-table td,
.ticket-data-table th,
.ticket-data-table td {
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

/* --- Styles from tickets/view.php (Modern Full-Width Stretched Layout & Clean Chat UI) --- */
.ticket-view-page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0.25rem 0.5rem 2.5rem !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
}

/* 2-Column Responsive Layout (Main stretches fluidly, Sidebar fixed 350px) */
.ticket-grid-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 350px !important;
    gap: 18px !important;
    align-items: start !important;
    width: 100% !important;
}

@media (max-width: 1100px) {
    .ticket-grid-layout {
        grid-template-columns: 1fr !important;
    }
}

/* Hero Header Card (Stretched Full Width) */
.ticket-hero-card,
.compact-hero {
    width: 100%;
    background: var(--surface, #ffffff);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    padding: 14px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.ticket-hero-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle, rgba(226, 232, 240, 0.8));
}

.ticket-breadcrumb-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket-code-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-alt, #f1f5f9);
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 0.82rem;
    font-weight: 700;
}

.btn-copy-chip {
    background: none;
    border: none;
    padding: 0;
    color: var(--muted, #64748b);
    cursor: pointer;
    font-size: 0.78rem;
    transition: color 0.15s ease;
}

.btn-copy-chip:hover {
    color: var(--primary, #6366f1);
}

.ticket-hero-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ticket-hero-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
}

.ticket-hero-title-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ticket-hero-title {
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    color: var(--text, #0f172a);
    margin: 0 !important;
    line-height: 1.25;
}

.ticket-tags-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ticket-timestamps-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.74rem;
    color: var(--muted, #64748b);
    font-weight: 500;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    background: var(--surface-hover, #f1f5f9);
    border: 1px solid var(--border, #cbd5e1);
    color: var(--text-soft, #475569);
}

.meta-pill.primary {
    background: var(--primary-soft, rgba(99, 102, 241, 0.12));
    border-color: var(--primary-border, rgba(99, 102, 241, 0.3));
    color: var(--primary-strong, #4338ca);
}

.meta-pill.success {
    background: var(--success-soft, rgba(22, 163, 74, 0.12));
    border-color: rgba(22, 163, 74, 0.3);
    color: var(--success, #16a34a);
}

.meta-pill.warning {
    background: var(--amber-soft, rgba(217, 119, 6, 0.12));
    border-color: rgba(217, 119, 6, 0.3);
    color: var(--amber, #d97706);
}

.meta-pill.danger {
    background: var(--danger-soft, rgba(239, 68, 68, 0.12));
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger, #dc2626);
}

/* Stretched Full-Width Progress Ribbon */
.ribbon-center-container {
    width: 100%;
}

.ticket-progress-ribbon-slim,
.ticket-progress-ribbon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    overflow-x: auto;
    width: 100%;
}

.ticket-progress-ribbon-slim .ribbon-step,
.ribbon-step {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.ticket-progress-ribbon-slim .ribbon-dot,
.ribbon-dot {
    width: 24px !important;
    height: 24px !important;
    border-radius: 6px !important;
    font-size: 0.68rem !important;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt, #f1f5f9);
    color: var(--muted, #64748b);
    border: 1px solid var(--border, #cbd5e1);
}

.ticket-progress-ribbon-slim .ribbon-step.done .ribbon-dot,
.ribbon-step.done .ribbon-dot {
    background: var(--success-soft, rgba(22, 163, 74, 0.15)) !important;
    color: var(--success, #16a34a) !important;
    border-color: rgba(22, 163, 74, 0.3) !important;
}

.ticket-progress-ribbon-slim .ribbon-step.active .ribbon-dot,
.ribbon-step.active .ribbon-dot {
    background: var(--primary-soft, rgba(99, 102, 241, 0.15)) !important;
    color: var(--primary, #6366f1) !important;
    border-color: var(--primary, #6366f1) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.ticket-progress-ribbon-slim .ribbon-title,
.ribbon-title {
    font-size: 0.74rem !important;
    font-weight: 700;
    color: var(--text-soft, #334155);
}

.ticket-progress-ribbon-slim .ribbon-sub,
.ribbon-sub {
    font-size: 0.64rem !important;
    color: var(--muted, #64748b);
}

.ticket-progress-ribbon-slim .ribbon-connector,
.ribbon-connector {
    flex: 1;
    height: 2px;
    min-width: 16px;
    background: var(--border, #e2e8f0);
    border-radius: 2px;
}

.ticket-progress-ribbon-slim .ribbon-connector.done,
.ribbon-connector.done {
    background: var(--success, #16a34a) !important;
}

/* Agent Action Pathway Component */
.compact-pathway {
    border-radius: 14px !important;
    border: 1.5px solid var(--primary-border, rgba(99, 102, 241, 0.25)) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
    overflow: hidden;
    margin-bottom: 16px !important;
    background: var(--surface, #ffffff) !important;
}

.compact-pathway .agent-pathway-header {
    background: rgba(99, 102, 241, 0.05);
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.agent-pathway-grid-slim {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 768px) {
    .agent-pathway-grid-slim {
        grid-template-columns: 1fr;
    }
}

.pathway-card-slim {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    text-align: left;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border, #e2e8f0);
    background: var(--surface, #ffffff);
    transition: all 0.2s ease;
}

.pathway-card-slim:hover {
    border-color: var(--primary, #6366f1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.pathway-card-slim.active-selected {
    border-color: var(--primary, #6366f1) !important;
    background: rgba(99, 102, 241, 0.06) !important;
    box-shadow: 0 0 0 1.5px var(--primary, #6366f1);
}

.pathway-card-header-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    text-align: left;
    width: 100%;
}

.pathway-mini-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.pathway-slim-title {
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text, #0f172a);
    text-align: left;
}

.pathway-slim-sub {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--muted, #64748b);
    text-align: left;
}

.pathway-card-slim .btn {
    width: 100%;
    padding: 6px 12px !important;
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.4;
}

.pathway-card-slim .btn-outline-info {
    color: #0284c7 !important;
    border-color: #0284c7 !important;
}

.pathway-card-slim .btn-outline-info:hover {
    color: #ffffff !important;
    background-color: #0284c7 !important;
    border-color: #0284c7 !important;
}

.pathway-card-slim .btn-outline-warning {
    color: #d97706 !important;
    border-color: #d97706 !important;
}

.pathway-card-slim .btn-outline-warning:hover {
    color: #ffffff !important;
    background-color: #d97706 !important;
    border-color: #d97706 !important;
}

/* Framed Issue Description Card */
.compact-ticket-card,
.ticket-card {
    border-radius: 14px !important;
    margin-bottom: 16px !important;
    background: var(--surface, #ffffff) !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03) !important;
    overflow: hidden;
}

.compact-author-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.compact-avatar,
.author-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    font-size: 0.82rem !important;
    flex-shrink: 0;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25) !important;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.author-meta {
    flex: 1;
    min-width: 0;
}

.author-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text, #0f172a);
}

.author-sub {
    font-size: 0.76rem;
    color: var(--muted, #64748b);
}

.issue-text-bubble {
    background: var(--surface-alt, #f8fafc);
    border: 1px solid var(--border-subtle, rgba(226, 232, 240, 0.85));
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text, #0f172a);
    min-height: 48px;
    word-break: break-word;
}

.compact-attachment-grid,
.attachment-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 8px !important;
}

.compact-chip,
.attachment-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px !important;
    font-size: 0.76rem !important;
    border-radius: 8px !important;
    background: var(--bg, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s ease;
}

.compact-chip:hover,
.attachment-chip:hover {
    background: var(--primary-soft, rgba(99, 102, 241, 0.1));
    border-color: var(--primary, #6366f1);
}

.compact-fields,
.custom-fields-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 8px !important;
}

.compact-field-box,
.custom-field-box {
    padding: 6px 10px !important;
    border-radius: 8px !important;
    background: var(--bg, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
}

.custom-field-box-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted, #64748b);
    margin-bottom: 2px;
}

.custom-field-box-val {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text, #0f172a);
}

/* ==========================================================================
   CONVERSATIONAL CHAT THREAD: CLEAR LEFT / RIGHT ALIGNMENTS & HIGH CONTRAST
   ========================================================================== */
.modern-chat-card {
    border-radius: 14px !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03) !important;
    overflow: hidden;
    margin-bottom: 16px !important;
    background: var(--surface, #ffffff) !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
}

.chat-messages-scroll {
    max-height: 520px;
    min-height: 180px;
    overflow-y: auto;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--surface-alt, #f8fafc);
    scroll-behavior: smooth;
    border-radius: 12px;
}

.chat-messages-scroll::-webkit-scrollbar {
    width: 6px;
}

.chat-messages-scroll::-webkit-scrollbar-track {
    background: var(--surface-alt, #f8fafc);
    border-radius: 6px;
}

.chat-messages-scroll::-webkit-scrollbar-thumb {
    background: var(--border, rgba(148, 163, 184, 0.4));
    border-radius: 6px;
}

.chat-messages-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--muted, #94a3b8);
}

/* Base message row */
.chat-message-row {
    display: flex;
    gap: 12px;
    max-width: 78%;
    width: fit-content;
    position: relative;
    margin-bottom: 10px;
}

/* Left Alignment: Customer / Requester */
.chat-message-row.customer-row {
    align-self: flex-start !important;
    margin-right: auto !important;
    margin-left: 0 !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    text-align: left !important;
}

/* Right Alignment: Staff / Support Agent (including Internal Notes) */
.chat-message-row.staff-row {
    align-self: flex-end !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    flex-direction: row-reverse !important;
    align-items: flex-start !important;
    text-align: left !important;
}

/* Distinct Avatars */
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    flex-shrink: 0;
    color: #ffffff;
}

.customer-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.staff-avatar {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.internal-note-avatar {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Bubble Styling */
.chat-bubble {
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    word-break: break-word;
    min-width: 260px;
}

/* Left Bubble: Customer */
.customer-bubble {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    color: #0f172a;
    border-top-left-radius: 4px;
}

.customer-bubble .chat-bubble-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.customer-bubble .chat-author-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #0f172a;
}

/* Right Bubble: Staff Public Reply */
.staff-bubble {
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    border: 1.5px solid #c7d2fe;
    color: #1e1b4b;
    border-top-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.staff-bubble .chat-bubble-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(199, 210, 254, 0.7);
}

.staff-bubble .chat-author-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1e1b4b;
}

/* Right Bubble: Staff Internal Note */
.internal-note-bubble {
    background: #fffbeb !important;
    border: 1.5px solid #fde047 !important;
    border-right: 4px solid #eab308 !important;
    border-left: 1.5px solid #fde047 !important;
    color: #78350f !important;
    border-top-right-radius: 4px !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.12) !important;
}

.internal-note-bubble .chat-bubble-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px dashed rgba(234, 179, 8, 0.4) !important;
}

.internal-note-bubble .chat-author-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #78350f !important;
}

/* Left Bubble: Customer Internal / System Note */
.customer-note-bubble {
    background: #fffbeb !important;
    border: 1.5px solid #fde047 !important;
    border-left: 4px solid #eab308 !important;
    border-right: 1.5px solid #fde047 !important;
    color: #78350f !important;
    border-top-left-radius: 4px !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.12) !important;
}

.customer-note-bubble .chat-bubble-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px dashed rgba(234, 179, 8, 0.4) !important;
}

.customer-note-bubble .chat-author-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #78350f !important;
}

.chat-bubble-time {
    font-size: 0.68rem;
    color: var(--muted, #64748b);
    white-space: nowrap;
}

.chat-system-strip {
    background: var(--surface-alt, #f8fafc);
    font-size: 0.74rem;
}

.pulse-dot {
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Composer Section */
.compact-composer-card {
    border-radius: 14px !important;
    margin-bottom: 16px !important;
    background: var(--surface, #ffffff) !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03) !important;
}

.composer-segmented-tabs {
    display: inline-flex;
    background: var(--bg, #f1f5f9);
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.composer-segmented-tabs .composer-tab-btn {
    border: none;
    background: transparent;
    padding: 5px 12px;
    font-size: 0.76rem;
    font-weight: 700;
    border-radius: 6px;
    color: var(--muted, #64748b);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.composer-segmented-tabs .composer-tab-btn:hover {
    color: var(--text, #0f172a);
}

.composer-segmented-tabs .composer-tab-btn.active[data-message-type="reply"] {
    background: var(--primary, #6366f1);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.composer-segmented-tabs .composer-tab-btn.active[data-message-type="note"] {
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Modern Unified Editor Shell */
.quill-editor-shell {
    border: 1.5px solid var(--border, #cbd5e1);
    border-radius: 12px;
    background: var(--surface, #ffffff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.quill-editor-shell:focus-within {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.quill-editor-shell.mode-internal-note {
    border-color: #fde047;
    background: #fffefb;
}

.quill-editor-shell.mode-internal-note:focus-within {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.quill-editor-shell .ql-toolbar.ql-snow {
    background: var(--surface-alt, #f8fafc);
    border: none !important;
    border-bottom: 1px solid var(--border, #e2e8f0) !important;
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    user-select: none;
    box-sizing: border-box;
}

.quill-editor-shell .ql-snow .ql-formats {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 2px;
    padding-right: 6px;
    margin-right: 4px;
    border-right: 1px solid var(--border, #e2e8f0);
}

.quill-editor-shell .ql-snow .ql-formats:last-child {
    padding-right: 0;
    margin-right: 0;
    border-right: none;
}

.quill-editor-shell .ql-snow .ql-toolbar button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    border: 1px solid transparent;
    color: var(--text-soft, #475569);
    background: transparent;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    cursor: pointer;
}

.quill-editor-shell .ql-snow .ql-toolbar button:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary, #6366f1);
    border-color: rgba(99, 102, 241, 0.15);
}

.quill-editor-shell .ql-snow .ql-toolbar button.ql-active {
    background: var(--primary-soft, rgba(99, 102, 241, 0.15));
    color: var(--primary, #6366f1);
    border-color: rgba(99, 102, 241, 0.25);
}

.quill-editor-shell .ql-snow .ql-stroke {
    stroke: currentColor;
    stroke-width: 2;
}

.quill-editor-shell .ql-snow .ql-fill {
    fill: currentColor;
}

/* Prevent any searchable-select intrusion inside Quill toolbar */
.quill-editor-shell .searchable-select-wrap,
.ql-toolbar .searchable-select-wrap,
.ql-container .searchable-select-wrap {
    display: none !important;
}

.quill-editor-shell .ql-snow select {
    display: none !important;
}

/* Advanced Quill Pickers & Dropdowns Base */
.quill-editor-shell .ql-snow .ql-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    height: 28px;
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-soft, #475569);
}

.quill-editor-shell .ql-snow .ql-picker.ql-header {
    width: 124px;
}

.quill-editor-shell .ql-snow .ql-picker.ql-size {
    width: 108px;
}

.quill-editor-shell .ql-snow .ql-icon-picker.ql-align {
    width: 32px;
}

.quill-editor-shell .ql-snow .ql-color-picker {
    width: 30px;
}

/* Text Dropdowns (Header, Size) Label Styling */
.quill-editor-shell .ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 28px;
    line-height: 26px;
    padding: 0 8px 0 10px;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 6px;
    background: var(--surface, #ffffff);
    color: var(--text, #334155);
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s ease;
    user-select: none;
}

.quill-editor-shell .ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-label::before {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 16px);
    line-height: 26px;
    font-size: 0.82rem;
    font-weight: 500;
}

.quill-editor-shell .ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-label svg {
    position: static;
    margin: 0;
    top: auto;
    right: auto;
    transform: none;
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    pointer-events: none;
    stroke: currentColor;
}

.quill-editor-shell .ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-label:hover {
    border-color: var(--primary, #6366f1);
    color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.04);
}

.quill-editor-shell .ql-snow .ql-picker.ql-expanded:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-label {
    border-color: var(--primary, #6366f1);
    color: var(--primary, #6366f1);
    background: var(--surface, #ffffff);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
    z-index: 1061;
}

/* Icon & Color Pickers (Align, Color, Background) Label Styling */
.quill-editor-shell .ql-snow .ql-color-picker .ql-picker-label,
.quill-editor-shell .ql-snow .ql-icon-picker .ql-picker-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 3px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
    position: relative;
}

.quill-editor-shell .ql-snow .ql-color-picker .ql-picker-label:hover,
.quill-editor-shell .ql-snow .ql-icon-picker .ql-picker-label:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary, #6366f1);
    border-color: rgba(99, 102, 241, 0.15);
}

.quill-editor-shell .ql-snow .ql-color-picker.ql-expanded .ql-picker-label,
.quill-editor-shell .ql-snow .ql-icon-picker.ql-expanded .ql-picker-label {
    background: var(--primary-soft, rgba(99, 102, 241, 0.15));
    border-color: var(--primary, #6366f1);
    color: var(--primary, #6366f1);
    z-index: 1061;
}

.quill-editor-shell .ql-snow .ql-color-picker .ql-picker-label svg,
.quill-editor-shell .ql-snow .ql-icon-picker .ql-picker-label svg {
    position: static;
    width: 18px;
    height: 18px;
    margin: 0;
}

/* Dropdown Menus: Base hidden state */
.quill-editor-shell .ql-snow .ql-picker .ql-picker-options {
    display: none !important;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1060;
    box-sizing: border-box;
}

/* Dropdown Menus: Text Pickers (Header, Size) */
.quill-editor-shell .ql-snow .ql-picker.ql-expanded:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-options {
    display: block !important;
    min-width: 130px;
    padding: 5px;
    max-height: 220px;
    overflow-y: auto;
}

.quill-editor-shell .ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-item {
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 0.82rem;
    color: var(--text, #334155);
    cursor: pointer;
    transition: all 0.15s ease;
}

.quill-editor-shell .ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary, #6366f1);
}

.quill-editor-shell .ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-item.ql-selected {
    background: var(--primary-soft, rgba(99, 102, 241, 0.15));
    color: var(--primary, #6366f1);
    font-weight: 600;
}

/* Dropdown Menus: Color & Background Palette */
.quill-editor-shell .ql-snow .ql-color-picker.ql-expanded .ql-picker-options {
    display: flex !important;
    flex-wrap: wrap;
    width: 168px;
    padding: 6px;
    gap: 4px;
    align-items: center;
}

.quill-editor-shell .ql-snow .ql-color-picker .ql-picker-item {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    flex-shrink: 0;
}

.quill-editor-shell .ql-snow .ql-color-picker .ql-picker-item:hover {
    transform: scale(1.2);
    border-color: #000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 2;
    position: relative;
}

.quill-editor-shell .ql-snow .ql-color-picker .ql-picker-item.ql-selected {
    border: 2px solid var(--primary, #6366f1);
    box-shadow: 0 0 0 1px #fff;
}

/* Dropdown Menus: Icon / Alignment Picker */
.quill-editor-shell .ql-snow .ql-icon-picker.ql-align.ql-expanded .ql-picker-options {
    display: flex !important;
    flex-direction: row;
    gap: 2px;
    width: auto;
    padding: 4px;
    white-space: nowrap;
}

.quill-editor-shell .ql-snow .ql-icon-picker.ql-align .ql-picker-item {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft, #475569);
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.quill-editor-shell .ql-snow .ql-icon-picker.ql-align .ql-picker-item:hover,
.quill-editor-shell .ql-snow .ql-icon-picker.ql-align .ql-picker-item.ql-selected {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary, #6366f1);
}

/* Link & Formula Tooltip */
.quill-editor-shell .ql-snow .ql-tooltip {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 8px 12px;
    z-index: 1065;
    font-size: 0.85rem;
    color: var(--text, #0f172a);
}

.quill-editor-shell .ql-snow .ql-tooltip input[type="text"] {
    background: var(--surface-alt, #f8fafc);
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 6px;
    padding: 4px 8px;
    color: var(--text, #0f172a);
    font-size: 0.85rem;
    outline: none;
}

.quill-editor-shell .ql-snow .ql-tooltip input[type="text"]:focus {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.quill-editor-shell .ql-container.ql-snow {
    border: none !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    border-bottom-left-radius: 11px;
    border-bottom-right-radius: 11px;
}

.quill-editor-shell .ql-editor {
    min-height: 120px !important;
    max-height: 380px;
    padding: 14px 16px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text, #0f172a);
}

.quill-editor-shell .ql-editor.ql-blank::before {
    color: var(--muted, #94a3b8);
    font-style: normal;
    font-size: 0.88rem;
    left: 16px;
    right: 16px;
}

/* Dark theme overrides for advanced pickers */
[data-theme="dark"] .quill-editor-shell,
.dark .quill-editor-shell {
    background: var(--surface, #1e293b);
    border-color: var(--border, #334155);
}

[data-theme="dark"] .quill-editor-shell .ql-toolbar.ql-snow,
.dark .quill-editor-shell .ql-toolbar.ql-snow {
    background: var(--surface-alt, #0f172a);
    border-bottom-color: var(--border, #334155) !important;
}

[data-theme="dark"] .quill-editor-shell .ql-snow .ql-formats,
.dark .quill-editor-shell .ql-snow .ql-formats {
    border-right-color: var(--border, #334155);
}

[data-theme="dark"] .quill-editor-shell .ql-snow .ql-toolbar button,
.dark .quill-editor-shell .ql-snow .ql-toolbar button {
    color: var(--text-soft, #94a3b8);
}

[data-theme="dark"] .quill-editor-shell .ql-snow .ql-picker,
.dark .quill-editor-shell .ql-snow .ql-picker {
    color: var(--text-soft, #cbd5e1);
}

[data-theme="dark"] .quill-editor-shell .ql-snow .ql-picker-label,
.dark .quill-editor-shell .ql-snow .ql-picker-label {
    background: var(--surface, #1e293b);
    border-color: var(--border, #334155);
    color: var(--text-soft, #cbd5e1);
}

[data-theme="dark"] .quill-editor-shell .ql-snow .ql-picker.ql-expanded .ql-picker-label,
.dark .quill-editor-shell .ql-snow .ql-picker.ql-expanded .ql-picker-label {
    background: var(--surface, #1e293b);
    color: var(--primary, #818cf8);
    border-color: var(--primary, #818cf8);
}

[data-theme="dark"] .quill-editor-shell .ql-snow .ql-picker-options,
.dark .quill-editor-shell .ql-snow .ql-picker-options {
    background: var(--surface, #1e293b) !important;
    border-color: var(--border, #334155) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .quill-editor-shell .ql-snow .ql-picker-item,
.dark .quill-editor-shell .ql-snow .ql-picker-item {
    color: var(--text, #f1f5f9);
}

[data-theme="dark"] .quill-editor-shell .ql-snow .ql-picker-item:hover,
.dark .quill-editor-shell .ql-snow .ql-picker-item:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #818cf8;
}

[data-theme="dark"] .quill-editor-shell .ql-snow .ql-tooltip,
.dark .quill-editor-shell .ql-snow .ql-tooltip {
    background: var(--surface, #1e293b);
    border-color: var(--border, #334155);
    color: var(--text, #f1f5f9);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .quill-editor-shell .ql-snow .ql-tooltip input[type="text"],
.dark .quill-editor-shell .ql-snow .ql-tooltip input[type="text"] {
    background: var(--surface-alt, #0f172a);
    border-color: var(--border, #334155);
    color: var(--text, #f1f5f9);
}

[data-theme="dark"] .quill-editor-shell .ql-snow .ql-stroke,
.dark .quill-editor-shell .ql-snow .ql-stroke {
    stroke: var(--text-soft, #94a3b8);
}

[data-theme="dark"] .quill-editor-shell .ql-snow .ql-fill,
.dark .quill-editor-shell .ql-snow .ql-fill {
    fill: var(--text-soft, #94a3b8);
}

[data-theme="dark"] .quill-editor-shell .ql-editor,
.dark .quill-editor-shell .ql-editor {
    color: var(--text, #f1f5f9);
}

/* Rich content display styles */
.formatted-message,
.issue-text-bubble,
#tprevDescription,
.ql-editor {
    word-break: break-word;
}

.formatted-message table,
.issue-text-bubble table,
#tprevDescription table,
.ql-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    overflow: hidden;
}

.formatted-message th,
.formatted-message td,
.issue-text-bubble th,
.issue-text-bubble td,
#tprevDescription th,
#tprevDescription td,
.ql-editor th,
.ql-editor td {
    border: 1px solid var(--border, #e2e8f0);
    padding: 6px 10px;
    font-size: 0.88rem;
}

.formatted-message th,
.issue-text-bubble th,
#tprevDescription th,
.ql-editor th {
    background: var(--surface-alt, #f8fafc);
    font-weight: 600;
}

.formatted-message pre,
.issue-text-bubble pre,
#tprevDescription pre,
.ql-editor pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    overflow-x: auto;
    margin: 0.75rem 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.formatted-message code:not(pre code),
.issue-text-bubble code:not(pre code),
#tprevDescription code:not(pre code),
.ql-editor code:not(pre code) {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary, #6366f1);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.formatted-message img,
.issue-text-bubble img,
#tprevDescription img,
.ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.formatted-message blockquote,
.issue-text-bubble blockquote,
#tprevDescription blockquote,
.ql-editor blockquote {
    border-left: 4px solid var(--primary, #6366f1);
    padding-left: 12px;
    margin: 0.75rem 0;
    color: var(--text-soft, #475569);
    font-style: italic;
    background: rgba(99, 102, 241, 0.04);
    padding-top: 4px;
    padding-bottom: 4px;
    border-radius: 0 6px 6px 0;
}

.composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.btn-send-reply {
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary, #6366f1), var(--primary-strong, #4f46e5));
    color: #ffffff;
    font-weight: 700;
    padding: 0.65rem 1.4rem;
    font-size: 0.88rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-send-reply:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

/* Sidebar Column - Natural Page Flow (No sticky, No internal scroll) */
.ticket-sidebar,
.ticket-sidebar-column {
    position: static;
    max-height: none;
    overflow: visible;
}

.sidebar-panel-card {
    padding: 14px 16px !important;
    border-radius: 14px !important;
    margin-bottom: 14px !important;
    background: var(--surface, #ffffff) !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03) !important;
}

.sidebar-panel-card .sidebar-heading {
    font-size: 0.74rem !important;
    margin-bottom: 10px !important;
}

.sidebar-panel-card .control-field-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    margin-bottom: 11px !important;
}

.sidebar-panel-card .control-field-label {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    width: 100% !important;
    margin-bottom: 4px !important;
    font-size: 0.69rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
}

.sidebar-panel-card .control-select {
    display: block !important;
    width: 100% !important;
    height: 38px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 0.42rem 0.65rem !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    color: #0f172a !important;
    background-color: #ffffff !important;
    box-sizing: border-box !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.sidebar-panel-card .control-select:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
    outline: none !important;
}

.btn-xs {
    padding: 2px 6px !important;
    font-size: 0.72rem !important;
    line-height: 1.2;
    border-radius: 6px !important;
}

.escalate-mini-card .btn-outline-danger {
    border-color: rgba(239, 68, 68, 0.4) !important;
    background: rgba(239, 68, 68, 0.04) !important;
    color: #dc2626 !important;
    border-radius: 8px !important;
    font-size: 0.78rem !important;
    transition: all 0.2s ease !important;
}

.escalate-mini-card .btn-outline-danger:hover {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25) !important;
}

.escalate-callout-box {
    background: var(--danger-soft, rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 12px;
    margin-top: 14px;
}

/* Tracking History Stream */
.tracking-stream-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tracking-stream-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.82rem;
}

.stream-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--muted);
    margin-top: 5px;
    flex-shrink: 0;
}

.stream-dot.success {
    background: var(--success);
}

.stream-dot.info {
    background: var(--info);
}

.stream-dot.warning {
    background: var(--amber);
}

.stream-dot.danger {
    background: var(--danger);
}

.stream-dot.secondary {
    background: var(--muted);
}

/* --- Styles from tickets/create.php --- */
.ck-editor__editable_inline {
    min-height: 200px;
    border-bottom-left-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
}

.ck-toolbar {
    border-top-left-radius: 0.375rem !important;
    border-top-right-radius: 0.375rem !important;
}

/* ==========================================================================
   DASHBOARD CUSTOM FILTER & KPI STYLES
   ========================================================================== */

/* Advanced Dynamic Filters & UI Styles */
:root {
    --dash-card-bg: var(--card-bg);
    --dash-border: var(--card-border, #f1f5f9);
    --dash-text-dark: var(--text);
    --dash-text-muted: var(--muted, #64748b);
}

.dashboard-wrapper {
    padding: 1rem 0;
}

.dashboard-banner {
    background: linear-gradient(135deg, var(--sidebar-bg-2) 0%, var(--sidebar-bg) 100%);
    border-radius: 16px;
    padding: 24px 28px;
    color: var(--text, #0f172a);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--card-border, rgba(148, 163, 184, 0.18));
}

[data-theme="dark"] .dashboard-banner,
[data-bs-theme="dark"] .dashboard-banner,
.dark .dashboard-banner {
    background: linear-gradient(135deg, var(--sidebar-bg-2) 0%, var(--sidebar-bg) 100%);
    color: var(--text, #f1f5f9);
    border-color: var(--card-border, rgba(255, 255, 255, 0.08));
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.banner-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading, #0f172a);
    transition: color 0.2s ease-in-out;
}

[data-theme="light"] .banner-title,
[data-bs-theme="light"] .banner-title,
:root:not([data-theme="dark"]) .banner-title {
    color: var(--text-heading, #0f172a);
}

[data-theme="dark"] .banner-title,
[data-bs-theme="dark"] .banner-title,
.dark .banner-title {
    color: #ffffff;
}

.banner-subtext {
    color: var(--muted, #64748b);
    font-size: 0.9rem;
    transition: color 0.2s ease-in-out;
}

[data-theme="dark"] .banner-subtext,
[data-bs-theme="dark"] .banner-subtext,
.dark .banner-subtext {
    color: var(--muted, #8291a7);
}

.user-avatar-lg {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.date-pill {
    display: inline-block;
    background: rgba(148, 163, 184, 0.12);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-soft, #475569);
    border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
}

[data-theme="dark"] .date-pill,
[data-bs-theme="dark"] .date-pill,
.dark .date-pill {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft, #cbd5e1);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Filter Panel Styling */
.filter-panel-card {
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    background: var(--card-bg);
}

.search-input {
    border-radius: 0 8px 8px 0 !important;
    font-size: 0.85rem;
}

.custom-select {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text);
    font-size: 0.85rem;
}

.form-label-sm {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--dash-text-muted);
    margin-bottom: 3px;
}

/* Active Filter Chips */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.filter-chip a {
    color: var(--primary);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.filter-chip a:hover {
    opacity: 1;
}

/* Stats Cards */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--dash-card-bg);
    border: 1px solid var(--dash-border);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.stat-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--dash-text-muted);
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 4px 0;
    color: var(--dash-text-dark);
}

.stat-sub {
    font-size: 0.75rem;
    display: block;
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.bg-indigo-subtle {
    background: var(--primary-soft);
}

.text-indigo {
    color: var(--primary);
}

.bg-teal-subtle {
    background: var(--secondary-soft);
}

.text-teal {
    color: var(--secondary);
}

.text-purple {
    color: var(--primary);
}

.dashboard-card {
    background: var(--dash-card-bg);
    border-radius: 14px;
    border: 1px solid var(--dash-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.ticket-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ticket-feed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid transparent;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.2s ease;
}

.ticket-feed-item:hover {
    background: var(--surface);
    border-color: var(--muted);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.ticket-feed-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ticket-id-tag {
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 6px;
}

.ticket-feed-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dash-text-dark);
}

.ticket-feed-meta {
    font-size: 0.8rem;
    color: var(--dash-text-muted);
}

.ticket-feed-badges {
    display: flex;
    gap: 6px;
}

.action-btn {
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.875rem;
}

.progress-sm {
    height: 6px;
    border-radius: 4px;
    background: var(--border);
}

/* ==========================================================================
   MODERN TABLE CUSTOM VIEW & COLUMN VISIBILITY TOGGLES
   ========================================================================== */

.table-custom-view-menu {
    min-width: 260px;
    padding: 0.75rem 0.5rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--card-bg, #ffffff);
    box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.12);
    z-index: 1050;
}

.table-custom-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-subtle, #e2e8f0);
    margin-bottom: 0.5rem;
}

.table-custom-view-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-heading, #1e293b);
}

.table-col-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text, #334155);
    transition: background 0.15s ease;
}

.table-col-toggle-item:hover {
    background: var(--surface-hover, #f1f5f9);
}

.table-col-toggle-item input[type="checkbox"] {
    cursor: pointer;
    width: 1.15em;
    height: 1.15em;
    border-radius: 4px;
}

/* Dynamic Column Hiding Classes for Tickets Table */
.ticket-data-table.hide-col-id th:nth-child(1),
.ticket-data-table.hide-col-id td:nth-child(1) {
    display: none !important;
}

.ticket-data-table.hide-col-subject th:nth-child(2),
.ticket-data-table.hide-col-subject td:nth-child(2) {
    display: none !important;
}

.ticket-data-table.hide-col-dept th:nth-child(3),
.ticket-data-table.hide-col-dept td:nth-child(3) {
    display: none !important;
}

.ticket-data-table.hide-col-customer th:nth-child(4),
.ticket-data-table.hide-col-customer td:nth-child(4) {
    display: none !important;
}

.ticket-data-table.hide-col-agent th:nth-child(5),
.ticket-data-table.hide-col-agent td:nth-child(5) {
    display: none !important;
}

.ticket-data-table.hide-col-priority th:nth-child(6),
.ticket-data-table.hide-col-priority td:nth-child(6) {
    display: none !important;
}

.ticket-data-table.hide-col-status th:nth-child(7),
.ticket-data-table.hide-col-status td:nth-child(7) {
    display: none !important;
}

.ticket-data-table.hide-col-created th:nth-child(8),
.ticket-data-table.hide-col-created td:nth-child(8) {
    display: none !important;
}

.ticket-data-table.hide-col-actions th:nth-child(9),
.ticket-data-table.hide-col-actions td:nth-child(9) {
    display: none !important;
}

/* Dynamic Column Hiding for My Tickets Table */
.custom-table.hide-my-id th:nth-child(1),
.custom-table.hide-my-id td:nth-child(1) {
    display: none !important;
}

.custom-table.hide-my-subject th:nth-child(2),
.custom-table.hide-my-subject td:nth-child(2) {
    display: none !important;
}

.custom-table.hide-my-dept th:nth-child(3),
.custom-table.hide-my-dept td:nth-child(3) {
    display: none !important;
}

.custom-table.hide-my-status th:nth-child(4),
.custom-table.hide-my-status td:nth-child(4) {
    display: none !important;
}

.custom-table.hide-my-priority th:nth-child(5),
.custom-table.hide-my-priority td:nth-child(5) {
    display: none !important;
}

.custom-table.hide-my-agent th:nth-child(6),
.custom-table.hide-my-agent td:nth-child(6) {
    display: none !important;
}

.custom-table.hide-my-created th:nth-child(7),
.custom-table.hide-my-created td:nth-child(7) {
    display: none !important;
}

.custom-table.hide-my-actions th:nth-child(8),
.custom-table.hide-my-actions td:nth-child(8) {
    display: none !important;
}

/* ==========================================================================
   UNIFIED FILTER BAR SYSTEM (FLEX-NOWRAP GUARANTEED ON ALL PAGES)
   ========================================================================== */
.glass-filter-card {
    background: var(--surface-card, #ffffff) !important;
    border: 1px solid var(--border-subtle, #e2e8f0) !important;
    border-radius: var(--radius-xl, 14px) !important;
    padding: 0.9rem 1.25rem !important;
    margin-bottom: 1.25rem !important;
    box-shadow: var(--shadow-soft, 0 4px 16px rgba(0, 0, 0, 0.03)) !important;
}

.filter-bar-flex {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.75rem !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    padding-bottom: 3px !important;
}

.filter-bar-flex .search-wrapper {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex: 1 1 240px !important;
    min-width: 750px !important;
    max-width: none !important;
    height: 38px !important;
    padding: 0 0.85rem !important;
    border-radius: var(--radius-lg, 10px) !important;
    border: 1px solid var(--border-subtle, #e2e8f0) !important;
    background: var(--bg, #f8fafc) !important;
    transition: all 0.2s ease !important;
}

.filter-bar-flex .search-wrapper:focus-within {
    border-color: var(--brand-primary, #6366f1) !important;
    background: var(--surface, #ffffff) !important;
    box-shadow: 0 0 0 3px var(--primary-glow, rgba(99, 102, 241, 0.15)) !important;
}

.filter-bar-flex .search-wrapper i {
    position: static !important;
    transform: none !important;
    color: var(--muted, #64748b) !important;
    font-size: 0.875rem !important;
    flex-shrink: 0 !important;
}

.filter-bar-flex .search-input {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: var(--text, #0f172a) !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
}

.filter-bar-flex .custom-select {
    flex: 0 1 auto !important;
    min-width: 130px !important;
    max-width: 200px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 2rem 0 0.85rem !important;
    border-radius: var(--radius-lg, 10px) !important;
    border: 1px solid var(--border-subtle, #e2e8f0) !important;
    background-color: var(--bg, #f8fafc) !important;
    color: var(--text-heading, #0f172a) !important;
    font-size: 0.825rem !important;
    font-weight: 600 !important;
    outline: none !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.65rem center !important;
    background-size: 0.85rem !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    transition: all 0.2s ease !important;
}

.filter-bar-flex .custom-select:focus {
    border-color: var(--brand-primary, #6366f1) !important;
    box-shadow: 0 0 0 3px var(--primary-glow, rgba(99, 102, 241, 0.15)) !important;
}

.filter-bar-flex .btn-filter-action {
    height: 38px !important;
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    padding: 0 1.1rem !important;
    border-radius: var(--radius-lg, 10px) !important;
    border: 1px solid var(--primary-border, #c7d2fe) !important;
    background: var(--primary-soft, #eef2ff) !important;
    color: var(--brand-primary, #4338ca) !important;
    font-size: 0.825rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}

.filter-bar-flex .btn-filter-action:hover {
    background: var(--brand-primary, #4338ca) !important;
    color: #ffffff !important;
}

.filter-bar-flex .btn-clear-filter {
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    color: var(--danger, #ef4444) !important;
    text-decoration: none !important;
    font-size: 0.825rem !important;
    font-weight: 600 !important;
    padding: 0 0.75rem !important;
    transition: opacity 0.2s ease !important;
}

.filter-bar-flex .btn-clear-filter:hover {
    opacity: 0.8 !important;
}

/* ==========================================================================
   UNIFIED MODERN TABLE STYLES & CLEAN BORDERS (FIGMA-GRADE)
   ========================================================================== */
.table-card,
.ticket-table-card,
.dashboard-card .table-responsive {
    background: var(--surface-card, var(--surface, #ffffff)) !important;
    border: 1px solid var(--border-subtle, rgba(226, 232, 240, 0.8)) !important;
    border-radius: var(--radius-xl, 14px) !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-soft, 0 4px 16px rgba(0, 0, 0, 0.03)) !important;
}

/* Base table layout: clean, no cell borders, separate collapse */
table,
.table,
.custom-table,
.custom-data-table,
.ticket-data-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    text-align: left !important;
    margin-bottom: 0 !important;
    background-color: transparent !important;
    color: var(--text, #0f172a) !important;
    border: none !important;
}

/* Remove all vertical cell borders across every table */
table th,
table td,
.table th,
.table td,
.custom-table th,
.custom-table td,
.custom-data-table th,
.custom-data-table td,
.ticket-data-table th,
.ticket-data-table td,
.dashboard-card table th,
.dashboard-card table td {
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

/* Headers: clean subtle background, uppercase small muted text */
table thead th,
.table thead th,
.custom-table th,
.custom-table thead th,
.custom-data-table thead th,
.ticket-data-table thead th,
.dashboard-card table thead th {
    background: var(--table-header-bg, #f8fafc) !important;
    padding: 0.85rem 1.15rem !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: var(--text-muted, var(--text-soft, #64748b)) !important;
    border-bottom: 1px solid var(--border-subtle, rgba(226, 232, 240, 0.8)) !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

/* Body rows: subtle bottom divider only */
table tbody td,
.table tbody td,
.custom-table td,
.custom-table tbody td,
.custom-data-table tbody td,
.ticket-data-table tbody td,
.dashboard-card table tbody td {
    padding: 0.95rem 1.15rem !important;
    border-bottom: 1px solid var(--border-subtle, rgba(226, 232, 240, 0.6)) !important;
    vertical-align: middle !important;
    font-size: 0.875rem !important;
    color: var(--text, #0f172a) !important;
    background-color: transparent !important;
}

/* Last row has no bottom border */
table tr:last-child td,
.table tr:last-child td,
.custom-table tr:last-child td,
.custom-data-table tr:last-child td,
.ticket-data-table tr:last-child td {
    border-bottom: none !important;
}

/* Row Hover */
table tbody tr:hover,
.table tbody tr:hover,
.custom-table tr:hover,
.custom-table tbody tr:hover,
.custom-data-table tbody tr:hover,
.ticket-data-table tbody tr:hover,
.dashboard-card table tbody tr:hover {
    background-color: var(--table-hover-bg, rgba(99, 102, 241, 0.03)) !important;
}

/* ==========================================================================
   SEGMENTED NAV & DEPARTMENT TABS CUSTOM VIEW DROPDOWN
   ========================================================================== */
/* Segmented nav styles are globally unified in the main navigation section */

.segmented-dropdown-menu {
    max-height: 420px !important;
    width: 330px !important;
    border-radius: var(--radius-xl, 14px) !important;
    border: 1px solid var(--border-subtle, #e2e8f0) !important;
    background: var(--surface, #ffffff) !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16) !important;
    z-index: 1070 !important;
    padding: 0.5rem !important;
}

.dept-dropdown-list {
    max-height: 290px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.dept-dropdown-item {
    font-size: 0.825rem !important;
    color: var(--text, #0f172a) !important;
    border-radius: 8px !important;
    padding: 0.5rem 0.75rem !important;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

.dept-dropdown-item:hover {
    background-color: var(--surface-hover, #f1f5f9) !important;
    color: var(--brand-primary, #6366f1) !important;
}

.dept-dropdown-item.active {
    background-color: var(--primary-soft, rgba(99, 102, 241, 0.12)) !important;
    color: var(--brand-primary, #6366f1) !important;
    font-weight: 700 !important;
}

/* ==========================================================================
   AGENT PANEL WORKSPACE & CARDS SYSTEM
   ========================================================================== */
.agent-panel-page {
    width: 100%;
    padding: 0.5rem 0 2rem;
}

.panel-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-heading);
    margin: 0;
    letter-spacing: -0.02em;
}

.panel-subtitle {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 4px 0 0 0;
}

.btn-primary-action {
    background: var(--brand-primary);
    color: #ffffff !important;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.btn-primary-action:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.agent-workspace-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .agent-workspace-grid {
        grid-template-columns: 1fr 340px;
    }
}

.agent-card {
    background: var(--surface-card, var(--surface));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.workspace-toolbar {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: var(--surface-alt);
}

.tab-switcher {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
}

.tab-btn {
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover,
.tab-btn.active {
    background: var(--surface);
    color: var(--brand-primary);
    border-color: var(--primary-border, var(--border));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.tab-badge {
    background: var(--surface-hover);
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
}

.tab-btn.active .tab-badge {
    background: var(--primary-soft);
    color: var(--brand-primary);
}

.toolbar-search {
    position: relative;
    min-width: 220px;
    flex: 0 1 280px;
}

.toolbar-search .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.8rem;
    pointer-events: none;
}

.toolbar-search .search-input {
    width: 100%;
    padding: 0.5rem 0.85rem 0.5rem 2.2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg);
    color: var(--text);
    font-size: 0.825rem;
    outline: none;
    transition: all 0.2s ease;
}

.toolbar-search .search-input:focus {
    border-color: var(--brand-primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.agent-ticket-feed {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Modern Ticket Card - Screenshot 3: Clean White background, 5px border-left with priority colors */
.ticket-row-item,
.ticket-row-item.priority-critical,
.ticket-row-item.priority-high,
.ticket-row-item.priority-medium,
.ticket-row-item.priority-low {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-xl, 14px);
    background: #ffffff !important;
    border: 1px solid var(--border-subtle, #e2e8f0) !important;
    border-left-width: 5px !important;
    border-left-style: solid !important;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    color: var(--text, #1e293b) !important;
}

.ticket-row-item:hover,
.ticket-row-item.priority-critical:hover,
.ticket-row-item.priority-high:hover,
.ticket-row-item.priority-medium:hover,
.ticket-row-item.priority-low:hover {
    border-color: var(--primary-border, #cbd5e1) !important;
    border-left-width: 5px !important;
    background: #f8fafc !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.ticket-row-item.priority-critical {
    border-left-color: #ef4444 !important;
}

.ticket-row-item.priority-high {
    border-left-color: #f97316 !important;
}

.ticket-row-item.priority-medium {
    border-left-color: #0ea5e9 !important;
}

.ticket-row-item.priority-low {
    border-left-color: #10b981 !important;
}

.ticket-row-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.ticket-number {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    font-size: 0.775rem;
    color: #0284c7 !important;
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    letter-spacing: -0.01em;
}

.priority-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1;
}

.priority-pill.priority-critical {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
}

.priority-pill.priority-high {
    background: #fff7ed !important;
    color: #ea580c !important;
    border: 1px solid #fed7aa !important;
}

.priority-pill.priority-medium {
    background: #f0f9ff !important;
    color: #0284c7 !important;
    border: 1px solid #bae6fd !important;
}

.priority-pill.priority-low {
    background: #f0fdf4 !important;
    color: #16a34a !important;
    border: 1px solid #bbf7d0 !important;
}

.ticket-subject-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0.25rem 0 0.4rem;
    color: var(--text-heading, #0f172a);
}

.ticket-subject-title a {
    color: var(--text-heading, #0f172a) !important;
    text-decoration: none;
    transition: color 0.15s ease;
}

.ticket-subject-title a:hover {
    color: var(--brand-primary, #4f46e5) !important;
}

.ticket-meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--muted);
    flex-wrap: wrap;
}

.ticket-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-ticket-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--surface-hover);
    color: var(--text-heading);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-ticket-action:hover {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
}

.widget-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-alt);
}

.widget-title {
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-list {
    display: flex;
    flex-direction: column;
}

.team-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.team-item:last-child {
    border-bottom: none;
}

.team-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-hover);
    color: var(--text-heading);
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.2;
}

.user-role {
    font-size: 0.725rem;
    color: var(--muted);
}

.user-workload-badge {
    text-align: right;
}

.user-workload-badge .count {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-heading);
    display: block;
}

.user-workload-badge .label {
    font-size: 0.65rem;
    color: var(--muted);
}

/* ==========================================================================
   CONSOLIDATED CSS — Migrated from inline <style> blocks across all pages
   All page-specific CSS centralized here for single-source maintenance.
   ========================================================================== */

/* ==========================================================================
   1. UTILITY CLASSES (Replaces most common inline styles across project)
   ========================================================================== */

/* --- Display Utilities --- */
.d-hidden {
    display: none;
}

/* --- Color Utilities (text) --- */
.text-heading {
    color: var(--text-heading);
}

.text-muted-var {
    color: var(--muted);
}

.text-primary-var {
    color: var(--primary);
}

.text-soft-var {
    color: var(--text-soft);
}

/* --- Width/Height Utilities --- */
.w-auto {
    width: auto;
}

.w-40 {
    width: 40px;
}

.w-50 {
    width: 50px;
}

.w-90 {
    width: 90px;
}

.w-100px {
    width: 100px;
}

.w-110 {
    width: 110px;
}

.w-120 {
    width: 120px;
}

.w-140 {
    width: 140px;
}

.w-150 {
    width: 150px;
}

.w-220 {
    width: 220px;
}

.w-250 {
    width: 250px;
}

.mw-130 {
    max-width: 130px;
}

.mw-140 {
    max-width: 140px;
}

.mw-150 {
    max-width: 150px;
}

.mw-180 {
    max-width: 180px;
}

.mw-200 {
    max-width: 200px;
}

.mw-220 {
    max-width: 220px;
}

.mw-240 {
    max-width: 240px;
}

.mw-250 {
    max-width: 250px;
}

.mw-260 {
    max-width: 260px;
}

.mw-320 {
    max-width: 320px;
}

.mw-480 {
    max-width: 480px;
}


.mnw-110 {
    min-width: 110px;
}

.mnw-180 {
    min-width: 180px;
}

.mnw-200 {
    min-width: 200px;
}

.mnw-220 {
    min-width: 220px;
}

.h-35 {
    height: 35px;
}

.h-260 {
    height: 260px;
}

/* --- Square / Circle Icon Boxes --- */
.icon-box-42 {
    width: 42px;
    height: 42px;
}

.icon-box-44 {
    width: 44px;
    height: 44px;
}

.icon-box-48 {
    width: 48px;
    height: 48px;
}

.icon-box-52 {
    width: 52px;
    height: 52px;
}

.icon-box-3rem {
    width: 3rem;
    height: 3rem;
}

.icon-box-sm {
    width: 20px;
    height: 20px;
    font-size: 0.6rem;
}

/* --- Font Size Utilities --- */
.fs-65 {
    font-size: 0.65rem;
}

.fs-70 {
    font-size: 0.7rem;
}

.fs-72 {
    font-size: 0.72rem;
}

.fs-75 {
    font-size: 0.75rem;
}

.fs-76 {
    font-size: 0.76rem;
}

.fs-80 {
    font-size: 0.8rem;
}

.fs-83 {
    font-size: 0.83rem;
}

.fs-85 {
    font-size: 0.85rem;
}

.fs-11px {
    font-size: 11px;
}

/* --- Spacing Utilities --- */
.ls-05 {
    letter-spacing: 0.5px;
}

.ls-1 {
    letter-spacing: 1px;
}

/* --- Height Bar Utilities (Progress bars) --- */
.bar-h-6 {
    height: 6px;
}

.bar-h-8 {
    height: 8px;
}

/* --- Background Surface Utilities --- */
.bg-surface {
    background: var(--surface);
}

.bg-surface-alt {
    background: var(--surface-alt);
}

.bg-surface-card {
    background: var(--surface-card);
}

/* --- Border Utilities --- */
.border-subtle {
    border-color: var(--border-subtle) !important;
}

.border-subtle-bg {
    background: var(--surface-alt);
    border-color: var(--border-subtle) !important;
}

/* --- Combined Utility Patterns --- */
.surface-card-bordered {
    background: var(--surface-card);
    border-color: var(--border-subtle);
}

.surface-alt-bordered {
    background: var(--surface-alt);
    border-color: var(--border-subtle);
}

.surface-alt-bottom {
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border-subtle);
}

.surface-muted-bordered {
    background: var(--surface);
    color: var(--muted);
    border-color: var(--border-subtle);
}

.badge-primary-soft {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary-border);
}

.grab-handle-surface {
    background: var(--surface-alt);
    border-color: var(--border-subtle);
    cursor: grab;
}

/* --- Overflow Scroll Containers --- */
.scroll-y-240 {
    max-height: 240px;
    overflow-y: auto;
}

.scroll-y-250 {
    max-height: 250px;
    overflow-y: auto;
}

.scroll-y-280 {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.scroll-y-200 {
    max-height: 200px;
    overflow-y: auto;
}

/* --- Misc Inline Utilities --- */
.pre-wrap {
    white-space: pre-wrap;
}

.lh-15 {
    line-height: 1.5;
}

.lh-18 {
    line-height: 1.8;
}

.flex-fill-min0 {
    min-width: 0;
    flex: 1;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.sticky-bottom-bar {
    position: sticky;
    bottom: 0;
    background: var(--surface-alt);
    z-index: 1;
}

/* --- Track Indent Badges --- */
.track-badge-sm {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.track-badge-xs {
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.track-label-sm {
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

.track-uppercase-sm {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* --- Workflow Helper Layout --- */
.workflow-col-narrow {
    width: 120px;
}

.workflow-col-fill {
    min-width: 200px;
    flex: 1;
}

.workflow-scroll-sm {
    max-height: 190px;
    overflow-y: auto;
}

.workflow-approval-border {
    border: 2px solid var(--primary-border);
    background: var(--card-bg);
}

/* --- Navbar Specific Inline Replacements --- */
.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

.nav-meta-small {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.nav-mini-input {
    font-size: 11px;
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

/* --- Table Column Width --- */
.col-pct-20 {
    width: 20%;
}

.col-pct-30 {
    width: 30%;
}

.col-pct-35 {
    width: 35%;
}

.col-pct-40 {
    width: 40%;
}

/* --- Approval Flex Layout --- */
.approval-flex-col {
    flex: 1;
    max-width: 320px;
    min-width: 180px;
}

/* --- Oracle Audit Gradient Header --- */
.oracle-audit-header-gradient,
.modal-content .oracle-audit-header-gradient,
.modal-header.oracle-audit-header-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    background-color: #0f172a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    padding: 1.15rem 1.5rem !important;
}

.oracle-audit-header-gradient .modal-title,
.modal-header.oracle-audit-header-gradient .modal-title {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.oracle-audit-header-gradient #oracleAuditSubTitle {
    color: #cbd5e1 !important;
}

.oracle-audit-header-gradient .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
    opacity: 0.85 !important;
}

.oracle-audit-header-gradient .btn-close:hover {
    opacity: 1 !important;
}

/* --- Min Height --- */
.mnh-22 {
    min-height: 22px;
}

.mnh-20 {
    min-height: 20px;
}

.mnh-420 {
    min-height: 420px;
}

/* ==========================================================================
   2. SIDEBAR STYLES (Migrated from includes/sidebar.php)
   ========================================================================== */
.sidebar {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    left: 0;
    background: var(--sidebar-bg, #ffffff);
    color: var(--text-soft, #334155);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border, rgba(148, 163, 184, 0.22));
    box-sizing: border-box;
    overflow-x: hidden !important;
    overflow-y: hidden;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.2s ease,
        border-color 0.2s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.25rem 1.15rem;
    border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.22));
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-text h6 {
    color: var(--text-heading, #0f172a);
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
    margin: 0;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.brand-text span {
    display: block;
    color: var(--primary);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-toggle-btn {
    background: var(--surface-alt, #f8fafc);
    border: 1px solid var(--border, rgba(148, 163, 184, 0.22));
    color: var(--muted, #64748b);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s ease-in-out;
}

.sidebar-toggle-btn:hover {
    color: var(--primary);
    background: var(--surface-hover, #f1f5f9);
    border-color: var(--primary-border, var(--primary));
}

.sidebar-nav {
    display: block;
    padding: 0.85rem 0.65rem;
    flex-grow: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
    scrollbar-color: var(--border, rgba(148, 163, 184, 0.35)) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border, rgba(148, 163, 184, 0.35));
    border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--muted, rgba(148, 163, 184, 0.6));
}

.nav-section {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted, #64748b);
    padding: 1rem 0.75rem 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    user-select: none;
}

.nav-section:first-child {
    padding-top: 0.25rem;
}

.sidebar .nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.55rem 0.75rem !important;
    color: var(--text-soft, #334155) !important;
    font-size: 0.825rem !important;
    font-weight: 500 !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    transition: all 0.18s ease-in-out;
    width: 100% !important;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 2px;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted, #64748b);
    flex-shrink: 0;
    transition: color 0.18s ease-in-out;
}

.sidebar .nav-link:not(.active):hover {
    color: var(--primary) !important;
    background-color: rgba(var(--primary-rgb, 79, 70, 229), 0.08) !important;
}

.sidebar .nav-link:not(.active):hover i {
    color: var(--primary) !important;
}

.sidebar .nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.sidebar .nav-link.active i {
    color: #ffffff !important;
}

.sidebar-footer {
    padding: 0.85rem 0.65rem;
    border-top: 1px solid var(--border, rgba(148, 163, 184, 0.22));
    margin-top: auto;
    flex-shrink: 0;
    background: var(--surface-alt, #f8fafc);
}

.logout-link {
    color: var(--danger) !important;
}

.logout-link i {
    color: var(--danger) !important;
}

.logout-link:hover {
    background-color: rgba(239, 68, 68, 0.12) !important;
    color: var(--danger) !important;
}

/* ==========================================================================
   2.1 SIDEBAR LIGHT THEME EXPLICIT OVERRIDES
   ========================================================================== */
[data-theme="light"] .sidebar,
:root:not([data-theme="dark"]):not(.dark) .sidebar {
    background: var(--sidebar-bg, #ffffff);
    border-right-color: var(--border, rgba(148, 163, 184, 0.22));
    color: var(--text-soft, #334155);
}

[data-theme="light"] .sidebar-header,
:root:not([data-theme="dark"]):not(.dark) .sidebar-header {
    border-bottom-color: var(--border, rgba(148, 163, 184, 0.22));
}

[data-theme="light"] .brand-text h6,
:root:not([data-theme="dark"]):not(.dark) .brand-text h6 {
    color: var(--text-heading, #0f172a);
}

[data-theme="light"] .sidebar-toggle-btn,
:root:not([data-theme="dark"]):not(.dark) .sidebar-toggle-btn {
    background: var(--surface-alt, #f8fafc);
    border-color: var(--border, rgba(148, 163, 184, 0.22));
    color: var(--muted, #64748b);
}

[data-theme="light"] .sidebar-toggle-btn:hover,
:root:not([data-theme="dark"]):not(.dark) .sidebar-toggle-btn:hover {
    color: var(--primary);
    background: var(--surface-hover, #f1f5f9);
    border-color: var(--primary-border, var(--primary));
}

[data-theme="light"] .nav-section,
:root:not([data-theme="dark"]):not(.dark) .nav-section {
    color: var(--muted, #64748b);
}

[data-theme="light"] .sidebar .nav-link:not(.active),
:root:not([data-theme="dark"]):not(.dark) .sidebar .nav-link:not(.active) {
    color: var(--text-soft, #334155) !important;
}

[data-theme="light"] .sidebar .nav-link:not(.active) i,
:root:not([data-theme="dark"]):not(.dark) .sidebar .nav-link:not(.active) i {
    color: var(--muted, #64748b);
}

[data-theme="light"] .sidebar .nav-link:not(.active):hover,
:root:not([data-theme="dark"]):not(.dark) .sidebar .nav-link:not(.active):hover {
    color: var(--primary) !important;
    background-color: rgba(var(--primary-rgb, 79, 70, 229), 0.08) !important;
}

[data-theme="light"] .sidebar .nav-link:not(.active):hover i,
:root:not([data-theme="dark"]):not(.dark) .sidebar .nav-link:not(.active):hover i {
    color: var(--primary) !important;
}

[data-theme="light"] .sidebar-footer,
:root:not([data-theme="dark"]):not(.dark) .sidebar-footer {
    background: var(--surface-alt, #f8fafc);
    border-top-color: var(--border, rgba(148, 163, 184, 0.22));
}

/* ==========================================================================
   2.2 SIDEBAR DARK THEME EXPLICIT OVERRIDES
   ========================================================================== */
[data-theme="dark"] .sidebar,
.dark .sidebar {
    background: var(--sidebar-bg, #070a10);
    border-right-color: var(--border, rgba(255, 255, 255, 0.08));
    color: var(--text-soft, #cbd5e1);
}

[data-theme="dark"] .sidebar-header,
.dark .sidebar-header {
    border-bottom-color: var(--border, rgba(255, 255, 255, 0.08));
}

[data-theme="dark"] .brand-text h6,
.dark .brand-text h6 {
    color: #f8fafc;
}

[data-theme="dark"] .sidebar-toggle-btn,
.dark .sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--muted, #8291a7);
}

[data-theme="dark"] .sidebar-toggle-btn:hover,
.dark .sidebar-toggle-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .sidebar-nav,
.dark .sidebar-nav {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb,
.dark .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb:hover,
.dark .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .nav-section,
.dark .nav-section {
    color: var(--muted, #8291a7);
}

[data-theme="dark"] .sidebar .nav-link:not(.active),
.dark .sidebar .nav-link:not(.active) {
    color: var(--text-soft, #cbd5e1) !important;
}

[data-theme="dark"] .sidebar .nav-link:not(.active) i,
.dark .sidebar .nav-link:not(.active) i {
    color: var(--muted, #8291a7);
}

[data-theme="dark"] .sidebar .nav-link:not(.active):hover,
.dark .sidebar .nav-link:not(.active):hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.06) !important;
}

[data-theme="dark"] .sidebar .nav-link:not(.active):hover i,
.dark .sidebar .nav-link:not(.active):hover i {
    color: var(--sidebar-accent, var(--primary)) !important;
}

[data-theme="dark"] .sidebar-footer,
.dark .sidebar-footer {
    background: rgba(0, 0, 0, 0.25);
    border-top-color: var(--border, rgba(255, 255, 255, 0.08));
}

/* ==========================================================================
   2.3 SIDEBAR ACTIVE LINK (WHITE TEXT & ICON, THEME BACKGROUND)
   ========================================================================== */
.sidebar .nav-link.active,
.sidebar .nav-link.active .nav-label,
.sidebar .nav-link.active span,
.sidebar .nav-link.active i,
[data-theme="light"] .sidebar .nav-link.active,
[data-theme="light"] .sidebar .nav-link.active .nav-label,
[data-theme="light"] .sidebar .nav-link.active span,
[data-theme="light"] .sidebar .nav-link.active i,
:root:not([data-theme="dark"]):not(.dark) .sidebar .nav-link.active,
:root:not([data-theme="dark"]):not(.dark) .sidebar .nav-link.active .nav-label,
:root:not([data-theme="dark"]):not(.dark) .sidebar .nav-link.active span,
:root:not([data-theme="dark"]):not(.dark) .sidebar .nav-link.active i,
[data-theme="dark"] .sidebar .nav-link.active,
[data-theme="dark"] .sidebar .nav-link.active .nav-label,
[data-theme="dark"] .sidebar .nav-link.active span,
[data-theme="dark"] .sidebar .nav-link.active i,
.dark .sidebar .nav-link.active,
.dark .sidebar .nav-link.active .nav-label,
.dark .sidebar .nav-link.active span,
.dark .sidebar .nav-link.active i {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}

.sidebar .nav-link.active,
[data-theme="light"] .sidebar .nav-link.active,
:root:not([data-theme="dark"]):not(.dark) .sidebar .nav-link.active,
[data-theme="dark"] .sidebar .nav-link.active,
.dark .sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 14px var(--primary-glow) !important;
}

.sidebar .nav-link.active:hover,
[data-theme="light"] .sidebar .nav-link.active:hover,
:root:not([data-theme="dark"]):not(.dark) .sidebar .nav-link.active:hover,
[data-theme="dark"] .sidebar .nav-link.active:hover,
.dark .sidebar .nav-link.active:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 6px 18px var(--primary-glow) !important;
}

.sidebar .nav-link.active:hover i,
[data-theme="light"] .sidebar .nav-link.active:hover i,
:root:not([data-theme="dark"]):not(.dark) .sidebar .nav-link.active:hover i,
[data-theme="dark"] .sidebar .nav-link.active:hover i,
.dark .sidebar .nav-link.active:hover i {
    color: #ffffff !important;
}

.sidebar.collapsed {
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section {
    display: none !important;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 1.25rem 0.25rem;
}

.sidebar.collapsed .brand-box {
    display: none;
}

.sidebar.collapsed .sidebar-nav {
    padding: 0.85rem 0.35rem;
}

.sidebar.collapsed .nav-link {
    justify-content: center !important;
    padding: 0.65rem 0 !important;
    gap: 0 !important;
}

.sidebar.collapsed .nav-link i {
    font-size: 1.05rem;
    width: auto;
}

.sidebar.collapsed .sidebar-footer {
    padding: 0.85rem 0.35rem;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        z-index: 1200 !important;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.6) !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0) !important;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1190;
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    .sidebar-backdrop.active {
        display: block;
        opacity: 1;
    }

    .sidebar-mobile-close {
        display: flex !important;
    }
}

@media (min-width: 992px) {
    .sidebar-backdrop {
        display: none !important;
    }

    .sidebar-mobile-close {
        display: none !important;
    }
}

/* ==========================================================================
   3. AGENTS PAGE STYLES (Migrated from agents.php)
   ========================================================================== */
.stats-overview-card {
    position: relative !important;
    z-index: 40 !important;
    overflow: visible !important;
}

.stats-overview-card.is-dropdown-open,
.stats-overview-card:has(.custom-view-dropdown.show) {
    z-index: 1050 !important;
}

.filter-toolbar-card {
    position: relative !important;
    z-index: 20 !important;
    overflow: visible !important;
}

.custom-view-dropdown {
    position: relative;
}

.custom-view-dropdown.show {
    z-index: 1060 !important;
}

.custom-view-panel {
    z-index: 1070 !important;
    box-shadow: 0 20px 45px -4px rgba(15, 23, 42, 0.22), 0 8px 16px -2px rgba(15, 23, 42, 0.12) !important;
}

/* ==========================================================================
   4. ORACLE DB ADMIN STYLES (Migrated from admin/oracle-db.php)
   ========================================================================== */

/* Enterprise Oracle Database & Dynamic Form Builder */
:root {
    --oracle-red: #dc2626;
    --oracle-red-subtle: rgba(220, 38, 38, 0.08);
    --oracle-red-border: rgba(220, 38, 38, 0.22);
    --oracle-red-glow: rgba(220, 38, 38, 0.16);
}

/* Guaranteed Opaque Solid Modals (Fixes See-Through Bug) */
.modal-dialog {
    z-index: 1055 !important;
}

.modal-content {
    background: var(--modal-bg) !important;
    background-color: var(--modal-bg, #ffffff) !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    border-radius: 1rem !important;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.08) !important;
    color: var(--text, #0f172a) !important;
    overflow: visible !important;
}

.modal-header {
    background: var(--surface-alt) !important;
    background-color: var(--surface-alt, #f8fafc) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
    padding: 1.15rem 1.5rem !important;
}

.modal-body {
    background: var(--modal-bg) !important;
    background-color: var(--modal-bg, #ffffff) !important;
    padding: 1.5rem !important;
}

.modal-footer {
    background: var(--surface-alt) !important;
    background-color: var(--surface-alt, #f8fafc) !important;
    border-top: 1px solid rgba(148, 163, 184, 0.2) !important;
    padding: 1rem 1.5rem !important;
}

.modal-backdrop.show {
    opacity: 0.65 !important;
    background-color: #090d16 !important;
    backdrop-filter: blur(4px);
}

.modal-inner-box {
    background: var(--surface-alt) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.75rem !important;
    padding: 1.1rem !important;
}

.modal .form-control,
.modal .form-select {
    background-color: #ffffff !important;
    border: 1px solid var(--input-border) !important;
    color: #0f172a !important;
    border-radius: 0.5rem !important;
    font-size: 0.8rem !important;
    padding: 0.55rem 0.75rem !important;
    height: 38px !important;
    line-height: 1.4 !important;
}

.modal textarea.form-control {
    height: auto !important;
    min-height: 60px !important;
}

.modal .input-group {
    height: 38px !important;
}

.modal .input-group>.input-group-text {
    background-color: #f1f5f9 !important;
    border: 1px solid var(--input-border) !important;
    border-right: none !important;
    border-top-left-radius: 0.5rem !important;
    border-bottom-left-radius: 0.5rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    color: #64748b !important;
    font-size: 0.8rem !important;
    padding: 0.55rem 0.75rem !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
}

.modal .input-group>.form-control {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-radius: 0 0.5rem 0.5rem 0 !important;
}

.modal .input-group:has(.btn)>.form-control,
.modal .input-group>.form-control:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.modal .input-group>.btn {
    border: 1px solid var(--input-border) !important;
    border-left: none !important;
    border-top-right-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
    background-color: #f8fafc !important;
    color: #64748b !important;
    padding: 0.55rem 0.75rem !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal .input-group>.btn:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

.modal .form-control:focus,
.modal .form-select:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.modal .form-label {
    color: #334155 !important;
    font-weight: 600 !important;
    font-size: 0.74rem !important;
    margin-bottom: 0.35rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    min-height: 18px !important;
    white-space: nowrap !important;
}

.modal .form-label.justify-content-between {
    justify-content: space-between !important;
}

.modal-section-title {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Oracle Page Cards & Interactive Elements */
.oracle-page-card {
    background: var(--card-bg, #ffffff) !important;
    border: 1px solid var(--card-border, rgba(148, 163, 184, 0.2)) !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02) !important;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.drag-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
}

.drag-item:hover {
    border-left-color: var(--primary, #6366f1);
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.drag-item.dragging {
    opacity: 0.45;
    background: var(--surface-hover) !important;
    border: 2px dashed #6366f1 !important;
    transform: scale(0.99);
}

.drag-item.drag-over {
    border-top: 2px solid #6366f1;
}

.drag-handle {
    cursor: grab;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.drag-handle:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--primary, #6366f1) !important;
}

.drag-item:active .drag-handle {
    cursor: grabbing;
}

.db-test-result,
.entity-test-result,
.modal-test-result {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    transition: all 0.25s ease;
    line-height: 1.5;
}

.mode-badge-ords {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.connection-spec-item {
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    background: var(--surface-alt, #f8fafc);
    border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.15));
}

/* Sub-navigation tabs & DataTables Explorer Styles */
.subtab-link {
    color: var(--muted) !important;
    border-radius: 0.5rem !important;
    transition: all 0.2s ease !important;
}

.subtab-link.active {
    background-color: var(--card-bg, #ffffff) !important;
    color: var(--primary, #4f46e5) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.dt-schema-tables th,
.dt-schema-procs th,
.viewer-dt-table th {
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-weight: 700 !important;
    background-color: var(--surface-alt, #f8fafc) !important;
    color: var(--muted) !important;
    border-bottom: 2px solid var(--border-subtle) !important;
    white-space: nowrap !important;
}

.dt-schema-tables td,
.dt-schema-procs td,
.viewer-dt-table td {
    font-size: 0.76rem !important;
}

/* Unified Matrix Studio Table Styling */
.tablePageBindings-matrix {
    table-layout: fixed !important;
    width: 100% !important;
}

.tablePageBindings-matrix th {
    font-size: 0.70rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    font-weight: 700 !important;
    background-color: var(--surface-alt, #f8fafc) !important;
    color: var(--muted) !important;
    border-bottom: 2px solid var(--border-subtle) !important;
    padding: 0.65rem 0.5rem !important;
    white-space: nowrap !important;
}

.tablePageBindings-matrix td {
    padding: 0.65rem 0.5rem !important;
    vertical-align: middle !important;
}

.query-code-snippet {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.btn-canvas-preview {
    transition: all 0.2s ease;
}

.btn-canvas-preview:not(.btn-primary) i {
    color: var(--primary, #4f46e5);
}

.btn-canvas-preview.btn-primary i,
.btn-canvas-preview.active i {
    color: #ffffff !important;
}

/* Oracle Modal Header Contrast & Dark Theme Uniformity */
.oracle-modal-header,
.modal-content .oracle-modal-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    padding: 1.15rem 1.5rem !important;
}

.oracle-modal-header .modal-title {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
}

.oracle-modal-header span,
.oracle-modal-header i {
    color: #94a3b8 !important;
}

.oracle-modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.85;
}

.oracle-modal-header .btn-close:hover {
    opacity: 1;
}

/* Modern Toggle Switch (.form-switch) - High Contrast Sliding Pill */
.form-check.form-switch,
.form-switch {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    min-height: 1.5rem !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
}

.form-switch .form-check-input,
.form-switch .form-check-input[type="checkbox"],
.form-switch input[type="checkbox"],
.custom-toggle-item .form-check-input,
.custom-toggle-item input[type="checkbox"],
input[type="checkbox"].form-switch-input,
input[type="checkbox"].toggle-switch,
input[type="checkbox"].col-toggle-chk,
input[type="checkbox"].card-toggle-chk,
input[type="checkbox"].modern-toggle-chk {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 2.35rem !important;
    height: 1.25rem !important;
    min-width: 2.35rem !important;
    max-width: 2.35rem !important;
    min-height: 1.25rem !important;
    max-height: 1.25rem !important;
    aspect-ratio: auto !important;
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 9999px !important;
    transition: background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s ease, box-shadow 0.22s ease !important;
    border: 1.5px solid #cbd5e1 !important;
    background-color: #e2e8f0 !important;
    background-image: none !important;
    cursor: pointer !important;
    vertical-align: middle !important;
    position: relative !important;
    flex-shrink: 0 !important;
    align-self: center !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08) !important;
    outline: none !important;
}

.form-switch .form-check-input::before,
.form-switch .form-check-input[type="checkbox"]::before,
.form-switch input[type="checkbox"]::before,
.custom-toggle-item .form-check-input::before,
.custom-toggle-item input[type="checkbox"]::before,
input[type="checkbox"].form-switch-input::before,
input[type="checkbox"].toggle-switch::before,
input[type="checkbox"].col-toggle-chk::before,
input[type="checkbox"].card-toggle-chk::before,
input[type="checkbox"].modern-toggle-chk::before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    top: 1px !important;
    left: 1px !important;
    width: calc(1.25rem - 5px) !important;
    height: calc(1.25rem - 5px) !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 1px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    transform: translateX(0) scale(1) !important;
    font-size: 0 !important;
    line-height: normal !important;
}

.form-switch .form-check-input:checked,
.form-switch .form-check-input[type="checkbox"]:checked,
.form-switch input[type="checkbox"]:checked,
.custom-toggle-item .form-check-input:checked,
.custom-toggle-item input[type="checkbox"]:checked,
input[type="checkbox"].form-switch-input:checked,
input[type="checkbox"].toggle-switch:checked,
input[type="checkbox"].col-toggle-chk:checked,
input[type="checkbox"].card-toggle-chk:checked,
input[type="checkbox"].modern-toggle-chk:checked {
    background-color: var(--primary, #0ea5e9) !important;
    border-color: var(--primary, #0ea5e9) !important;
    box-shadow: 0 0 0 3px var(--primary-glow, rgba(14, 165, 233, 0.2)) !important;
}

.form-switch .form-check-input:checked::before,
.form-switch .form-check-input[type="checkbox"]:checked::before,
.form-switch input[type="checkbox"]:checked::before,
.custom-toggle-item .form-check-input:checked::before,
.custom-toggle-item input[type="checkbox"]:checked::before,
input[type="checkbox"].form-switch-input:checked::before,
input[type="checkbox"].toggle-switch:checked::before,
input[type="checkbox"].col-toggle-chk:checked::before,
input[type="checkbox"].card-toggle-chk:checked::before,
input[type="checkbox"].modern-toggle-chk:checked::before {
    transform: translateX(1.1rem) scale(1) !important;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    font-size: 0.76rem !important;
    padding: 0.3rem 0.55rem !important;
    border-radius: 0.4rem !important;
    border: 1px solid var(--input-border) !important;
    background: var(--modal-bg) !important;
}

.viewer-dt-container {
    min-height: 220px;
}

.json-preview-box {
    background: #0f172a;
    color: #38bdf8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    max-height: 350px;
    overflow-y: auto;
}

/* Strict Two-Tier Tab Isolation */
#oracleTabContent>.tab-pane {
    display: none !important;
}

#oracleTabContent>.tab-pane.active,
#oracleTabContent>.tab-pane.show.active {
    display: block !important;
}

.db-subtab-content>.tab-pane {
    display: none !important;
}

.db-subtab-content>.tab-pane.active,
.db-subtab-content>.tab-pane.show.active {
    display: block !important;
}

/* ==========================================================================
   5. REPLY TEMPLATES PAGE (Migrated from reply-templates.php)
   ========================================================================== */
.reply-template-page {
    padding: 24px;
}

.reply-template-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.reply-template-header h2 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
}

.reply-template-shell {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 20px;
}

.template-panel,
.conversation-panel,
.composer-panel {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.03);
}

.template-panel {
    padding: 18px;
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-title h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.template-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-card {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: var(--bg);
    padding: 14px 14px 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.template-card.active {
    border-color: rgba(79, 70, 229, 0.4);
    background: var(--primary-soft);
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.08);
}

.template-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.template-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.template-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: var(--border);
    color: var(--text-soft);
}

.template-use-case {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.template-card .btn {
    width: 100%;
    justify-content: center;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.conversation-panel {
    padding: 18px;
}

.conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.conversation-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
}

.chat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.conversation-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.message-row {
    display: flex;
    gap: 12px;
}

.message-row.outgoing {
    justify-content: flex-end;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.message-bubble {
    background: var(--surface);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    max-width: 80%;
}

.outgoing .message-bubble {
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.message-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.message-name {
    font-weight: 700;
    color: var(--text);
}

.message-body {
    font-size: 0.9rem;
    color: var(--text-soft);
    white-space: pre-wrap;
}

.reply-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.tool-button {
    border: none;
    background: var(--surface-hover);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-soft);
}

.tool-button.active {
    background: var(--primary);
    color: #fff;
}

.reply-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.send-button {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.attach-button {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

#templateAttachmentInput {
    display: none;
}

.composer-panel {
    padding: 18px;
}

.composer-panel form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-group label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.field-group input,
.field-group select,
.field-group textarea {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    padding: 0.72rem 0.85rem;
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--text);
}

.field-group textarea {
    min-height: 120px;
    resize: vertical;
}

.field-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.quick-variables {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variable-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: var(--surface-hover);
    color: var(--text-soft);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.18);
    cursor: pointer;
    user-select: none;
}

.variable-chip:hover {
    background: var(--border);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

@media (max-width: 980px) {
    .reply-template-shell {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   6. AI REPORTS PAGE (Migrated from ai-reports.php)
   ========================================================================== */
.ai-reports-container {
    padding: 8px 0 40px;
}

.ai-reports-container .card {
    border-radius: 12px;
}

.ai-summary-box {
    min-height: 140px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
}

.ai-reports-container h3 {
    font-weight: 800;
}

.ai-reports-container h6 {
    font-weight: 700;
}

/* ==========================================================================
   7. REPORTS PAGE (Migrated from reports.php)
   ========================================================================== */
@media print {

    .no-print,
    header,
    nav,
    sidebar,
    form,
    .btn {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        margin: 0;
        padding: 0;
    }

    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
}

/* ==========================================================================
   8. PERMISSIONS TREE VIEW (Migrated from admin/permissions-tree-view.php)
   ========================================================================== */
.tree-container {
    font-family: 'Courier New', monospace;
    background: var(--bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    margin-bottom: 30px;
}

.tree-line {
    color: var(--muted);
}

.tree-item {
    margin: 8px 0;
    padding: 8px;
    background: var(--surface);
    border-radius: 4px;
}

.tree-level-0 {
    margin-left: 0px;
    font-weight: bold;
    color: var(--primary);
}

.tree-level-1 {
    margin-left: 30px;
    color: var(--text-soft);
}

.tree-level-2 {
    margin-left: 60px;
    color: var(--muted);
}

.tree-level-3 {
    margin-left: 90px;
    color: var(--muted);
}

.level-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
}

.dept-badge {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 4px;
}

.user-badge {
    display: inline-block;
    background: var(--amber);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 4px;
}

/* ==========================================================================
   9. INDENT PERMISSIONS PAGE (Migrated from admin/indent-permissions.php)
   ========================================================================== */
.permission-page-shell {
    padding-bottom: 20px;
}

.permission-main-header {
    background: var(--bg-gradient);
    border: 1px solid rgba(84, 109, 255, 0.12);
}

.section-badge {
    display: inline-block;
    background: rgba(67, 97, 238, 0.12);
    color: var(--primary);
    border: 1px solid rgba(67, 97, 238, 0.18);
    border-radius: 999px;
    padding: 0.38rem 0.8rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stat-box {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    min-height: 110px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.stat-box-blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(14, 165, 233, 0.04));
}

.stat-box-green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(16, 185, 129, 0.04));
}

.stat-box-purple {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(168, 85, 247, 0.04));
}

.stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.stat-value {
    margin-top: 0.8rem;
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
    color: var(--text);
}

.permission-panel-card {
    border-radius: 18px;
    background: var(--surface);
}

.permission-level-row {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 1));
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.search-box-wrap {
    position: relative;
}

.search-box {
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: var(--surface);
    border-radius: 12px;
    height: 42px;
    padding-left: 0.9rem;
    box-shadow: none;
}

.search-box:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.12);
}

.permission-topic-card {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 1));
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.permissions-table {
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.permissions-table thead th {
    background: var(--bg);
    color: var(--text-soft);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.permissions-table tbody td {
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    vertical-align: middle;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.permissions-table tbody tr:last-child td {
    border-bottom: none;
}

.permissions-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.025);
}

.empty-table-state {
    background: var(--surface-alt);
    border: 1px dashed rgba(148, 163, 184, 0.35);
    padding: 1rem;
    border-radius: 12px;
}

@media (max-width: 767.98px) {
    .permission-main-header .card-body {
        padding: 1rem !important;
    }

    .stat-box {
        min-height: unset;
    }
}

/* ==========================================================================
   10. INDENT MIGRATIONS PAGE (Migrated from admin/indent-migrations.php)
   ========================================================================== */
.migration-shell {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 18px 36px;
}

.migration-header {
    background: var(--surface);
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-radius: 22px;
    padding: 26px 28px;
    box-shadow: 0 16px 35px -24px rgba(15, 23, 42, 0.35);
    margin-bottom: 24px;
}

.migration-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.12);
    color: var(--primary-strong);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.migration-card {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 28px -22px rgba(15, 23, 42, 0.28);
}

.migration-card .card-body {
    padding: 22px;
}

.action-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.action-box {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    padding: 20px;
    background: var(--surface-alt);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

.action-box h6 {
    margin: 0;
    font-weight: 700;
    color: var(--text);
}

.action-box p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

.action-box .btn {
    width: 100%;
    justify-content: center;
    border-radius: 12px;
    font-weight: 600;
}

.log-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text-soft);
}

.log-list li+li {
    margin-top: 8px;
}

/* ==========================================================================
   11. RAISE INDENT FORM / NIMS STYLES (Migrated from purchase-indent/raise-indent-form.php)
   ========================================================================== */

/* Modern NIMS / Hospital ERP Palette */
:root {
    --nims-navy: #17436f;
    --nims-navy-hover: #113355;
    --nims-navy-light: #eef5fc;
    --nims-border: #cbd5e1;
    --nims-header-bg: #1e3a5f;
    --nims-primary: #2563eb;
    --nims-success: #16a34a;
    --nims-purple: #7c3aed;
}

.nims-header-badge {
    background: var(--nims-navy);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 7px 15px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nims-btn-navy {
    background-color: var(--nims-navy) !important;
    border-color: var(--nims-navy) !important;
    color: #ffffff !important;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nims-btn-navy:hover,
.nims-btn-navy:focus {
    background-color: var(--nims-navy-hover) !important;
    border-color: var(--nims-navy-hover) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 67, 111, 0.25);
}

.nims-heading-card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
}

.nims-form-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-heading, #1e293b);
    margin-bottom: 0px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.25;
}

.nims-form-label .req {
    color: var(--danger, #dc3545);
    font-weight: 800;
}

.form-select-sm,
.form-control-sm,
.input-group-sm>.form-control,
.input-group-sm>.form-select {
    border-radius: 6px !important;
    border: 1px solid var(--input-border, #cbd5e1) !important;
    font-size: 0.84rem !important;
    color: var(--text, #1e293b) !important;
    background-color: var(--input-bg, #ffffff) !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, background-color 0.15s ease-in-out, color 0.15s ease-in-out !important;
}

.form-select-sm:focus,
.form-control-sm:focus,
.input-group-sm>.form-control:focus,
.input-group-sm>.form-select:focus {
    border-color: var(--primary, var(--nims-navy)) !important;
    box-shadow: 0 0 0 3px var(--primary-glow, rgba(79, 70, 229, 0.20)) !important;
    background-color: var(--input-bg, #ffffff) !important;
    color: var(--text, #1e293b) !important;
    outline: none !important;
}

/* NIMS Radio Buttons */
.nims-radio-group {
    display: inline-flex;
    align-items: center;
    gap: 24px;
    height: 36px;
}

.nims-radio-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 0.90rem;
    font-weight: 600;
    color: var(--text-soft, #334155);
    user-select: none;
    margin-bottom: 0;
    transition: color 0.15s ease;
}

.nims-radio-label:hover {
    color: var(--primary, var(--nims-navy));
}

.nims-radio-input {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    border: 2px solid var(--border, #94a3b8) !important;
    border-radius: 50% !important;
    outline: none !important;
    cursor: pointer !important;
    position: relative !important;
    background-color: var(--input-bg, #ffffff) !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.nims-radio-input:hover {
    border-color: var(--primary, var(--nims-navy)) !important;
}

.nims-radio-input:checked {
    border-color: var(--primary, var(--nims-navy)) !important;
    background-color: var(--input-bg, #ffffff) !important;
    box-shadow: 0 0 0 3px var(--primary-glow, rgba(79, 70, 229, 0.20)) !important;
}

.nims-radio-input:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary, var(--nims-navy));
    display: block;
}

/* NIMS Item Table */
.nims-table-wrap {
    border: 1px solid var(--nims-header-bg);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nims-table {
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    width: 100%;
}

.nims-table thead th {
    background-color: var(--nims-header-bg) !important;
    color: #ffffff !important;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    padding: 10px 8px;
    border: none;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.nims-table tbody td {
    padding: 7px 8px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border, #e2e8f0);
    border-right: 1px solid var(--border-subtle);
    background: var(--surface);
    color: var(--text);
}

.nims-table tbody tr:hover td {
    background-color: var(--table-hover-bg, var(--surface-hover, #f8fafc));
}

.nims-table tbody tr:last-child td {
    border-bottom: none;
}

.nims-table tbody td:last-child {
    border-right: none;
}

.nims-table input.form-control,
.nims-table select.form-select {
    font-size: 0.85rem;
    padding: 6px 9px;
    border-radius: 6px;
    border: 1px solid var(--input-border, #cbd5e1);
    background-color: var(--input-bg, #ffffff);
    color: var(--text, #0f172a);
    transition: all 0.15s ease;
}

.nims-table input.form-control:focus,
.nims-table select.form-select:focus {
    border-color: var(--primary, var(--nims-navy));
    box-shadow: 0 0 0 2px var(--primary-glow, rgba(79, 70, 229, 0.20));
    background-color: var(--input-bg, #ffffff);
    color: var(--text, #0f172a);
}

.btn-delete-row {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 4px 12px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.btn-delete-row:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

/* Floating Autocomplete Popover */
#autocompletePopover {
    position: fixed !important;
    z-index: 9999999 !important;
    background: var(--modal-bg) !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 10px !important;
    box-shadow: 0 20px 40px -8px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.05) !important;
    max-height: 340px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 620px !important;
    max-width: 95vw !important;
    display: none;
    font-family: inherit;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#autocompletePopover::-webkit-scrollbar {
    width: 6px;
}

#autocompletePopover::-webkit-scrollbar-track {
    background: var(--surface-alt);
}

#autocompletePopover::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#autocompletePopover::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.nims-autocomplete-header {
    background: var(--nims-navy) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.78rem !important;
    padding: 9px 14px !important;
    letter-spacing: 0.3px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    display: grid !important;
    grid-template-columns: 130px 1fr 140px !important;
    gap: 12px !important;
    border-top-left-radius: 9px;
    border-top-right-radius: 9px;
}

.nims-autocomplete-item {
    padding: 9px 14px !important;
    font-size: 0.83rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    cursor: pointer !important;
    display: grid !important;
    grid-template-columns: 130px 1fr 140px !important;
    gap: 12px !important;
    align-items: center !important;
    transition: background-color 0.12s ease, border-left-color 0.12s ease !important;
    border-left: 3px solid transparent !important;
}

.nims-autocomplete-item:hover,
.nims-autocomplete-item.active {
    background-color: #f0f7ff !important;
    border-left-color: var(--nims-primary) !important;
}

.nims-autocomplete-item:hover .item-badge,
.nims-autocomplete-item.active .item-badge {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    border-color: #bfdbfe !important;
}

.nims-autocomplete-item .stock-qty {
    color: #dc3545 !important;
    font-weight: 700 !important;
    text-align: right !important;
}

/* Approval Tracking System: Row Way Layout */
.row-tracker-container {
    width: 100%;
    overflow-x: auto;
    padding: 6px 2px 14px 2px;
}

.row-tracker-container::-webkit-scrollbar {
    height: 7px;
}

.row-tracker-container::-webkit-scrollbar-track {
    background: var(--surface-alt, #f1f5f9);
    border-radius: 4px;
}

.row-tracker-container::-webkit-scrollbar-thumb {
    background: var(--border, #cbd5e1);
    border-radius: 4px;
}

.row-tracker-container::-webkit-scrollbar-thumb:hover {
    background: var(--muted, #94a3b8);
}

.row-tracker-flow {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 5px;
    width: 100%;
    min-width: min-content;
}

.row-step-card {
    position: relative;
    flex: 1 1 0;
    min-width: 200px;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, rgba(148, 163, 184, 0.25));
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.row-step-card:hover {
    border-color: var(--primary-border, #cbd5e1);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.row-step-card.is-creator {
    border-top: 4px solid #7c3aed;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.08) 0%, var(--surface, #ffffff) 42px);
}

.row-step-card.is-level-1 {
    border-top: 4px solid var(--primary, #17436f);
    background: linear-gradient(180deg, var(--primary-soft, rgba(2, 132, 199, 0.08)) 0%, var(--surface, #ffffff) 42px);
}

.row-step-card.is-level-regular {
    border-top: 4px solid #0284c7;
    background: linear-gradient(180deg, rgba(2, 132, 199, 0.06) 0%, var(--surface, #ffffff) 42px);
}

.row-step-card.is-final {
    border-top: 4px solid #16a34a;
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.08) 0%, var(--surface, #ffffff) 42px);
    border-color: rgba(34, 197, 94, 0.35);
}

/* Dark Theme Overrides for Row Step Cards */
[data-theme="dark"] .row-step-card,
.dark .row-step-card {
    background: var(--surface, #131b2e) !important;
    border-color: var(--card-border, rgba(255, 255, 255, 0.1)) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .row-step-card:hover,
.dark .row-step-card:hover {
    border-color: var(--primary-border, rgba(56, 189, 248, 0.45)) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .row-step-card.is-creator,
.dark .row-step-card.is-creator {
    border-top: 4px solid #a855f7 !important;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.16) 0%, var(--surface, #131b2e) 48px) !important;
}

[data-theme="dark"] .row-step-card.is-level-1,
.dark .row-step-card.is-level-1 {
    border-top: 4px solid var(--primary, #38bdf8) !important;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.16) 0%, var(--surface, #131b2e) 48px) !important;
}

[data-theme="dark"] .row-step-card.is-level-regular,
.dark .row-step-card.is-level-regular {
    border-top: 4px solid #38bdf8 !important;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.10) 0%, var(--surface, #131b2e) 48px) !important;
}

[data-theme="dark"] .row-step-card.is-final,
.dark .row-step-card.is-final {
    border-top: 4px solid #22c55e !important;
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.16) 0%, var(--surface, #131b2e) 48px) !important;
    border-color: rgba(34, 197, 94, 0.35) !important;
}

.row-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.row-step-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
    background: var(--surface, #ffffff);
    border: 2px solid var(--border, #cbd5e1);
    color: var(--text-heading, #1e293b);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.row-step-card.is-creator .row-step-badge {
    background: #7c3aed;
    color: #ffffff;
    border-color: #ddd6fe;
}

.row-step-card.is-level-1 .row-step-badge {
    background: var(--primary, #17436f);
    color: #ffffff;
    border-color: var(--primary-border, #bae6fd);
}

.row-step-card.is-level-regular .row-step-badge {
    background: #0284c7;
    color: #ffffff;
    border-color: #e0f2fe;
}

.row-step-card.is-final .row-step-badge {
    background: #16a34a;
    color: #ffffff;
    border-color: #bbf7d0;
}

[data-theme="dark"] .row-step-badge,
.dark .row-step-badge {
    background: var(--surface-alt, #0d1322);
    border-color: var(--border, rgba(255, 255, 255, 0.15));
    color: var(--text-heading, #f8fafc);
}

[data-theme="dark"] .row-step-card.is-creator .row-step-badge,
.dark .row-step-card.is-creator .row-step-badge {
    background: #7c3aed;
    color: #ffffff;
    border-color: #a855f7;
}

[data-theme="dark"] .row-step-card.is-level-1 .row-step-badge,
.dark .row-step-card.is-level-1 .row-step-badge {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
}

[data-theme="dark"] .row-step-card.is-level-regular .row-step-badge,
.dark .row-step-card.is-level-regular .row-step-badge {
    background: #0369a1;
    color: #ffffff;
    border-color: #38bdf8;
}

[data-theme="dark"] .row-step-card.is-final .row-step-badge,
.dark .row-step-card.is-final .row-step-badge {
    background: #16a34a;
    color: #ffffff;
    border-color: #4ade80;
}

.row-step-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted, #94a3b8);
    font-size: 1.1rem;
    flex-shrink: 0;
    padding: 0 2px;
}

[data-theme="dark"] .row-step-divider,
.dark .row-step-divider {
    color: var(--muted, #64748b);
}

.row-step-title {
    font-weight: 700;
    color: var(--text-heading, #1e293b);
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.row-step-card input[type="text"].form-control {
    background: var(--input-bg, #ffffff) !important;
    color: var(--text-heading, #0f172a) !important;
    border: 1px solid var(--input-border, rgba(148, 163, 184, 0.25)) !important;
}

[data-theme="dark"] .row-step-card input[type="text"].form-control,
.dark .row-step-card input[type="text"].form-control {
    background: var(--input-bg, #0d1322) !important;
    color: var(--text, #f1f5f9) !important;
    border-color: var(--input-border, rgba(255, 255, 255, 0.15)) !important;
}

.row-step-card input[type="text"].form-control:focus {
    border-color: var(--primary, #38bdf8) !important;
    box-shadow: 0 0 0 2px var(--primary-glow, rgba(56, 189, 248, 0.25)) !important;
}

.row-step-desc {
    font-size: 0.75rem;
    color: var(--muted, #64748b);
    line-height: 1.35;
    margin-bottom: 12px;
    min-height: 32px;
}

[data-theme="dark"] .row-step-desc,
.dark .row-step-desc {
    color: var(--muted, #8291a7);
}

.row-approver-select-wrap {
    margin-top: auto;
    border-top: 1px dashed var(--border, #e2e8f0);
    padding-top: 8px;
}

[data-theme="dark"] .row-approver-select-wrap,
.dark .row-approver-select-wrap {
    border-top-color: var(--border, rgba(255, 255, 255, 0.12));
}

.row-approver-label {
    font-size: 0.72rem;
    color: var(--text-soft, #475569);
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

[data-theme="dark"] .row-approver-label,
.dark .row-approver-label {
    color: var(--text-soft, #cbd5e1);
}

/* Approval Badges */
.row-level-badge {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #4f46e5 !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    font-family: var(--bs-font-monospace);
    font-size: 0.7rem;
    font-weight: 600;
}

[data-theme="dark"] .row-level-badge,
.dark .row-level-badge {
    background: rgba(99, 102, 241, 0.22) !important;
    color: #a5b4fc !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

.row-dept-badge {
    background: var(--surface-alt, #f1f5f9) !important;
    color: var(--text-soft, #475569) !important;
    border: 1px solid var(--border, #cbd5e1) !important;
    font-size: 0.72rem;
    font-weight: 500;
}

[data-theme="dark"] .row-dept-badge,
.dark .row-dept-badge {
    background: var(--surface-alt, #0d1322) !important;
    color: var(--text-soft, #cbd5e1) !important;
    border-color: var(--border, rgba(255, 255, 255, 0.12)) !important;
}

.row-modal-approver-box {
    background: var(--surface-alt, #f8fafc) !important;
    color: var(--text, #1e293b) !important;
    border: 1px solid var(--border, #e2e8f0) !important;
}

[data-theme="dark"] .row-modal-approver-box,
.dark .row-modal-approver-box {
    background: var(--surface-alt, #0d1322) !important;
    color: var(--text, #f1f5f9) !important;
    border-color: var(--border, rgba(255, 255, 255, 0.12)) !important;
}

/* Final Stage Card Dark Styling */
[data-theme="dark"] .row-step-card.is-final .row-step-title,
.dark .row-step-card.is-final .row-step-title {
    color: #4ade80 !important;
}

[data-theme="dark"] .row-step-card.is-final .row-step-desc,
.dark .row-step-card.is-final .row-step-desc {
    color: #86efac !important;
}

[data-theme="dark"] .row-step-card.is-final .row-approver-label,
.dark .row-step-card.is-final .row-approver-label {
    color: #86efac !important;
}

[data-theme="dark"] .row-step-card.is-final .badge.bg-success-subtle,
.dark .row-step-card.is-final .badge.bg-success-subtle {
    background: rgba(34, 197, 94, 0.18) !important;
    color: #4ade80 !important;
    border-color: rgba(34, 197, 94, 0.35) !important;
}

[data-theme="dark"] .row-step-card.is-final .border-success-subtle,
.dark .row-step-card.is-final .border-success-subtle {
    border-color: rgba(34, 197, 94, 0.25) !important;
}

/* Outline and Action Buttons Theme Sync */
[data-theme="dark"] .btn-outline-info,
.dark .btn-outline-info {
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
    background: rgba(56, 189, 248, 0.08) !important;
}

[data-theme="dark"] .btn-outline-info:hover,
.dark .btn-outline-info:hover {
    color: #ffffff !important;
    background: #0284c7 !important;
    border-color: #0284c7 !important;
}

[data-theme="dark"] .btn-outline-primary,
.dark .btn-outline-primary {
    color: var(--primary, #38bdf8) !important;
    border-color: var(--primary-border, rgba(56, 189, 248, 0.45)) !important;
    background: var(--primary-soft, rgba(56, 189, 248, 0.08)) !important;
}

[data-theme="dark"] .btn-outline-primary:hover,
.dark .btn-outline-primary:hover {
    color: #ffffff !important;
    background: var(--primary, #38bdf8) !important;
    border-color: var(--primary, #38bdf8) !important;
}

[data-theme="dark"] .btn-outline-secondary,
.dark .btn-outline-secondary {
    color: var(--text-soft, #cbd5e1) !important;
    border-color: var(--border, rgba(255, 255, 255, 0.15)) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

[data-theme="dark"] .btn-outline-secondary:hover,
.dark .btn-outline-secondary:hover {
    color: var(--text-heading, #ffffff) !important;
    border-color: var(--border-strong, rgba(255, 255, 255, 0.3)) !important;
    background: var(--surface-hover, #1a253c) !important;
}

[data-theme="dark"] .nims-btn-navy,
.dark .nims-btn-navy {
    background: linear-gradient(135deg, var(--primary, #38bdf8), var(--primary-strong, #7dd3fc)) !important;
    border-color: var(--primary, #38bdf8) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px var(--primary-glow, rgba(56, 189, 248, 0.35)) !important;
}

[data-theme="dark"] .nims-btn-navy:hover,
.dark .nims-btn-navy:hover,
[data-theme="dark"] .nims-btn-navy:focus,
.dark .nims-btn-navy:focus {
    background: linear-gradient(135deg, var(--primary-strong, #7dd3fc), var(--primary, #38bdf8)) !important;
    border-color: var(--primary-strong, #7dd3fc) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px var(--primary-glow, rgba(56, 189, 248, 0.5)) !important;
    transform: translateY(-1px);
}

[data-theme="dark"] .nims-btn-navy i,
.dark .nims-btn-navy i,
[data-theme="dark"] .nims-btn-navy svg,
.dark .nims-btn-navy svg {
    color: #ffffff !important;
}

[data-theme="dark"] .nims-header-badge,
.dark .nims-header-badge {
    background: var(--surface-alt, #0d1322) !important;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12)) !important;
    color: var(--primary, #38bdf8) !important;
}

[data-theme="dark"] .nims-table-wrap,
.dark .nims-table-wrap {
    border-color: var(--card-border, rgba(255, 255, 255, 0.12)) !important;
}

[data-theme="dark"] .nims-table thead th,
.dark .nims-table thead th {
    background-color: var(--surface-alt, #0d1322) !important;
    color: var(--text-heading, #f8fafc) !important;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.12)) !important;
}

/* Modal list items in dark mode */
[data-theme="dark"] .list-group-item-action,
.dark .list-group-item-action {
    background: var(--surface, #131b2e) !important;
    color: var(--text, #f1f5f9) !important;
    border-color: var(--border, rgba(255, 255, 255, 0.08)) !important;
}

[data-theme="dark"] .list-group-item-action:hover,
.dark .list-group-item-action:hover {
    background: var(--surface-hover, #1a253c) !important;
    color: var(--text-heading, #ffffff) !important;
}

[data-theme="dark"] .list-group-item-action strong,
.dark .list-group-item-action strong {
    color: var(--text-heading, #ffffff) !important;
}

/* Links in theme */
[data-theme="dark"] a:not(.btn):not(.nav-link),
.dark a:not(.btn):not(.nav-link) {
    color: var(--primary, #38bdf8);
}

[data-theme="dark"] a:not(.btn):not(.nav-link):hover,
.dark a:not(.btn):not(.nav-link):hover {
    color: var(--primary-strong, #7dd3fc);
}

/* Chat Messages Scroll Theme Integration */
[data-theme="dark"] .chat-messages-scroll,
.dark .chat-messages-scroll {
    background: var(--surface-alt, #0d1322) !important;
}

[data-theme="dark"] .chat-messages-scroll::-webkit-scrollbar-track,
.dark .chat-messages-scroll::-webkit-scrollbar-track {
    background: var(--surface-alt, #0d1322) !important;
}

[data-theme="dark"] .chat-messages-scroll::-webkit-scrollbar-thumb,
.dark .chat-messages-scroll::-webkit-scrollbar-thumb {
    background: var(--border, rgba(255, 255, 255, 0.15)) !important;
}

[data-theme="dark"] .chat-messages-scroll::-webkit-scrollbar-thumb:hover,
.dark .chat-messages-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary-border, rgba(56, 189, 248, 0.4)) !important;
}

[data-theme="dark"] .modern-chat-card,
.dark .modern-chat-card {
    background: var(--card-bg, #131b2e) !important;
    border-color: var(--card-border, rgba(255, 255, 255, 0.08)) !important;
}

[data-theme="dark"] .customer-bubble,
.dark .customer-bubble {
    background: var(--surface, #131b2e) !important;
    border-color: var(--border, rgba(255, 255, 255, 0.12)) !important;
    color: var(--text, #f1f5f9) !important;
}

[data-theme="dark"] .customer-bubble .chat-bubble-header,
.dark .customer-bubble .chat-bubble-header {
    border-bottom-color: var(--border, rgba(255, 255, 255, 0.08)) !important;
}

[data-theme="dark"] .customer-bubble .chat-author-name,
.dark .customer-bubble .chat-author-name {
    color: var(--text-heading, #f8fafc) !important;
}

[data-theme="dark"] .staff-bubble,
.dark .staff-bubble {
    background: linear-gradient(135deg, rgba(var(--primary-rgb, 56, 189, 248), 0.14) 0%, rgba(99, 102, 241, 0.14) 100%) !important;
    border-color: var(--primary-border, rgba(56, 189, 248, 0.35)) !important;
    color: var(--text, #f1f5f9) !important;
}

[data-theme="dark"] .staff-bubble .chat-bubble-header,
.dark .staff-bubble .chat-bubble-header {
    border-bottom-color: rgba(var(--primary-rgb, 56, 189, 248), 0.22) !important;
}

[data-theme="dark"] .staff-bubble .chat-author-name,
.dark .staff-bubble .chat-author-name {
    color: var(--primary-strong, #7dd3fc) !important;
}

[data-theme="dark"] .internal-note-bubble,
.dark .internal-note-bubble,
[data-theme="dark"] .customer-note-bubble,
.dark .customer-note-bubble {
    background: rgba(245, 158, 11, 0.14) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: #fef08a !important;
}

[data-theme="dark"] .internal-note-bubble .chat-author-name,
.dark .internal-note-bubble .chat-author-name,
[data-theme="dark"] .customer-note-bubble .chat-author-name,
.dark .customer-note-bubble .chat-author-name {
    color: #fde047 !important;
}

#serviceRequisitionModal {
    z-index: 10555 !important;
}

/* --- Additional Utility Classes (Round 2) --- */
.text-var {
    color: var(--text);
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.fw-500 {
    font-weight: 500;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.fw-800 {
    font-weight: 800;
}

.fs-68 {
    font-size: 0.68rem;
}

.fs-10px {
    font-size: 10px;
}

.fs-825 {
    font-size: 0.825rem;
}

.fs-775 {
    font-size: 0.775rem;
}

/* --- More Width Utilities --- */
.w-70 {
    width: 70px;
}

.w-85 {
    width: 85px;
}

.w-105 {
    width: 105px;
}

.w-full {
    width: 100%;
}

.mw-120 {
    max-width: 120px;
}

.mnw-120 {
    min-width: 120px;
}

.mnw-160 {
    min-width: 160px;
}

.mnw-170 {
    min-width: 170px;
}

/* --- Icon Boxes (more sizes) --- */
.icon-box-22 {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.icon-box-24 {
    width: 24px;
    height: 24px;
    object-fit: cover;
}

.icon-box-32 {
    width: 32px;
    height: 32px;
}

.icon-box-36 {
    width: 36px;
    height: 36px;
}

/* --- Height Utilities --- */
.bar-h-5 {
    height: 5px;
}

.mnh-74 {
    min-height: 74px;
}

/* --- Overflow Utilities --- */
.scroll-y-180 {
    max-height: 180px;
    overflow-y: auto;
}

.scroll-y-220 {
    max-height: 220px;
    overflow-y: auto;
}

.scroll-y-380 {
    max-height: 380px;
    overflow-y: auto;
}

.scroll-y-380-pr {
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

/* --- Border Radius Utilities --- */
.rounded-lg-overflow {
    border-radius: 16px;
    overflow: hidden;
}

.rounded-theme-lg {
    border-radius: var(--radius-lg);
}

/* --- Margin Left (tree indentation) --- */
.ml-20 {
    margin-left: 20px;
}

.ml-30 {
    margin-left: 30px;
}

/* --- Z-Index Modal Override --- */
.z-modal-top {
    z-index: 10555;
}

/* --- Surface Variants --- */
.surface-alt-primary-border {
    background: var(--surface-alt);
    border-color: rgba(79, 70, 229, 0.2) !important;
}

.surface-alt-primary-border-strong {
    background: var(--surface-alt);
    border-color: rgba(79, 70, 229, 0.25) !important;
}

.surface-alt-subtle-border {
    background: var(--surface-alt, #f8fafc);
    border-color: rgba(148, 163, 184, 0.25) !important;
}

/* --- Combined Text + Font Utilities --- */
.text-muted-sm {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.text-muted-500 {
    color: var(--text-muted);
    font-weight: 500;
}

.text-heading-bold {
    font-weight: 700;
    color: var(--text-heading);
}

.text-heading-600 {
    font-weight: 600;
    color: var(--text-heading);
}

.text-heading-600-85 {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 0.85rem;
}

.text-muted-600-825 {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
}

.text-500-75 {
    font-weight: 500;
    font-size: 0.75rem;
}

/* --- Column Width Percentages --- */
.col-pct-16 {
    width: 16%;
}

/* --- Amber Warning Surface --- */
.surface-amber-subtle {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.3) !important;
}

/* --- Final Utility Classes (Round 4) --- */
.icon-box-inline-22 {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.icon-box-80 {
    width: 80px;
    height: 80px;
}

.w-35 {
    width: 35px;
}

.w-38 {
    width: 38px;
}

.w-75px {
    width: 75px;
}

.mw-280 {
    max-width: 280px;
}

.mw-340 {
    max-width: 340px;
}

.mh-280 {
    max-height: 280px;
}

.mh-380 {
    max-height: 380px;
}

.z-1055 {
    z-index: 1055;
}

.z-1060 {
    z-index: 1060;
}

.z-1065 {
    z-index: 1065;
}

.fs-82 {
    font-size: 0.82rem;
}

.fs-7px {
    font-size: 7px;
}

.fs-6px {
    font-size: 6px;
}

.pre-wrap-lh15 {
    white-space: pre-wrap;
    line-height: 1.5;
}

.icon-box-36-cover {
    width: 36px;
    height: 36px;
    object-fit: cover;
}

.w-40-center {
    width: 40px;
    text-align: center;
}

.truncate-100 {
    font-size: 0.65rem;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100px;
    white-space: nowrap;
}

.badge-primary-inline {
    background: var(--primary-soft);
    color: var(--primary);
}

.text-heading-tight {
    color: var(--text-heading);
    letter-spacing: -0.5px;
}

.surface-primary-border {
    background: var(--surface);
    border: 1px solid rgba(79, 70, 229, 0.2) !important;
}

.overlay-dark {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.amber-top-border {
    border-top: 4px solid var(--amber);
    background: var(--amber-soft);
}

.amber-subtle-bg {
    background: rgba(245, 158, 11, 0.08) !important;
}

.d-block {
    display: block;
}

/* --- Navbar Component Utilities --- */
.topbar-sticky {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: var(--topbar-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--topbar-border);
    padding: 0.65rem 1.5rem;
    box-shadow: var(--shadow-card);
}

.nav-icon-btn {
    width: 34px;
    height: 34px;
    min-height: 34px;
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.nav-notif-badge {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--primary-border);
}

.nav-search-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--muted, #94a3b8);
    font-size: 0.8rem;
    z-index: 2;
}

.nav-search-input {
    width: 220px !important;
    height: 36px !important;
    padding: 0.4rem 1rem 0.4rem 2.25rem !important;
    border-radius: 9999px !important;
    font-size: 0.8rem !important;
    background: var(--input-bg, #f8fafc) !important;
    border: 1px solid var(--input-border, #e2e8f0) !important;
    color: var(--text, #1e293b) !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.nav-search-input:focus {
    width: 260px !important;
    border-color: var(--primary, #4f46e5) !important;
    box-shadow: 0 0 0 3px var(--primary-soft, rgba(99, 102, 241, 0.15)) !important;
    background: var(--surface, #ffffff) !important;
}

.nav-divider {
    width: 1px;
    height: 22px;
    background: var(--border, #e2e8f0);
    margin: 0 0.35rem;
    flex-shrink: 0;
}

.nav-btn-surface,
.nav-btn-surface-cursor {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    background: var(--surface, #ffffff) !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    color: var(--muted, #64748b) !important;
    text-decoration: none !important;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
}

.nav-btn-surface:hover,
.nav-btn-surface-cursor:hover {
    background: var(--surface-hover, #f1f5f9) !important;
    border-color: var(--primary-border, #cbd5e1) !important;
    color: var(--primary, #4f46e5) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.nav-compact-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    padding: 0.25rem 0.65rem 0.25rem 0.35rem !important;
    border-radius: 12px !important;
    background: var(--surface, #ffffff) !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    transition: all 0.2s ease !important;
    margin-left: 0.25rem;
}

.nav-compact-btn:hover {
    background: var(--surface-hover, #f8fafc) !important;
    border-color: var(--primary-border, #cbd5e1) !important;
}

.nav-dropdown-panel {
    min-width: 275px;
    z-index: 1060;
    background: var(--dropdown-bg);
    color: var(--text);
    border: 1px solid var(--border) !important;
}

.nav-dropdown-meta {
    color: var(--muted);
    font-size: 11px;
}

.nav-notif-count {
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 10px;
}

.nav-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.nav-theme-swatch,
.theme-color-swatch {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
    flex-shrink: 0;
}

.theme-color-swatch:hover {
    transform: scale(1.1);
}

/* Theme Swatch Color Definitions */
.nav-theme-swatch-indigo,
.theme-swatch-indigo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 50%;
}

.nav-theme-swatch-emerald,
.theme-swatch-emerald {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #059669, #047857);
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 50%;
}

.nav-theme-swatch-sapphire,
.theme-swatch-sapphire {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 50%;
}

.nav-theme-swatch-amethyst,
.theme-swatch-amethyst {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 50%;
}

.nav-theme-swatch-teal,
.theme-swatch-teal {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 50%;
}

.nav-theme-swatch-rose,
.theme-swatch-rose {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #e11d48, #be123c);
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 50%;
}

.nav-theme-swatch-orange,
.theme-swatch-orange {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ea580c, #c2410c);
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 50%;
}

.nav-theme-swatch-slate,
.theme-swatch-slate {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #475569, #334155);
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 50%;
}

.nav-compact-btn {
    min-height: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.nav-primary-gradient {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.nav-user-dropdown {
    min-width: 210px;
    background: var(--dropdown-bg);
    border: 1px solid var(--border);
    color: var(--text);
}

.nav-user-badge {
    background: var(--primary-soft);
    color: var(--primary);
}

.nav-user-divider {
    border-color: var(--border);
}

.anim-pulse-glow {
    animation: pulseGlow 2s infinite;
}

/* --- Oracle DB Page Utilities --- */
.oracle-icon-40-primary {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    width: 40px;
    height: 40px;
}

.oracle-icon-40-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    width: 40px;
    height: 40px;
}

.oracle-icon-40-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    width: 40px;
    height: 40px;
}

.oracle-icon-40-info {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
    width: 40px;
    height: 40px;
}

.oracle-hero-gradient {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
}

.oracle-hero-46 {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    width: 46px;
    height: 46px;
}

.oracle-hero-48 {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    width: 48px;
    height: 48px;
}

.oracle-bg-soft {
    background: rgba(79, 70, 229, 0.08);
}

.oracle-bg-softer {
    background: rgba(79, 70, 229, 0.03);
}

.oracle-gradient-subtle {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.03) 0%, rgba(99, 102, 241, 0.06) 100%);
    border: 1px solid rgba(99, 102, 241, 0.22) !important;
}

.oracle-gradient-primary {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.04) 0%, rgba(14, 165, 233, 0.04) 100%);
    border: 1px solid rgba(79, 70, 229, 0.18) !important;
}

.oracle-gradient-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-color: rgba(99, 102, 241, 0.2) !important;
}

.oracle-amber-border {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25) !important;
}

.oracle-icon-42-light {
    width: 42px;
    height: 42px;
    background: var(--surface-alt);
}

.oracle-border-primary {
    border-color: rgba(99, 102, 241, 0.12) !important;
}

.oracle-progress-bar {
    width: 100%;
    transition: width 1s linear;
}

.oracle-progress-track {
    height: 4px;
    background: rgba(99, 102, 241, 0.1);
}

.oracle-scroll-vh {
    max-height: 70vh;
    overflow-y: auto;
}

.oracle-pre-scroll-sm {
    white-space: pre-wrap;
    max-height: 80px;
    overflow-y: auto;
}

.oracle-pre-scroll-md {
    white-space: pre-wrap;
    max-height: 100px;
    overflow-y: auto;
}

.oracle-surface-heading {
    background: var(--surface);
    color: var(--text-heading);
}

.oracle-modal-mnh {
    min-height: 120px;
    background: var(--surface-alt) !important;
}

.pos-sticky-top {
    top: 24px;
    z-index: 5;
}

.ls-half {
    letter-spacing: 0.5px;
}

/* ==========================================================================
   GLOBAL Z-INDEX & OVERFLOW FIXES FOR DROPDOWNS
   ========================================================================== */

/* Fix: segmented-nav-wrapper overflow clipping the "More Departments" dropdown */
.segmented-nav-wrapper {
    overflow: visible !important;
}

/* Fix: segmented-nav overflow clipping dropdown panels */
.segmented-nav {
    overflow: visible !important;
}

/* Fix: filter-bar-flex overflow clipping select/dropdown elements */
.filter-bar-flex {
    overflow: visible !important;
}

/* Fix: glass-filter-card should not clip child dropdowns */
.glass-filter-card {
    overflow: visible !important;
}

/* Fix: ticket-list-page should not clip floating elements */
.ticket-list-page {
    overflow: visible !important;
}

/* Fix: workspace-header should not clip child elements */
.workspace-header {
    overflow: visible !important;
}

/* Global dropdown z-index elevation */
.dropdown-menu {
    z-index: 1080 !important;
}

/* Segmented nav dropdown gets even higher z-index */
.segmented-dropdown-menu {
    z-index: 1090 !important;
}

/* Theme panel dropdown panel */
.nav-dropdown-panel {
    z-index: 1100 !important;
    min-width: 280px !important;
    border-radius: 16px !important;
    border: 1px solid var(--border-subtle, #e2e8f0) !important;
    box-shadow:
        0 20px 50px -12px rgba(15, 23, 42, 0.18),
        0 8px 20px -4px rgba(15, 23, 42, 0.08) !important;
    padding: 1.1rem !important;
    animation: dropdownSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* User dropdown panel */
.nav-user-dropdown {
    z-index: 1100 !important;
    border-radius: 14px !important;
    border: 1px solid var(--border-subtle, #e2e8f0) !important;
    box-shadow:
        0 20px 50px -12px rgba(15, 23, 42, 0.18),
        0 8px 20px -4px rgba(15, 23, 42, 0.08) !important;
    animation: dropdownSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Theme mode button styling */
.theme-mode-btn {
    transition: all 0.2s ease !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
    border-radius: 10px !important;
    background: var(--surface-alt, #f8fafc) !important;
    border: 1px solid var(--border-subtle, #e2e8f0) !important;
    color: var(--text, #1e293b) !important;
    padding: 0.45rem 0.5rem !important;
}

.theme-mode-btn:hover {
    background: var(--primary-soft, rgba(99, 102, 241, 0.08)) !important;
    border-color: var(--primary, #6366f1) !important;
    color: var(--primary, #6366f1) !important;
}

.theme-mode-btn.active,
.theme-mode-btn[data-active="true"] {
    background: var(--primary-soft, rgba(99, 102, 241, 0.12)) !important;
    border-color: var(--primary, #6366f1) !important;
    color: var(--primary, #6366f1) !important;
    font-weight: 700 !important;
}

/* Theme color swatch button styling */
.theme-color-swatch {
    width: 36px !important;
    height: 36px !important;
    border: 2px solid transparent !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

.theme-color-swatch:hover {
    transform: scale(1.12) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

.theme-color-swatch.active,
.theme-color-swatch[data-active="true"] {
    border-color: var(--text, #0f172a) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3), 0 4px 14px rgba(0, 0, 0, 0.2) !important;
    transform: scale(1.08) !important;
}

/* Nav meta small label */
.nav-meta-small {
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    color: var(--muted, #64748b) !important;
}

/* Theme current label badge */
.theme-current-label {
    font-size: 10px !important;
    padding: 0.2rem 0.6rem !important;
}

/* Bootstrap dropdown caret hide for segmented dropdown */
.segmented-nav-dropdown-btn.dropdown-toggle::after {
    display: none !important;
}

/* Form selects in filter areas - ensure they render above siblings */
.glass-filter-card .form-select,
.glass-filter-card .custom-select,
.filter-bar-flex .form-select,
.filter-bar-flex .custom-select {
    position: relative;
    z-index: 2;
}

/* Fix Oracle autocomplete popover */
#autocompletePopover {
    z-index: 9999999 !important;
}

/* Ensure the main content area doesn't clip navbar dropdowns */
.main-content,
.content-wrapper,
.page-content {
    overflow: visible !important;
}

/* ==========================================================================
   GLOBAL CHECKBOX & TOGGLE BUTTON SYSTEM - Perfected Project-Wide
   ========================================================================== */

/* Universal Standard Checkbox (Never stretches; excludes switches, reply toggles & custom hidden) */
input[type="checkbox"]:not(.form-switch-input):not(.toggle-switch):not(.col-toggle-chk):not(.card-toggle-chk):not(.modern-hidden-chk):not(.dept-chk):not(.perm-chk):not(.modern-toggle-chk):not(.reply-toggle-input):not(.form-check-input) {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    aspect-ratio: 1 / 1 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    align-self: center !important;
    border: 1.5px solid var(--border, #cbd5e1) !important;
    border-radius: 5px !important;
    outline: none !important;
    display: inline-grid !important;
    place-items: center !important;
    background: var(--surface, #ffffff) !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    vertical-align: middle !important;
    position: relative !important;
    margin: 0 !important;
}

input[type="checkbox"]:not(.form-switch-input):not(.toggle-switch):not(.col-toggle-chk):not(.card-toggle-chk):not(.modern-hidden-chk):not(.dept-chk):not(.perm-chk):not(.modern-toggle-chk):not(.reply-toggle-input):not(.form-check-input)::before {
    content: "\f00c" !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 0.65rem !important;
    color: #ffffff !important;
    transform: scale(0) !important;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    line-height: 1 !important;
    display: block !important;
}

input[type="checkbox"]:not(.form-switch-input):not(.toggle-switch):not(.col-toggle-chk):not(.card-toggle-chk):not(.modern-hidden-chk):not(.dept-chk):not(.perm-chk):not(.modern-toggle-chk):not(.reply-toggle-input):not(.form-check-input):hover {
    border-color: var(--primary, #0ea5e9) !important;
    box-shadow: 0 0 0 3px var(--primary-glow, rgba(14, 165, 233, 0.12)) !important;
}

input[type="checkbox"]:not(.form-switch-input):not(.toggle-switch):not(.col-toggle-chk):not(.card-toggle-chk):not(.modern-hidden-chk):not(.dept-chk):not(.perm-chk):not(.modern-toggle-chk):not(.reply-toggle-input):not(.form-check-input):checked {
    background-color: var(--primary, #0ea5e9) !important;
    border-color: var(--primary, #0ea5e9) !important;
    background-image: none !important;
}

input[type="checkbox"]:not(.form-switch-input):not(.toggle-switch):not(.col-toggle-chk):not(.card-toggle-chk):not(.modern-hidden-chk):not(.dept-chk):not(.perm-chk):not(.modern-toggle-chk):not(.reply-toggle-input):not(.form-check-input):checked::before {
    transform: scale(1) !important;
}

input[type="checkbox"]:not(.form-switch-input):not(.toggle-switch):not(.col-toggle-chk):not(.card-toggle-chk):not(.modern-hidden-chk):not(.dept-chk):not(.perm-chk):not(.modern-toggle-chk):not(.reply-toggle-input):not(.form-check-input):focus {
    outline: none !important;
    box-shadow: 0 0 0 3px var(--primary-glow, rgba(14, 165, 233, 0.18)) !important;
}

/* Also format standard form-check checkboxes */
.form-check:not(.form-switch) .form-check-input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    aspect-ratio: 1 / 1 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    align-self: center !important;
    border: 1.5px solid var(--border, #cbd5e1) !important;
    border-radius: 5px !important;
    outline: none !important;
    display: inline-grid !important;
    place-items: center !important;
    background: var(--surface, #ffffff) !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    vertical-align: middle !important;
    position: relative !important;
    margin: 0 !important;
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"]::before {
    content: "\f00c" !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 0.65rem !important;
    color: #ffffff !important;
    transform: scale(0) !important;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    line-height: 1 !important;
    display: block !important;
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"]:checked {
    background-color: var(--primary, #0ea5e9) !important;
    border-color: var(--primary, #0ea5e9) !important;
    background-image: none !important;
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"]:checked::before {
    transform: scale(1) !important;
}

/* ==========================================================================
   REPLY TOGGLE CHIP (Auto-Sig & Notify via Email)
   ========================================================================== */
.reply-toggle-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    padding: 0.3rem 0.75rem !important;
    border-radius: 9999px !important;
    border: 1px solid var(--border, #cbd5e1) !important;
    background: var(--surface, #ffffff) !important;
    cursor: pointer !important;
    user-select: none !important;
    margin-bottom: 0 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.reply-toggle-chip:hover {
    border-color: var(--primary, #0ea5e9) !important;
    background: var(--surface-hover, #f8fafc) !important;
    transform: translateY(-1px) !important;
}

.reply-toggle-chip .reply-toggle-input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
}

/* The Sliding Toggle Track */
.reply-toggle-chip .reply-toggle-track {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    border-radius: 9999px !important;
    background: #cbd5e1 !important;
    position: relative !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    transition: background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease !important;
}

/* The Sliding Knob */
.reply-toggle-chip .reply-toggle-track::after {
    content: "" !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: 14px !important;
    height: 14px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    transform: translateX(0) !important;
}

/* Checked State */
.reply-toggle-chip .reply-toggle-input:checked+.reply-toggle-track {
    background-color: var(--primary, #0ea5e9) !important;
    box-shadow: 0 0 0 3px var(--primary-glow, rgba(14, 165, 233, 0.2)) !important;
}

.reply-toggle-chip .reply-toggle-input:checked+.reply-toggle-track::after {
    transform: translateX(14px) !important;
}

.reply-toggle-chip .reply-toggle-label {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: var(--text, #334155) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
}

.reply-toggle-chip:has(.reply-toggle-input:checked) {
    border-color: rgba(14, 165, 233, 0.4) !important;
    background: rgba(14, 165, 233, 0.04) !important;
}

/* Standalone .form-switch System */
.form-check.form-switch,
.form-switch {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    min-height: auto !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
}

.form-switch .form-check-input,
.form-check.form-switch .form-check-input,
.form-switch input[type="checkbox"],
.form-check.form-switch input[type="checkbox"],
input[type="checkbox"].form-switch-input,
input[type="checkbox"].toggle-switch,
input[type="checkbox"].col-toggle-chk,
input[type="checkbox"].card-toggle-chk {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    aspect-ratio: auto !important;
    border-radius: 9999px !important;
    background-color: #cbd5e1 !important;
    border: 1.5px solid #cbd5e1 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3.2' fill='%23ffffff'/%3e%3c/svg%3e") !important;
    background-position: left 2px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px 16px !important;
    cursor: pointer !important;
    vertical-align: middle !important;
    position: relative !important;
    flex-shrink: 0 !important;
    align-self: center !important;
    margin: 0 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08) !important;
    outline: none !important;
    transition: background-position 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.form-switch .form-check-input:checked,
.form-check.form-switch .form-check-input:checked,
.form-switch input[type="checkbox"]:checked,
.form-check.form-switch input[type="checkbox"]:checked,
input[type="checkbox"].form-switch-input:checked,
input[type="checkbox"].toggle-switch:checked,
input[type="checkbox"].col-toggle-chk:checked,
input[type="checkbox"].card-toggle-chk:checked {
    background-color: var(--primary, #0ea5e9) !important;
    border-color: var(--primary, #0ea5e9) !important;
    background-position: right 2px center !important;
    box-shadow: 0 0 0 3px var(--primary-glow, rgba(14, 165, 233, 0.22)) !important;
}

.form-switch .form-check-input::before,
.form-check.form-switch .form-check-input::before,
.form-switch input[type="checkbox"]::before,
.form-check.form-switch input[type="checkbox"]::before,
input[type="checkbox"].form-switch-input::before,
input[type="checkbox"].toggle-switch::before,
input[type="checkbox"].col-toggle-chk::before,
input[type="checkbox"].card-toggle-chk::before {
    display: none !important;
    content: none !important;
}

/* ==========================================================================
   NIMS TABLE INPUT IMPROVEMENTS (raise-indent-form PRT/AMT fields)
   ========================================================================== */
.nims-table input.form-control {
    font-size: 0.82rem !important;
    padding: 0.3rem 0.45rem !important;
    border-radius: 7px !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    background: var(--surface, #ffffff) !important;
    color: var(--text, #0f172a) !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
}

.nims-table input.form-control:focus {
    border-color: var(--primary, #6366f1) !important;
    box-shadow: 0 0 0 3px var(--primary-glow, rgba(99, 102, 241, 0.12)) !important;
    outline: none !important;
}

/* PRT (unit price) input */
.nims-table .item-prt-input {
    min-width: 70px !important;
    width: 80px !important;
    color: var(--muted, #64748b) !important;
    font-size: 0.78rem !important;
}

/* AMT (amount) input */
.nims-table .item-amt-input {
    min-width: 80px !important;
    width: 90px !important;
    font-weight: 700 !important;
    color: #059669 !important;
}

/* QOH (dept quantity on hand) - readonly */
.nims-table .item-qoh-input {
    min-width: 60px !important;
    width: 70px !important;
    text-align: center !important;
    background: var(--surface-alt, #f8fafc) !important;
    color: var(--muted) !important;
    font-size: 0.78rem !important;
}

/* Qty input */
.nims-table .item-qty-input {
    min-width: 55px !important;
    width: 65px !important;
    font-weight: 700 !important;
    text-align: center !important;
}

/* Delete row button */
.btn-delete-row {
    font-size: 0.78rem !important;
    padding: 0.3rem 0.6rem !important;
    border-radius: 7px !important;
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
    color: #dc2626 !important;
    transition: all 0.15s ease !important;
    white-space: nowrap !important;
}

.btn-delete-row:hover {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.3) !important;
}

/* Hide number input spin arrows for cleaner look */
.nims-table input[type="number"]::-webkit-inner-spin-button,
.nims-table input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
}

.nims-table input[type="number"] {
    -moz-appearance: textfield !important;
}

/* ==========================================================================
   MODERN COMPACT TICKET VIEW & CHAT FEED STYLES
   ========================================================================== */
.compact-hero {
    padding: 14px 18px !important;
    border-radius: 14px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03) !important;
}

.ticket-hero-mid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0;
}

.ticket-hero-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.compact-hero .ticket-hero-title {
    font-size: 1.25rem !important;
    font-weight: 800;
    margin: 0 !important;
    line-height: 1.3;
}

.ticket-timestamps {
    font-size: 0.74rem;
    color: var(--muted);
    font-weight: 500;
}

.ticket-progress-ribbon-slim {
    margin-top: 10px !important;
    padding-top: 10px !important;
    border-top: 1px solid var(--border-subtle) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    overflow-x: auto;
}

.ticket-progress-ribbon-slim .ribbon-step {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ticket-progress-ribbon-slim .ribbon-dot {
    width: 22px !important;
    height: 22px !important;
    border-radius: 6px !important;
    font-size: 0.68rem !important;
    font-weight: 800;
}

.ticket-progress-ribbon-slim .ribbon-title {
    font-size: 0.72rem !important;
    font-weight: 700;
}

.ticket-progress-ribbon-slim .ribbon-sub {
    font-size: 0.62rem !important;
}

.ticket-progress-ribbon-slim .ribbon-connector {
    height: 2px;
    min-width: 14px;
}

.compact-pathway {
    border-radius: 14px !important;
    border: 1.5px solid var(--primary-border, rgba(99, 102, 241, 0.25)) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
    overflow: hidden;
    margin-bottom: 14px !important;
}

.compact-pathway .agent-pathway-header {
    background: rgba(99, 102, 241, 0.05);
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

/* Replace Modal Stepper Pipeline & Table Highlighting */
.replace-stepper-card {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 1rem;
    padding: 1.1rem 1.25rem 1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.replace-stepper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border, #f1f5f9);
}

.replace-stepper-track {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0 0.5rem;
}

.replace-stepper-rail {
    position: absolute;
    top: 18px;
    left: 10%;
    right: 10%;
    height: 4px;
    background: var(--border, #e2e8f0);
    border-radius: 9999px;
    z-index: 1;
}

.replace-stepper-fill {
    position: absolute;
    top: 18px;
    left: 8%;
    height: 4px;
    width: 0%;
    background: linear-gradient(90deg, #0284c7 0%, #10b981 100%);
    border-radius: 9999px;
    z-index: 1;
    transition: width 0.35s ease;
}

.replace-stepper-node {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
}

.replace-stepper-node:hover {
    transform: translateY(-2px);
}

.replace-stepper-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface, #ffffff);
    border: 2px solid var(--border, #cbd5e1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted, #64748b);
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.25s ease;
}

.replace-stepper-node.active .replace-stepper-circle {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 0 0 5px rgba(2, 132, 199, 0.22);
    transform: scale(1.06);
}

.replace-stepper-node.completed .replace-stepper-circle {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.replace-stepper-title {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text, #475569);
    line-height: 1.25;
    margin-bottom: 2px;
    transition: color 0.2s ease;
}

.replace-stepper-node.active .replace-stepper-title {
    color: #0284c7;
    font-weight: 800;
}

.replace-stepper-node.completed .replace-stepper-title {
    color: #059669;
}

.replace-stepper-source {
    font-size: 0.65rem;
    color: var(--muted, #94a3b8);
    background: var(--surface-alt, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    padding: 1px 6px;
    border-radius: 9999px;
    font-family: ui-monospace, monospace;
    max-width: 92%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.replace-stepper-node.active .replace-stepper-source {
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.25);
    color: #0284c7;
    font-weight: 600;
}

.table-active-row {
    background-color: #eff6ff !important;
    border-left: 4px solid #0284c7 !important;
}

.table-active-row td {
    background-color: #eff6ff !important;
}

/* ==========================================================================
   FULLSCREEN REPLACE MODAL & ASSET ITEMS TABLE (MASTERS.GET_ASSET_ITEMS_TODEPT)
   ========================================================================== */
@media (min-width: 1200px) {
    .replace-modal-fullscreen {
        max-width: 96vw !important;
        width: 96vw !important;
        margin: 1.25rem auto !important;
    }
}

.asset-items-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.76rem;
    width: 100%;
}

.asset-table-header th {
    --bs-table-bg: #0f4c81 !important;
    --bs-table-color: #ffffff !important;
    background-color: #0f4c81 !important;
    color: #ffffff !important;
    box-shadow: none !important;
    font-weight: 700 !important;
    font-size: 0.74rem !important;
    padding: 8px 8px !important;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    vertical-align: middle !important;
    text-align: center;
}

/* Radio button in Step 3 table (strictly fixed to prevent vertical stretching into tall pills) */
.replace-item-radio {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    margin: 0 auto !important;
    display: block !important;
    cursor: pointer !important;
    border-radius: 50% !important;
    border: 1.5px solid #0284c7 !important;
    accent-color: #0284c7 !important;
}

/* Checkbox in Step 4 table */
.asset-row-checkbox {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    margin: 0 auto !important;
    display: block !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    accent-color: #0f4c81 !important;
}

#selectAllAssetCheckboxes {
    width: 16px !important;
    height: 16px !important;
    cursor: pointer !important;
    border-radius: 3px !important;
    accent-color: #0f4c81 !important;
}

.asset-items-table tbody td {
    padding: 7px 8px !important;
    vertical-align: middle !important;
    border-color: #e2e8f0;
    font-size: 0.75rem;
}

.asset-items-table tr.table-active-row {
    background-color: #eff6ff !important;
}

.asset-items-table tr.table-active-row td {
    background-color: #eff6ff !important;
}

.asset-remark-input {
    min-height: 28px !important;
    height: 28px !important;
    padding: 2px 8px !important;
    font-size: 0.74rem !important;
    border-radius: 6px !important;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
}

.asset-dept-select {
    min-height: 28px !important;
    height: 28px !important;
    padding: 2px 22px 2px 8px !important;
    font-size: 0.74rem !important;
    border-radius: 6px !important;
}

.asset-header-count-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    background: #ffffff;
    color: #0f4c81;
    font-weight: 800;
    font-size: 0.68rem;
    border-radius: 4px;
    padding: 0 4px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    margin-bottom: 2px;
}

/* Fullscreen Replace Modal Viewport & Padding Optimizations */
.replace-modal-fullscreen .modal-content {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
}

.replace-modal-fullscreen .modal-body {
    max-height: calc(88vh - 125px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 1.25rem 1.5rem !important;
}

@media (max-width: 1199.98px) {
    .replace-modal-fullscreen {
        max-width: 98vw !important;
        margin: 0.5rem auto !important;
    }

    .replace-modal-fullscreen .modal-body {
        padding: 0.85rem !important;
    }
}

#replaceAssetItemsTableWrap {
    border: 1px solid var(--border, #cbd5e1);
    background-color: var(--surface, #ffffff);
}

/* Modal Native Selects */
.replace-modal-fullscreen .form-select,
#modalAgentReplace .form-select {
    min-height: 36px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text, #1e293b);
    background-color: var(--input-bg, #ffffff);
    border: 1px solid var(--input-border, #cbd5e1);
    border-radius: 8px;
    padding: 0.35rem 2.25rem 0.35rem 0.75rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 10px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.replace-modal-fullscreen .form-select:hover:not(:disabled),
#modalAgentReplace .form-select:hover:not(:disabled) {
    border-color: #94a3b8;
}

.replace-modal-fullscreen .form-select:focus,
#modalAgentReplace .form-select:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
    outline: none;
}

.replace-modal-fullscreen .form-select:disabled,
#modalAgentReplace .form-select:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.85;
}

/* ==========================================================================
   MISSING COMPONENT CLASSES - Page Layout, KPI Cards, Filter Bar, Tables
   ========================================================================== */

/* App Workspace Container */
.app-workspace {
    width: 100%;
    padding: 0 0 2rem;
    animation: fadeInUp 0.4s var(--ease-smooth) both;
}

/* Workspace Header */
.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.25rem 0;
}

.title-group h1 {
    font-size: clamp(1.4rem, 2vw, 1.9rem);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.25rem;
    letter-spacing: -0.03em;
}

.title-group p {
    color: var(--muted);
    font-size: 0.82rem;
    margin: 0;
    font-weight: 500;
}

/* KPI Stat Cards Grid */
.kpi-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .kpi-stat-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 480px) and (max-width: 768px) {
    .kpi-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Admin KPI Grid - 4 column */
.kpi-admin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 992px) {
    .kpi-admin-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .kpi-admin-grid {
        grid-template-columns: 1fr;
    }
}

/* Surface Card (theme-aware white card) */
.surface-card-bordered {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.surface-card-bordered:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

/* KPI Stat Card - Flex Layout */
.kpi-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.kpi-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.kpi-card-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.kpi-card-icon.sky {
    background: rgba(14, 165, 233, 0.12);
    color: #0ea5e9;
}

.kpi-card-icon.amber {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.kpi-card-icon.emerald {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.kpi-card-icon.violet {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.kpi-card-icon.primary {
    background: var(--primary-soft);
    color: var(--primary);
}

.kpi-card-body {
    min-width: 0;
    flex: 1;
}

.kpi-card-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.kpi-card-value {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--text);
}

.kpi-card-value.sky {
    color: #0ea5e9;
}

.kpi-card-value.amber {
    color: #f59e0b;
}

.kpi-card-value.emerald {
    color: #10b981;
}

.kpi-card-value.violet {
    color: #8b5cf6;
}

.kpi-card-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    margin-top: 0.2rem;
}

/* Theme-aware Admin cards (replaces hardcoded bg-white) */
.admin-kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s ease;
}

.admin-kpi-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.admin-kpi-card .kpi-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.admin-kpi-card .kpi-number {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
    line-height: 1.1;
}

.admin-kpi-card .kpi-sub {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 0.2rem;
}

.admin-nav-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    text-decoration: none;
    display: block;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.admin-nav-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    text-decoration: none;
}

.admin-nav-card h3 {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.admin-nav-card p {
    color: var(--muted);
    font-size: 0.78rem;
    margin: 0;
}

/* Admin table panel */
.admin-panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.admin-panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-panel-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.15rem;
}

.admin-panel-header p {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0;
}

/* Segmented nav styles are globally unified in the main navigation section */

/* Glass Filter Card */
.glass-filter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-card);
}

/* Filter Bar Flex */
.filter-bar-flex {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* Search Wrapper */
.search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 240px;
    min-width: 220px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-wrapper i {
    color: var(--muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.search-input {
    border: none;
    background: transparent;
    color: var(--text);
    width: 100%;
    font-size: 0.85rem;
    outline: none;
    box-shadow: none;
    min-height: auto;
    padding: 0;
}

.search-input::placeholder {
    color: var(--muted);
}

/* Custom Select Filter */
.custom-select {
    min-height: 2.25rem;
    padding: 0.45rem 2rem 0.45rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background-color: var(--surface-alt);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5.5 7.5L10 12l4.5-4.5' stroke='%236b7280' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 0.85rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
}

.custom-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Filter Action Button */
.btn-filter-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--primary-border);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.btn-filter-action:hover {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
}

/* Clear Filter Button */
.btn-clear-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.btn-clear-filter:hover {
    background: var(--danger);
    color: #fff;
    border-color: transparent;
    text-decoration: none;
}

/* Gradient Primary Button */
.btn-gradient-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.15rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.22);
    transition: all 0.18s ease;
    white-space: nowrap;
}

.btn-gradient-primary:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-strong), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(var(--primary-rgb), 0.3);
    text-decoration: none;
}

/* Table Card */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

/* Custom Table */
.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text);
    font-size: 0.87rem;
}

.custom-table thead th {
    background: var(--surface-alt);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    vertical-align: middle;
}

.custom-table tbody td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    color: var(--text);
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr:hover {
    background: var(--table-hover-bg);
}

/* Ticket badge in table */
.ticket-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: 1px solid var(--primary-border);
    transition: all 0.15s ease;
}

.ticket-badge:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

/* Text helpers */
.text-heading-bold {
    font-weight: 700;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.4;
}

.text-heading-600 {
    font-weight: 600;
    color: var(--text);
    font-size: 0.85rem;
}

.text-muted-var {
    color: var(--muted);
}

.text-muted-500 {
    color: var(--muted);
    font-size: 0.85rem;
}

.text-muted-sm {
    color: var(--muted);
    font-size: 0.78rem;
}

/* Assignee avatar in table */
.assignee-avatar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}



/* Action icon button */
.btn-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    font-size: 0.78rem;
    text-decoration: none;
    transition: all 0.18s ease;
}

.btn-action-icon:hover {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
    text-decoration: none;
    transform: translateX(2px);
}

/* Empty state box */
.empty-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--muted);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
    color: var(--muted);
}

/* Text right utility */
.text-right {
    text-align: right !important;
}

/* Text xxs */
.text-xxs {
    font-size: 0.725rem !important;
}

.text-xs {
    font-size: 0.75rem !important;
}

/* Flex utility overrides for vanilla CSS */
.d-flex {
    display: flex !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.gap-1 {
    gap: 0.25rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 0.75rem !important;
}

.gap-4 {
    gap: 1rem !important;
}

/* Fix table shell hardcoded background */
.ticket-table-shell {
    background: var(--surface) !important;
}

/* Fix customer card hardcoded background */
.customer-card-grid .customer-card,
.customer-card {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

/* Fix conversation card hardcoded background */
.conversation-card {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

/* Fix ticket panel block hardcoded background */
.ticket-panel-block {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

/* Fix customer-detail-list items */
.customer-detail-list li {
    background: var(--surface-alt) !important;
    border-color: var(--border) !important;
}

.ticket-detail-list li {
    background: var(--surface-alt) !important;
    border-color: var(--border) !important;
}

/* Fix page-search-field hardcoded bg */
.page-search-field,
.customer-search-field {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

/* Floating Status Sync Pills - Clean Vertical Stacking (Screenshot 1 Fix) */
.oracle-sync-global-pill {
    position: fixed !important;
    bottom: 18px !important;
    right: 18px !important;
    z-index: 9999 !important;
}

.indents-tickets-sync-pill {
    position: fixed !important;
    bottom: 18px !important;
    right: 200px !important;
    z-index: 9998 !important;
}

body:has(#oracleGlobalSyncPill) #indentsTicketsRefreshPill,
body:has(.oracle-sync-global-pill) .indents-tickets-sync-pill,
#oracleGlobalSyncPill~#indentsTicketsRefreshPill,
.oracle-sync-global-pill~.indents-tickets-sync-pill {
    bottom: 18px !important;
}

/* ==========================================================================
   Project Component Styles & UI Bindings (Audit Corrections)
   ========================================================================== */
.ribbon-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.ticket-card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.ticket-card-body {
    padding: 1rem;
}

.ticket-main-column {
    min-width: 0;
}

.chat-empty-icon {
    font-size: 2rem;
    line-height: 1;
}

.chat-bubble-body {
    line-height: 1.5;
    word-break: break-word;
}

.attachment-chip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary, #6366f1);
}

.attachment-chip-name {
    font-weight: 500;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-chip-size {
    color: var(--muted, #64748b);
    font-size: 0.65rem;
}

.workspace-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--surface-hover, #f1f5f9);
    color: var(--muted, #94a3b8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.workspace-empty-state h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading, #0f172a);
    margin-bottom: 0.25rem;
}

.workspace-empty-state p {
    font-size: 0.85rem;
    color: var(--muted, #64748b);
    max-width: 380px;
    margin-bottom: 0;
}

.agent-sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.widget-body {
    padding: 1rem;
}

.ticket-workspace-card {
    border-radius: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.ticket-row-main {
    flex: 1;
    min-width: 0;
}

.ticket-row-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.perm-title {
    font-size: 0.75rem;
    font-weight: 600;
}

.staff-selected-info {
    font-size: 0.75rem;
    color: var(--muted);
}

.active-chips-bar {
    border-top: 1px dashed var(--border, #e2e8f0);
}

.dashboard-indent-box {
    background: var(--surface-alt, #f8fafc);
    border-color: var(--border, #e2e8f0) !important;
}

.composer-quick-actions {
    background: var(--surface-alt, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
}

.nav-btn-surface {
    position: relative;
}

.theme-check-icon {
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.theme-color-name {
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

.nav-badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--danger, #ef4444);
    border: 2px solid var(--surface, #ffffff);
}

.canvas-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-subnav-wrapper {
    background: var(--surface-alt, #f8fafc);
}

.ez-connect-bar {
    background: var(--surface-alt, #f8fafc);
}

.level-row-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-heading);
}

.test-result-box {
    background: var(--surface-alt, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    max-height: 200px;
    overflow-y: auto;
    font-family: var(--bs-font-monospace, monospace);
}

.dept-filter-pill {
    border-radius: 9999px !important;
    font-weight: 600 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.dept-filter-pill.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px -2px var(--primary-glow), 0 2px 6px -1px rgba(var(--primary-rgb), 0.3) !important;
    font-weight: 700 !important;
}

.dept-filter-pill[data-dept-filter="oracle"].active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px -2px rgba(239, 68, 68, 0.48), 0 2px 6px -1px rgba(239, 68, 68, 0.3) !important;
    font-weight: 700 !important;
}

.connector-line {
    width: 100%;
    height: 100%;
}

.tree-origin-node,
.tree-final-node {
    position: relative;
}

/* Agent and Department Management Classes */
.agent-management-container {
    position: relative;
    width: 100%;
}

.agent-card-item {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.agent-table {
    width: 100%;
}

.agent-table-row {
    transition: background-color 0.15s ease;
}

.agent-table-row:hover {
    background-color: var(--surface-hover, rgba(0, 0, 0, 0.02));
}

/* Pagination & filter visibility helpers */
.paginator-hidden {
    display: none !important;
}

.filter-hidden {
    display: none !important;
}

/* Universal Table Sorting & Auto-Pagination Styles */
.sortable-th {
    cursor: pointer !important;
    user-select: none !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

.sortable-th:hover {
    background-color: var(--surface-hover) !important;
    color: var(--primary) !important;
}

.sort-indicator {
    font-size: 0.75rem !important;
    margin-left: 0.35rem !important;
    display: inline-block !important;
    vertical-align: middle !important;
    transition: transform 0.15s ease, color 0.15s ease !important;
}

.auto-paginator-footer {
    border-top: 1px solid var(--border) !important;
    background: var(--surface-alt) !important;
}

.agent-select-chk,
.col-agent-select,
.edit-dept-chk,
.edit-perm-chk,
.modal-agent-chk,
.oracle-dept-chk {
    cursor: pointer;
}

.agent-view-btn,
.btn-edit-agent,
.btn-quick-import,
.dept-view-btn {
    cursor: pointer;
    transition: opacity 0.15s ease;
}

/* Card Selection Checkbox System (Top-Right Floating) */
.card-detail-select {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-detail-select .form-check-input {
    margin: 0;
    cursor: pointer;
    width: 1.15rem;
    height: 1.15rem;
    border: 1.5px solid rgba(148, 163, 184, 0.7);
    border-radius: 5px;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease;
}

.card-detail-select .form-check-input:hover {
    border-color: var(--primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.card-detail-select .form-check-input:checked {
    background-color: var(--primary, #4f46e5);
    border-color: var(--primary, #4f46e5);
}

/* Customer & Agent Card Styles */
.customer-card,
.agent-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.customer-card:hover,
.agent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    border-color: rgba(99, 102, 241, 0.4);
}

.customer-card-header,
.agent-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    padding-right: 1.75rem;
    /* Prevents overlap with floating select checkbox */
}

.customer-card-body,
.agent-card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.customer-card-badges,
.agent-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.customer-card-meta,
.agent-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    margin-top: auto;
}

.customer-badge-branch {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.customer-badge-branch .branch-text {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* Custom View & Table Utilities */
.col-hidden {
    display: none !important;
}

.table-compact th,
.table-compact td {
    padding: 0.35rem 0.55rem !important;
    font-size: 0.76rem !important;
}

.table-compact .rounded-circle {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.72rem !important;
}

.table-compact .badge {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.65rem !important;
}

/* ==========================================================================
   CUSTOM VIEW DROPDOWN & MODERN COLUMN VISIBILITY COMPONENT
   ========================================================================== */
.custom-view-menu {
    min-width: 340px !important;
    max-width: 370px !important;
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 45px -8px rgba(15, 23, 42, 0.18), 0 8px 20px -4px rgba(15, 23, 42, 0.08) !important;
    z-index: 1065 !important;
    padding: 1.1rem !important;
}

[data-theme="dark"] .custom-view-menu,
[data-bs-theme="dark"] .custom-view-menu,
.dark .custom-view-menu {
    background: #1e293b !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    box-shadow: 0 24px 50px -8px rgba(0, 0, 0, 0.45) !important;
}

.custom-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.custom-view-section-label {
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: var(--muted, #64748b) !important;
    margin-bottom: 0.45rem !important;
}

/* Preset Segmented Control */
.custom-view-preset-wrap,
.custom-view-density-wrap {
    background: var(--surface-alt, #f1f5f9);
    padding: 3px;
    border-radius: 10px;
    display: flex;
    gap: 3px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .custom-view-preset-wrap,
[data-theme="dark"] .custom-view-density-wrap {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, 0.15) !important;
}

.custom-view-preset-wrap .btn-custom-preset,
.custom-view-density-wrap .btn-density {
    flex: 1;
    border: none !important;
    border-radius: 7px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    padding: 0.38rem 0.45rem !important;
    color: var(--text-soft, #475569) !important;
    background: transparent !important;
    transition: all 0.16s ease !important;
    text-align: center;
    box-shadow: none !important;
    cursor: pointer;
}

.custom-view-preset-wrap .btn-custom-preset:hover,
.custom-view-density-wrap .btn-density:hover {
    color: var(--text, #0f172a) !important;
    background: rgba(255, 255, 255, 0.7) !important;
}

[data-theme="dark"] .custom-view-preset-wrap .btn-custom-preset:hover,
[data-theme="dark"] .custom-view-density-wrap .btn-density:hover {
    color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.custom-view-preset-wrap .btn-custom-preset.active,
.custom-view-density-wrap .btn-density.active {
    background: #ffffff !important;
    color: var(--primary, #4f46e5) !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="dark"] .custom-view-preset-wrap .btn-custom-preset.active,
[data-theme="dark"] .custom-view-density-wrap .btn-density.active {
    background: #334155 !important;
    color: var(--primary, #38bdf8) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}

/* Column Items Row */
.custom-view-col-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;
}

.custom-view-col-list::-webkit-scrollbar {
    width: 4px;
}

.custom-view-col-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 4px;
}

.custom-view-col-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.45rem 0.6rem !important;
    border-radius: 10px !important;
    transition: all 0.15s ease !important;
    cursor: pointer !important;
    user-select: none !important;
    border: 1px solid transparent !important;
    background: transparent;
    margin-bottom: 0 !important;
}

.custom-view-col-item:hover {
    background: rgba(79, 70, 229, 0.05) !important;
    border-color: rgba(79, 70, 229, 0.12) !important;
}

[data-theme="dark"] .custom-view-col-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.custom-view-col-main {
    display: flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
    min-width: 0 !important;
    flex: 1 !important;
}

.custom-view-col-icon {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.78rem !important;
    flex-shrink: 0 !important;
}

.custom-view-col-text {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    line-height: 1.2 !important;
}

.custom-view-col-title {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: var(--text, #1e293b) !important;
}

[data-theme="dark"] .custom-view-col-title {
    color: #f1f5f9 !important;
}

.custom-view-col-desc {
    font-size: 0.65rem !important;
    color: var(--muted, #64748b) !important;
}

/* Bulletproof Modern Custom Checkbox */
.custom-view-menu input[type="checkbox"].col-toggle-chk,
input[type="checkbox"].col-toggle-chk,
.custom-view-col-item input[type="checkbox"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 19px !important;
    height: 19px !important;
    min-width: 19px !important;
    max-width: 19px !important;
    border: 1.8px solid #cbd5e1 !important;
    border-radius: 5px !important;
    background-color: #ffffff !important;
    background-image: none !important;
    cursor: pointer !important;
    position: relative !important;
    outline: none !important;
    transition: all 0.16s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

[data-theme="dark"] .custom-view-menu input[type="checkbox"].col-toggle-chk,
[data-theme="dark"] input[type="checkbox"].col-toggle-chk,
[data-theme="dark"] .custom-view-col-item input[type="checkbox"] {
    background-color: #0f172a !important;
    border-color: #475569 !important;
}

.custom-view-menu input[type="checkbox"].col-toggle-chk:hover,
input[type="checkbox"].col-toggle-chk:hover,
.custom-view-col-item input[type="checkbox"]:hover {
    border-color: var(--primary, #4f46e5) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18) !important;
}

.custom-view-menu input[type="checkbox"].col-toggle-chk:checked,
input[type="checkbox"].col-toggle-chk:checked,
.custom-view-col-item input[type="checkbox"]:checked,
[data-theme="dark"] .custom-view-menu input[type="checkbox"].col-toggle-chk:checked,
[data-theme="dark"] input[type="checkbox"].col-toggle-chk:checked,
[data-theme="dark"] .custom-view-col-item input[type="checkbox"]:checked {
    background-color: var(--primary, #4f46e5) !important;
    border-color: var(--primary, #4f46e5) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M4.5 10l3.5 3.5l7.5-7.5'/%3e%3c/svg%3e") !important;
    background-size: 13px 13px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3) !important;
}

.dept-cards-container {
    position: relative;
}

.dept-modal-search {
    width: 100%;
}

.dept-selected-badge,
.perm-selected-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.department-details-modal {
    position: relative;
}

.dept-dynamic-table {
    width: 100%;
}

.dept-table-row,
.oracle-dept-row {
    transition: background-color 0.15s ease;
}

.dept-table-row:hover,
.oracle-dept-row:hover {
    background-color: var(--surface-hover, rgba(0, 0, 0, 0.02));
}

/* Button Group Capsule Pills (Scope Pills in Queue, My Tickets, Indents, etc.) */
.btn-group[role="group"][aria-label*="Scope"],
.btn-group.btn-group-pill {
    background: var(--surface, #ffffff) !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    border-radius: 9999px !important;
    padding: 3px 4px !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
}

.btn-group[role="group"][aria-label*="Scope"] .btn,
.btn-group.btn-group-pill .btn {
    border: 1px solid transparent !important;
    border-radius: 9999px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    padding: 0.45rem 1rem !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    white-space: nowrap !important;
}

.btn-group[role="group"][aria-label*="Scope"] .btn-primary,
.btn-group[role="group"][aria-label*="Scope"] .btn.active,
.btn-group.btn-group-pill .btn.active,
.btn-group.btn-group-pill .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 1px solid transparent !important;
    box-shadow: 0 4px 14px -2px var(--primary-glow), 0 2px 6px -1px rgba(var(--primary-rgb), 0.3) !important;
}

.btn-group[role="group"][aria-label*="Scope"] .btn-primary i,
.btn-group[role="group"][aria-label*="Scope"] .btn-primary svg,
.btn-group.btn-group-pill .btn.active i {
    color: #ffffff !important;
}

.btn-group[role="group"][aria-label*="Scope"] .btn-outline-secondary,
.btn-group.btn-group-pill .btn:not(.active):not(.btn-primary) {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--text-soft, #475569) !important;
}

.btn-group[role="group"][aria-label*="Scope"] .btn-outline-secondary i,
.btn-group.btn-group-pill .btn:not(.active):not(.btn-primary) i {
    color: var(--muted, #64748b) !important;
}

.btn-group[role="group"][aria-label*="Scope"] .btn-outline-secondary:hover,
.btn-group.btn-group-pill .btn:not(.active):not(.btn-primary):hover {
    background: rgba(15, 23, 42, 0.05) !important;
    color: var(--text, #0f172a) !important;
}

/* ==========================================================================
   DOCUMENTATION STYLING
   ========================================================================== */
.doc-section-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.doc-section-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.doc-tab-pane {
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   GLOBAL THEME SYSTEM: COMPLETE UI CONSISTENCY & DARK/LIGHT HARMONIZATION
   Standardizes: Pagination, Accordions, Popovers, Progress, Form Controls,
   Datepickers, Floating Labels, Tables, and Login Adaptive Theming
   ========================================================================== */

/* 1. Universal Pagination Theme Harmonization */
.pagination {
    --bs-pagination-bg: var(--surface);
    --bs-pagination-border-color: var(--border);
    --bs-pagination-color: var(--text-soft);
    --bs-pagination-hover-bg: var(--surface-alt);
    --bs-pagination-hover-color: var(--primary);
    --bs-pagination-hover-border-color: var(--border);
    --bs-pagination-active-bg: var(--primary);
    --bs-pagination-active-border-color: var(--primary);
    --bs-pagination-active-color: #ffffff;
    --bs-pagination-disabled-bg: var(--surface-alt);
    --bs-pagination-disabled-color: var(--muted);
    --bs-pagination-disabled-border-color: var(--border);
}

.page-link {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text-soft) !important;
    transition: all 0.2s ease;
}

.page-link:hover:not(:disabled) {
    background-color: var(--surface-alt) !important;
    border-color: var(--input-border, var(--border)) !important;
    color: var(--primary) !important;
}

.page-item.active .page-link,
.page-link.active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25) !important;
}

.page-item.disabled .page-link,
.page-link:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    background-color: var(--surface-alt) !important;
    border-color: var(--border) !important;
    color: var(--muted) !important;
}

/* 2. Universal Accordion Theme Harmonization */
.accordion {
    --bs-accordion-bg: var(--surface);
    --bs-accordion-color: var(--text);
    --bs-accordion-border-color: var(--border);
    --bs-accordion-btn-bg: var(--surface);
    --bs-accordion-btn-color: var(--text);
    --bs-accordion-active-bg: var(--primary-soft);
    --bs-accordion-active-color: var(--primary);
}

.accordion-item {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.accordion-button {
    background-color: var(--surface) !important;
    color: var(--text) !important;
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-soft) !important;
    color: var(--primary) !important;
    box-shadow: inset 0 -1px 0 var(--border) !important;
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    border-color: var(--primary) !important;
}

.accordion-body {
    background-color: var(--surface) !important;
    color: var(--text-soft) !important;
}

/* 4. Progress Bars Harmonization */
.progress {
    background-color: var(--surface-alt, #f1f5f9) !important;
}

/* 7. Adaptive Login Screen & Floating Switcher */
/* ═══════════════════════════════════════════════════════════════
   N-TICKET SYSTEM FOR NARAYANA PROFESSIONALS — MODERN LOGIN PAGE
   ═══════════════════════════════════════════════════════════════ */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    background: radial-gradient(ellipse at 15% 15%, rgba(99, 102, 241, 0.07), transparent 45%),
        radial-gradient(ellipse at 85% 85%, rgba(13, 148, 136, 0.05), transparent 45%),
        var(--bg, #f8fafc);
    transition: background 0.3s ease;
}

.login-card {
    width: 100%;
    max-width: 1040px;
    border-radius: 24px;
    overflow: hidden;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.2));
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .login-card {
        flex-direction: row;
    }
}

.login-theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
}

/* Left Brand Showcase Panel */
.login-brand-panel {
    flex: 1.15;
    background: linear-gradient(145deg, #090e1a 0%, #0d1527 50%, #181d36 100%);
    color: #ffffff;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

@media (max-width: 991px) {
    .login-brand-panel {
        padding: 2.25rem 2rem;
    }
}

.login-brand-glow-1 {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
}

.login-brand-glow-2 {
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.28) 0%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
}

.login-brand-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.login-brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary, #4f46e5) 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.4rem;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
    flex-shrink: 0;
}

.login-brand-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff !important;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 2px;
}

.login-brand-sub {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #a5b4fc !important;
}

.login-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.login-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: loginPulseDot 2s infinite ease-in-out;
}

@keyframes loginPulseDot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(1.3);
    }
}

.login-brand-hero-title {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.25;
    color: #ffffff !important;
    letter-spacing: -0.02em;
    margin-bottom: 0.85rem;
}

.login-brand-hero-desc {
    color: #94a3b8 !important;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.login-feature-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

@media (min-width: 576px) {
    .login-feature-cards {
        grid-template-columns: 1fr 1fr;
    }
}

.login-feature-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.login-feature-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
}

.login-feature-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.login-feature-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff !important;
    line-height: 1.2;
    margin-bottom: 2px;
}

.login-feature-desc {
    font-size: 0.72rem;
    color: #94a3b8 !important;
    line-height: 1.3;
}

.login-brand-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    color: #64748b;
    position: relative;
    z-index: 2;
}

/* Right Login Form Panel */
.login-form-panel {
    flex: 1;
    background: var(--surface, #ffffff);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

@media (max-width: 991px) {
    .login-form-panel {
        padding: 2.25rem 2rem;
    }
}

.login-form-header {
    margin-bottom: 1.75rem;
}

.login-form-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-heading, #0f172a);
    margin-bottom: 0.35rem;
}

.login-form-desc {
    font-size: 0.88rem;
    color: var(--muted, #64748b);
}

.login-input-group {
    margin-bottom: 1.25rem;
}

.login-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-soft, #475569);
    margin-bottom: 0.45rem;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    left: 1rem;
    color: var(--muted, #94a3b8);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.login-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--surface-alt, #f8fafc);
    border: 1px solid var(--border, #cbd5e1);
    color: var(--text, #0f172a);
    transition: all 0.2s ease;
}

.login-input:focus {
    background: var(--surface, #ffffff);
    border-color: var(--primary, #4f46e5);
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-soft, rgba(99, 102, 241, 0.15));
}

.login-input-wrap:focus-within .login-input-icon {
    color: var(--primary, #4f46e5);
}

.login-toggle-eye {
    position: absolute;
    right: 0.85rem;
    background: transparent;
    border: none;
    color: var(--muted, #94a3b8);
    padding: 0.35rem;
    cursor: pointer;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: color 0.2s ease;
}

.login-toggle-eye:hover {
    color: var(--text, #0f172a);
}

.login-btn-submit {
    width: 100%;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--primary, #4f46e5) 0%, var(--primary-strong, #4338ca) 100%);
    border: none;
    box-shadow: 0 10px 20px -3px rgba(var(--primary-rgb, 79, 70, 229), 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.login-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -3px rgba(var(--primary-rgb, 79, 70, 229), 0.45);
    background: linear-gradient(135deg, var(--primary-strong, #4338ca) 0%, var(--primary, #4f46e5) 100%);
}

.login-btn-submit:active {
    transform: translateY(0) scale(0.99);
}

/* Demo User Pills Section */
.login-demo-section {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.15));
}

.login-demo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.login-demo-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted, #64748b);
}

.login-demo-sub {
    font-size: 0.68rem;
    color: var(--muted, #94a3b8);
}

.login-demo-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.login-demo-btn {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.login-demo-btn:hover {
    transform: translateY(-1px);
}

/* 9. Ticket Indent Label Badge & Requisition Pill System - Fully Dynamic Theme Adaptive */
.badge-ticket-indent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 2px 8px var(--primary-glow), 0 1px 3px rgba(var(--primary-rgb), 0.25) !important;
    display: inline-flex !important;
    align-items: center !important;
    letter-spacing: -0.01em;
}

.badge-ticket-indent i,
.badge-ticket-indent svg,
.badge-ticket-indent span {
    color: #ffffff !important;
}

/* Theme Subtle & Outline Variants for Ticket-Indent-Label */
.badge-ticket-indent-subtle {
    background-color: var(--primary-soft) !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary-border) !important;
    display: inline-flex !important;
    align-items: center !important;
}

.badge-ticket-indent-subtle i {
    color: var(--primary) !important;
}

/* ==========================================================================
   10. Purple & Cyan Badge / Utility Color System (Light & Dark Theme Adaptive)
   Supports: .badge.bg-purple-100, .badge-soft-purple, .badge-purple,
             .bg-purple-100, .text-purple-800, .border-purple-200, .font-bold
   ========================================================================== */

/* Universal font utility */
.font-bold {
    font-weight: 700 !important;
}

/* Base / Light Theme - Purple Utilities */
.bg-purple-50 {
    background-color: #faf5ff !important;
}

.bg-purple-100 {
    background-color: #f3e8ff !important;
}

.text-purple-600 {
    color: #9333ea !important;
}

.text-purple-700 {
    color: #7e22ce !important;
}

.text-purple-800 {
    color: #6b21a8 !important;
}

.text-purple-900 {
    color: #581c87 !important;
}

.border-purple-200 {
    border-color: #e9d5ff !important;
}

.border-purple-300 {
    border-color: #d8b4fe !important;
}

/* Base / Light Theme - Purple Badges */
.badge.bg-purple-100,
.badge.bg-purple-50,
.badge-purple,
.badge-soft-purple,
.badge-purple-subtle {
    background-color: #f3e8ff !important;
    color: #6b21a8 !important;
    border: 1px solid #e9d5ff !important;
}

.badge.bg-purple-100.text-purple-800,
.badge.bg-purple-50.text-purple-700 {
    background-color: #f3e8ff !important;
    color: #6b21a8 !important;
}

/* Base / Light Theme - Cyan Utilities & Badges */
.bg-cyan-50 {
    background-color: #ecfeff !important;
}

.bg-cyan-100 {
    background-color: #cffafe !important;
}

.text-cyan-700 {
    color: #0e7490 !important;
}

.text-cyan-800 {
    color: #155e75 !important;
}

.border-cyan-200 {
    border-color: #a5f3fc !important;
}

.badge.bg-cyan-100,
.badge.bg-cyan-50,
.badge-cyan,
.badge-soft-cyan,
.badge-cyan-subtle {
    background-color: #cffafe !important;
    color: #155e75 !important;
    border: 1px solid #a5f3fc !important;
}

/* ==========================================================================
   Dark Theme Overrides - Purple & Cyan
   Applied via [data-theme="dark"], [data-bs-theme="dark"], and .dark
   ========================================================================== */
[data-theme="dark"] .bg-purple-50,
[data-bs-theme="dark"] .bg-purple-50,
.dark .bg-purple-50 {
    background-color: rgba(168, 85, 247, 0.12) !important;
}

[data-theme="dark"] .bg-purple-100,
[data-bs-theme="dark"] .bg-purple-100,
.dark .bg-purple-100 {
    background-color: rgba(168, 85, 247, 0.18) !important;
}

[data-theme="dark"] .text-purple-600,
[data-theme="dark"] .text-purple-700,
[data-theme="dark"] .text-purple-800,
[data-theme="dark"] .text-purple-900,
[data-bs-theme="dark"] .text-purple-600,
[data-bs-theme="dark"] .text-purple-700,
[data-bs-theme="dark"] .text-purple-800,
[data-bs-theme="dark"] .text-purple-900,
.dark .text-purple-600,
.dark .text-purple-700,
.dark .text-purple-800,
.dark .text-purple-900 {
    color: #e9d5ff !important;
}

[data-theme="dark"] .border-purple-200,
[data-theme="dark"] .border-purple-300,
[data-bs-theme="dark"] .border-purple-200,
[data-bs-theme="dark"] .border-purple-300,
.dark .border-purple-200,
.dark .border-purple-300 {
    border-color: rgba(168, 85, 247, 0.35) !important;
}

[data-theme="dark"] .badge.bg-purple-100,
[data-theme="dark"] .badge.bg-purple-50,
[data-theme="dark"] .badge-purple,
[data-theme="dark"] .badge-soft-purple,
[data-theme="dark"] .badge-purple-subtle,
[data-bs-theme="dark"] .badge.bg-purple-100,
[data-bs-theme="dark"] .badge.bg-purple-50,
[data-bs-theme="dark"] .badge-purple,
[data-bs-theme="dark"] .badge-soft-purple,
[data-bs-theme="dark"] .badge-purple-subtle,
.dark .badge.bg-purple-100,
.dark .badge.bg-purple-50,
.dark .badge-purple,
.dark .badge-soft-purple,
.dark .badge-purple-subtle {
    background-color: rgba(168, 85, 247, 0.18) !important;
    color: #e9d5ff !important;
    border-color: rgba(168, 85, 247, 0.35) !important;
}

[data-theme="dark"] .badge.bg-purple-100.text-purple-800,
[data-theme="dark"] .badge.bg-purple-50.text-purple-700,
[data-bs-theme="dark"] .badge.bg-purple-100.text-purple-800,
[data-bs-theme="dark"] .badge.bg-purple-50.text-purple-700,
.dark .badge.bg-purple-100.text-purple-800,
.dark .badge.bg-purple-50.text-purple-700 {
    background-color: rgba(168, 85, 247, 0.18) !important;
    color: #e9d5ff !important;
}

/* Dark Theme - Cyan */
[data-theme="dark"] .bg-cyan-50,
[data-bs-theme="dark"] .bg-cyan-50,
.dark .bg-cyan-50 {
    background-color: rgba(6, 182, 212, 0.12) !important;
}

[data-theme="dark"] .bg-cyan-100,
[data-bs-theme="dark"] .bg-cyan-100,
.dark .bg-cyan-100 {
    background-color: rgba(6, 182, 212, 0.18) !important;
}

[data-theme="dark"] .text-cyan-700,
[data-theme="dark"] .text-cyan-800,
[data-bs-theme="dark"] .text-cyan-700,
[data-bs-theme="dark"] .text-cyan-800,
.dark .text-cyan-700,
.dark .text-cyan-800 {
    color: #a5f3fc !important;
}

[data-theme="dark"] .border-cyan-200,
[data-bs-theme="dark"] .border-cyan-200,
.dark .border-cyan-200 {
    border-color: rgba(6, 182, 212, 0.35) !important;
}

[data-theme="dark"] .badge.bg-cyan-100,
[data-theme="dark"] .badge.bg-cyan-50,
[data-theme="dark"] .badge-cyan,
[data-theme="dark"] .badge-soft-cyan,
[data-theme="dark"] .badge-cyan-subtle,
[data-bs-theme="dark"] .badge.bg-cyan-100,
[data-bs-theme="dark"] .badge.bg-cyan-50,
[data-bs-theme="dark"] .badge-cyan,
[data-bs-theme="dark"] .badge-soft-cyan,
[data-bs-theme="dark"] .badge-cyan-subtle,
.dark .badge.bg-cyan-100,
.dark .badge.bg-cyan-50,
.dark .badge-cyan,
.dark .badge-soft-cyan,
.dark .badge-cyan-subtle {
    background-color: rgba(6, 182, 212, 0.18) !important;
    color: #a5f3fc !important;
    border-color: rgba(6, 182, 212, 0.35) !important;
}

/* ==========================================================================
   11. Icon Box & Solid Purple Badges (.bg-purple-600, .w-8, .h-8, etc.)
   Theme Adaptive: Light & Dark Mode
   ========================================================================== */

/* Dimension Utilities */
.w-8 {
    width: 2rem !important;
}

.h-8 {
    height: 2rem !important;
}

.w-7 {
    width: 1.75rem !important;
}

.h-7 {
    height: 1.75rem !important;
}

.w-6 {
    width: 1.5rem !important;
}

.h-6 {
    height: 1.5rem !important;
}

.w-5 {
    width: 1.25rem !important;
}

.h-5 {
    height: 1.25rem !important;
}

/* Radius Utilities */
.rounded-lg {
    border-radius: var(--radius-lg, 10px) !important;
}

.rounded-md {
    border-radius: var(--radius-md, 8px) !important;
}

.rounded-xl {
    border-radius: var(--radius-xl, 14px) !important;
}

/* Flexbox Layout Utilities */
.flex {
    display: flex !important;
}

.inline-flex {
    display: inline-flex !important;
}

.items-center {
    align-items: center !important;
}

.justify-center {
    justify-content: center !important;
}

/* Typography Utilities */
.text-xs {
    font-size: 0.75rem !important;
}

.text-sm {
    font-size: 0.875rem !important;
}

/* Shadow Utilities */
.shadow-xs {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.shadow-sm {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1) !important;
}

/* Solid Purple Backgrounds - Light Theme (Base) */
.bg-purple-500 {
    background-color: #a855f7 !important;
    color: #ffffff !important;
}

.bg-purple-600 {
    background-color: #9333ea !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(147, 51, 234, 0.25);
}

.bg-purple-700 {
    background-color: #7e22ce !important;
    color: #ffffff !important;
}

/* Feature Icon Box Component Class */
.icon-box-purple,
.feature-icon-purple {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-lg, 10px);
    background-color: #9333ea;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    box-shadow: 0 2px 6px rgba(147, 51, 234, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ==========================================================================
   Dark Theme Overrides - Solid Purple & Icon Boxes
   Applied via [data-theme="dark"], [data-bs-theme="dark"], and .dark
   ========================================================================== */
[data-theme="dark"] .bg-purple-500,
[data-bs-theme="dark"] .bg-purple-500,
.dark .bg-purple-500 {
    background-color: #c084fc !important;
    color: #1e1b4b !important;
}

[data-theme="dark"] .bg-purple-600,
[data-bs-theme="dark"] .bg-purple-600,
.dark .bg-purple-600 {
    background-color: #a855f7 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.45) !important;
}

[data-theme="dark"] .bg-purple-700,
[data-bs-theme="dark"] .bg-purple-700,
.dark .bg-purple-700 {
    background-color: #9333ea !important;
    color: #ffffff !important;
}

[data-theme="dark"] .icon-box-purple,
[data-theme="dark"] .feature-icon-purple,
[data-bs-theme="dark"] .icon-box-purple,
[data-bs-theme="dark"] .feature-icon-purple,
.dark .icon-box-purple,
.dark .feature-icon-purple {
    background-color: #a855f7 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.45) !important;
}

[data-theme="dark"] .shadow-xs,
[data-bs-theme="dark"] .shadow-xs,
.dark .shadow-xs {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.35) !important;
}