
/* ================================================================
   1. DESIGN TOKENS
   ================================================================ */
:root {
    /* Tenant branding (overridden inline by Blade) */
    --sd-primary: #0066cc;
    --sd-primary-rgb: 0, 102, 204;

    /* Neutral palette */
    --sd-bg-page: #ebeef1;
    --sd-bg-white: #ffffff;
    --sd-bg-light: #fafafa;
    --sd-bg-muted: #f3f3f3;
    --sd-bg-panel-header: #f7f8fa;

    /* Borders */
    --sd-border: #ddd;
    --sd-border-light: #eee;

    /* Text */
    --sd-text-dark: #222;
    --sd-text-body: #333;
    --sd-text-secondary: #555;
    --sd-text-muted: #888;
    --sd-text-light: #999;
    --sd-text-label: #444;

    /* Typography */
    --sd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sd-font-mono: "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
    --sd-fs-base: 13px;
    --sd-fs-sm: 12px;
    --sd-fs-xs: 11px;
    --sd-fs-lg: 15px;

    /* Spacing */
    --sd-space-xs: 4px;
    --sd-space-sm: 8px;
    --sd-space-md: 14px;
    --sd-space-lg: 20px;
    --sd-space-xl: 24px;

    /* Radius */
    --sd-radius: 4px;
    --sd-radius-lg: 6px;
    --sd-radius-pill: 10px;

    /* Shadows */
    --sd-shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --sd-shadow-md: 0 2px 8px rgba(0,0,0,.08);
    --sd-shadow-dropdown: 0 4px 16px rgba(0,0,0,.12);

    /* Semantic colors */
    --sd-success: #27ae60;
    --sd-danger: #c0392b;
    --sd-warning: #f39c12;
    --sd-info: #3498db;

    /* Table row stripes - subtle pink alternating */
    --sd-row-even: #ffffff;
    --sd-row-odd: #fef8f9;
    --sd-row-hover: #e3f2fd;
}


/* ================================================================
   2. BASE / BOOTSTRAP OVERRIDES
   ================================================================ */
body {
    font-family: var(--sd-font);
    font-size: var(--sd-fs-base);
    color: var(--sd-text-body);
    background: var(--sd-bg-page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--sd-primary); }
a:hover { color: var(--sd-primary); filter: brightness(.85); }

/* Override Bootstrap btn-primary to use tenant color */
.btn-primary {
    --bs-btn-bg: var(--sd-primary);
    --bs-btn-border-color: var(--sd-primary);
    --bs-btn-hover-bg: var(--sd-primary);
    --bs-btn-hover-border-color: var(--sd-primary);
    --bs-btn-active-bg: var(--sd-primary);
    --bs-btn-active-border-color: var(--sd-primary);
    --bs-btn-disabled-bg: var(--sd-primary);
    --bs-btn-disabled-border-color: var(--sd-primary);
}
.btn-primary:hover { filter: brightness(.9); }

.btn-outline-primary {
    --bs-btn-color: var(--sd-primary);
    --bs-btn-border-color: var(--sd-primary);
    --bs-btn-hover-bg: var(--sd-primary);
    --bs-btn-hover-border-color: var(--sd-primary);
    --bs-btn-active-bg: var(--sd-primary);
    --bs-btn-active-border-color: var(--sd-primary);
}

/* Compact forms */
.form-control, .form-select {
    font-size: var(--sd-fs-base);
    padding: 6px 10px;
    border-color: var(--sd-border);
}
.form-control:focus, .form-select:focus {
    border-color: var(--sd-primary);
    box-shadow: 0 0 0 2px rgba(var(--sd-primary-rgb), .12);
}
.form-control:disabled, .form-select:disabled {
    background: #f5f5f5;
    opacity: .7;
}

.form-label {
    font-size: var(--sd-fs-sm);
    font-weight: 600;
    color: var(--sd-text-label);
    margin-bottom: 5px;
}
.form-label .required { color: var(--sd-danger); }

textarea.form-control { resize: vertical; min-height: 80px; }

/* Compact buttons */
.btn { font-size: var(--sd-fs-base); }
.btn-sm { font-size: var(--sd-fs-sm); padding: 4px 10px; }

/* Override Bootstrap checkbox to use tenant color */
.form-check-input:checked {
    background-color: var(--sd-primary);
    border-color: var(--sd-primary);
}

/* Override Bootstrap pagination */
.page-item.active .page-link {
    background-color: var(--sd-primary);
    border-color: var(--sd-primary);
}
.page-link { color: var(--sd-primary); font-size: var(--sd-fs-sm); }
.page-link:hover { color: var(--sd-primary); }


/* ================================================================
   3. LAYOUT COMPONENTS
   ================================================================ */

/* ─── Professional Navigation ─── */
.sd-navbar {
    background: var(--sd-bg-white);
    border-bottom: 1px solid var(--sd-border);
    box-shadow: 0 2px 4px rgba(0,0,0,.04);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.sd-navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Brand */
.sd-navbar-brand { display: flex; align-items: center; }
.sd-navbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sd-logo-image { height: 40px; width: auto; }
.sd-logo-icon {
    width: 40px;
    height: 40px;
    background: #6032ac;
    border-radius: var(--sd-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}
.sd-favicon-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
.sd-logo-text { display: flex; flex-direction: column; }
.sd-logo-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--sd-text-dark);
    line-height: 1.2;
}
.sd-logo-subtitle {
    font-size: 11px;
    color: var(--sd-text-muted);
    line-height: 1.2;
}

/* Menu */
.sd-navbar-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 48px;
}
.sd-navbar-link {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--sd-text-secondary);
    text-decoration: none;
    border-radius: var(--sd-radius);
    transition: all .2s;
}
.sd-navbar-link:hover {
    background: var(--sd-bg-light);
    color: var(--sd-primary);
    text-decoration: none;
}
.sd-navbar-link.active {
    background: rgba(var(--sd-primary-rgb), .1);
    color: var(--sd-primary);
    font-weight: 600;
}

/* Actions */
.sd-navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sd-navbar-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--sd-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sd-text-secondary);
    cursor: pointer;
    transition: all .2s;
}
.sd-navbar-icon-btn:hover {
    background: var(--sd-bg-light);
    color: var(--sd-text-dark);
}
.sd-navbar-icon-btn .sd-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 10px;
    line-height: 1;
}
.sd-navbar-divider {
    width: 1px;
    height: 24px;
    background: var(--sd-border-light);
    margin: 0 4px;
}

/* Profile Button */
.sd-navbar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border: none;
    background: transparent;
    border-radius: var(--sd-radius-lg);
    cursor: pointer;
    transition: background .2s;
}
.sd-navbar-profile:hover { background: var(--sd-bg-light); }
.sd-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}
.sd-profile-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--sd-text-dark);
}
.sd-profile-arrow {
    font-size: 10px;
    color: var(--sd-text-muted);
    transition: transform .2s;
}

/* ─── Profile Sidebar ─── */
.sd-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    pointer-events: none;
}
.sd-sidebar.active { pointer-events: auto; }
.sd-sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.5);
    opacity: 0;
    transition: opacity .3s;
}
.sd-sidebar.active .sd-sidebar-overlay { opacity: 1; }

.sd-sidebar-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    background: var(--sd-bg-white);
    box-shadow: -2px 0 16px rgba(0,0,0,.1);
    transform: translateX(100%);
    transition: transform .3s;
    display: flex;
    flex-direction: column;
}
.sd-sidebar.active .sd-sidebar-panel { transform: translateX(0); }

.sd-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--sd-border-light);
}
.sd-sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}
.sd-sidebar-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--sd-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sd-text-muted);
    cursor: pointer;
    transition: all .2s;
}
.sd-sidebar-close:hover {
    background: var(--sd-bg-light);
    color: var(--sd-text-dark);
}

.sd-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.sd-profile-card {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--sd-border-light);
    margin-bottom: 16px;
}
.sd-profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    font-weight: 600;
    margin: 0 auto 16px;
}
.sd-profile-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
}

.sd-sidebar-menu { display: flex; flex-direction: column; }
.sd-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--sd-radius);
    color: var(--sd-text-dark);
    text-decoration: none;
    transition: background .2s;
}
.sd-sidebar-item:hover {
    background: var(--sd-bg-light);
    text-decoration: none;
}
.sd-sidebar-item i { width: 20px; text-align: center; color: var(--sd-text-muted); }
.sd-sidebar-divider {
    height: 1px;
    background: var(--sd-border-light);
    margin: 12px 0;
}

/* ─── Page Header ─── */
.sd-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.sd-page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--sd-text-dark);
    margin: 0;
}
.sd-page-subtitle {
    font-size: var(--sd-fs-sm);
    color: var(--sd-text-muted);
    margin: 4px 0 0;
}

/* ─── Flash Messages ─── */
.sd-flash { font-size: var(--sd-fs-sm); padding: 10px 16px; border-radius: var(--sd-radius); }

/* ─── Footer ─── */
.sd-footer {
    background: var(--sd-bg-white);
    border-top: 1px solid var(--sd-border);
    padding: 12px 16px;
    font-size: var(--sd-fs-xs);
    color: var(--sd-text-light);
    margin-top: auto;
}


/* ─── Request Filter Sidebar ─── */
.sd-request-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 64px);
}
.sd-request-sidebar {
    width: 260px;
    background: var(--sd-bg-white);
    border-right: 1px solid var(--sd-border-light);
    flex-shrink: 0;
    overflow-y: auto;
}
.sd-request-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--sd-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sd-request-sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}
.sd-sidebar-toggle {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--sd-radius);
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--sd-text-muted);
    cursor: pointer;
}
.sd-request-sidebar-body { padding: 16px; }
.sd-filter-group {
    margin-bottom: 24px;
}
.sd-filter-group:last-child { margin-bottom: 0; }
.sd-filter-group-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--sd-text-muted);
    padding: 0 12px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sd-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--sd-radius);
    color: var(--sd-text-dark);
    text-decoration: none;
    font-size: 13px;
    transition: background .2s;
    margin-bottom: 2px;
}
.sd-filter-item:hover {
    background: var(--sd-bg-light);
    text-decoration: none;
}
.sd-filter-item.active {
    background: rgba(var(--sd-primary-rgb), .1);
    color: var(--sd-primary);
    font-weight: 500;
}
.sd-filter-item i { font-size: 14px; width: 18px; text-align: center; }
.sd-filter-item span:nth-child(2) { flex: 1; }
.sd-filter-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--sd-text-muted);
    background: var(--sd-bg-muted);
    padding: 2px 8px;
    border-radius: 10px;
}
.sd-filter-item.active .sd-filter-count {
    background: rgba(var(--sd-primary-rgb), .15);
    color: var(--sd-primary);
}

.sd-request-main {
    flex: 1;
    min-width: 0;
    background: var(--sd-bg-page);
}

/* ─── Toolbar ─── */
.sd-toolbar {
    background: var(--sd-bg-white);
    border-bottom: 1px solid var(--sd-border-light);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.sd-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.sd-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sd-toolbar-btn {
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--sd-border);
    background: var(--sd-bg-white);
    border-radius: var(--sd-radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--sd-text-dark);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}
.sd-toolbar-btn:hover {
    background: var(--sd-bg-light);
    border-color: var(--sd-primary);
    color: var(--sd-primary);
    text-decoration: none;
}
.sd-toolbar-btn.btn-primary {
    background: var(--sd-primary);
    border-color: var(--sd-primary);
    color: #fff;
}
.sd-toolbar-btn.btn-primary:hover {
    filter: brightness(.9);
    color: #fff;
}
.sd-toolbar-search {
    position: relative;
    flex: 1;
    max-width: 400px;
}
.sd-toolbar-search input {
    height: 36px;
    padding-left: 36px;
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius);
    font-size: 13px;
}
.sd-toolbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sd-text-muted);
    pointer-events: none;
}
.sd-toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--sd-border-light);
}

/* ─── Dropdown Menus (My Views & Actions) ─── */
.sd-dropdown-menu {
    min-width: 240px;
    padding: 6px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    border: 1px solid #d0d5dd;
    border-radius: 8px;
}

.sd-dropdown-menu .dropdown-header {
    padding: 8px 14px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #667085;
    margin-top: 4px;
}

.sd-dropdown-menu .dropdown-header:first-child {
    margin-top: 0;
}

.sd-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #344054;
    text-decoration: none;
}

.sd-dropdown-item:hover {
    background: rgba(var(--sd-primary-rgb), 0.06);
    color: var(--sd-primary);
}

.sd-dropdown-item:focus {
    outline: none;
    background: rgba(var(--sd-primary-rgb), 0.08);
    color: var(--sd-primary);
}

.sd-dropdown-item.active {
    background: rgba(var(--sd-primary-rgb), 0.1);
    color: var(--sd-primary);
    font-weight: 600;
}

.sd-dropdown-item.active:hover {
    background: rgba(var(--sd-primary-rgb), 0.14);
}

.sd-dropdown-item > span:first-child {
    font-size: 13px;
    font-weight: 500;
}

.sd-dropdown-item .badge {
    font-size: 10px;
    padding: 3px 7px;
    font-weight: 600;
    border-radius: 10px;
}

.sd-dropdown-item.active .badge {
    background: var(--sd-primary) !important;
    color: #fff;
}

/* ─── Column Manager ─── */
.sd-column-list { display: flex; flex-direction: column; gap: 8px; }
.sd-column-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--sd-radius);
    cursor: pointer;
    transition: background .2s;
}
.sd-column-item:hover { background: var(--sd-bg-light); }

/* ================================================================
   4. DATA DISPLAY
   ================================================================ */

/* ─── Panels (Cards) ─── */
.sd-panel {
    background: var(--sd-bg-white);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--sd-shadow-sm);
}
.sd-panel-header {
    background: var(--sd-bg-panel-header);
    padding: 10px 16px;
    font-size: var(--sd-fs-base);
    font-weight: 600;
    color: var(--sd-text-dark);
    border-bottom: 1px solid var(--sd-border-light);
    border-radius: var(--sd-radius-lg) var(--sd-radius-lg) 0 0;
}
.sd-panel-body { padding: 16px; }
.sd-panel-body--np { padding: 0; }

/* ─── Stat Cards ─── */
.sd-stat-card {
    background: var(--sd-bg-white);
    border: 1px solid var(--sd-border-light);
    border-radius: var(--sd-radius-lg);
    padding: 16px 18px;
    box-shadow: var(--sd-shadow-sm);
}
.sd-stat-label {
    font-size: var(--sd-fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--sd-text-muted);
    margin-bottom: 6px;
}
.sd-stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--sd-text-dark);
    line-height: 1;
}

/* ─── Professional Data Table ─── */
.sd-table-container {
    background: var(--sd-bg-white);
    border-top: 1px solid var(--sd-border-light);
    overflow-x: auto;
}

.sd-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.sd-data-table thead {
    background: #fafbfc;
    border-bottom: 2px solid #e8ecf0;
    position: sticky;
    top: 0;
    z-index: 10;
}
.sd-data-table thead th {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #5a6c7d;
    white-space: nowrap;
    border: none;
    text-align: left;
}
.sd-data-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border: none;
    border-bottom: 1px solid #f0f2f5;
}

/* Subtle alternating pink rows */
.sd-data-table tbody tr:nth-child(even) { background: var(--sd-row-even); }
.sd-data-table tbody tr:nth-child(odd) { background: var(--sd-row-odd); }
.sd-data-table tbody tr:hover { background: var(--sd-row-hover) !important; cursor: pointer; }

/* Table container border */
.sd-data-table {
    border: 1px solid #e8ecf0;
    border-radius: 6px;
    overflow: hidden;
}

/* Column widths */
.sd-col-checkbox { width: 40px; text-align: center; }
.sd-col-id { width: 100px; }
.sd-col-subject { width: auto; min-width: 250px; }
.sd-col-requester { width: 180px; }
.sd-col-status { width: 120px; }
.sd-col-priority { width: 100px; }
.sd-col-category { width: 140px; }
.sd-col-agent { width: 150px; }
.sd-col-created { width: 130px; }

/* Table cells */
.sd-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sd-user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #6c757d;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}
.sd-user-cell .sd-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--sd-text-dark);
    line-height: 1.3;
}
.sd-user-cell .sd-user-email {
    font-size: 11px;
    color: var(--sd-text-muted);
    line-height: 1.3;
}

.sd-agent-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.sd-category-text {
    font-size: 13px;
    color: var(--sd-text-dark);
}

.sd-date-cell {
    font-size: 13px;
    color: var(--sd-text-dark);
    line-height: 1.4;
}
.sd-date-time {
    font-size: 11px;
    color: var(--sd-text-muted);
}

/* Empty State */
.sd-empty-state {
    text-align: center;
    padding: 80px 20px;
}
.sd-empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--sd-bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: var(--sd-text-light);
}
.sd-empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--sd-text-dark);
}

/* Toolbar info */
.sd-toolbar-info {
    font-size: 13px;
    color: var(--sd-text-muted);
    white-space: nowrap;
}
.sd-toolbar-pagination {
    display: flex;
    gap: 4px;
}

/* Legacy table support */
.sd-table-wrapper { overflow-x: auto; }
.sd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--sd-fs-sm);
}
.sd-table thead {
    background: var(--sd-bg-panel-header);
    border-bottom: 2px solid var(--sd-border);
}
.sd-table thead th {
    padding: 9px 12px;
    font-size: var(--sd-fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--sd-text-secondary);
    white-space: nowrap;
    border: none;
}
.sd-table tbody td {
    padding: 8px 12px;
    vertical-align: middle;
    border: none;
    border-bottom: 1px solid var(--sd-border-light);
}
.sd-table tbody tr:nth-child(even) { background: var(--sd-row-even); }
.sd-table tbody tr:nth-child(odd) { background: var(--sd-row-odd); }
.sd-table tbody tr:hover { background: var(--sd-row-hover) !important; }

.sd-table-checkbox { width: 16px; height: 16px; cursor: pointer; }

/* ─── Table Cell Components ─── */
.sd-ticket-link {
    font-family: var(--sd-font-mono);
    font-weight: 600;
    font-size: var(--sd-fs-sm);
    color: var(--sd-primary);
    text-decoration: none;
    padding: 4px 10px;
    border: 2px solid var(--sd-primary);
    border-radius: 2px;
    display: inline-block;
    background: rgba(var(--sd-primary-rgb, 96, 50, 172), 0.05);
}
.sd-ticket-link:hover {
    text-decoration: none;
    background: rgba(var(--sd-primary-rgb, 96, 50, 172), 0.1);
}

.sd-subject-link {
    color: var(--sd-text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--sd-fs-sm);
}
.sd-subject-link:hover { color: var(--sd-primary); text-decoration: underline; }

.sd-user-info { display: flex; align-items: center; gap: 8px; }
.sd-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}
.sd-user-avatar--sm { width: 26px; height: 26px; font-size: 10px; }
.sd-user-name { font-weight: 600; font-size: var(--sd-fs-sm); color: var(--sd-text-dark); }
.sd-user-email { font-size: var(--sd-fs-xs); color: var(--sd-text-muted); }
.sd-agent-name { font-size: var(--sd-fs-xs); color: var(--sd-text-muted); }
.sd-date-text { font-size: var(--sd-fs-xs); color: var(--sd-text-muted); white-space: nowrap; }

/* ─── Badges ─── */
.sd-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--sd-fs-xs);
    font-weight: 600;
}
.sd-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.sd-priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--sd-fs-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--sd-radius);
    border: 1px solid;
    white-space: nowrap;
}
.sd-category-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--sd-fs-xs);
    color: var(--sd-text-secondary);
}
.sd-category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.sd-impact-badge, .sd-urgency-badge {
    font-size: var(--sd-fs-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--sd-radius);
    display: inline-block;
}

.sd-vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #f5d020, #f5ab23);
    color: #7c5c00;
    font-size: var(--sd-fs-xs);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--sd-radius-pill);
}
.sd-vip-badge i { font-size: 9px; }

/* ─── Filters ─── */
.sd-filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
}
.sd-filter-input-wrapper { position: relative; flex: 1; min-width: 180px; }
.sd-filter-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sd-text-light);
    font-size: 12px;
    pointer-events: none;
}
.sd-filter-input {
    padding-left: 32px !important;
    font-size: var(--sd-fs-sm) !important;
}

.sd-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0 16px 10px;
}
.sd-active-filters-label {
    font-size: var(--sd-fs-xs);
    font-weight: 600;
    color: var(--sd-text-muted);
    text-transform: uppercase;
}
.sd-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(var(--sd-primary-rgb), .08);
    color: var(--sd-primary);
    font-size: var(--sd-fs-xs);
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--sd-radius-pill);
    border: 1px solid rgba(var(--sd-primary-rgb), .15);
}
.sd-filter-tag a { color: inherit; text-decoration: none; }

/* ─── Bulk Actions ─── */
.sd-bulk-actions-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(var(--sd-primary-rgb), .06);
    border-bottom: 1px solid var(--sd-border-light);
    font-size: var(--sd-fs-sm);
}
.sd-bulk-actions-bar.active { display: flex; }
.sd-bulk-actions-label { font-weight: 600; color: var(--sd-text-secondary); }

/* ─── Table Footer / Pagination ─── */
.sd-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--sd-border-light);
    font-size: var(--sd-fs-xs);
    color: var(--sd-text-muted);
}

/* ─── Empty State ─── */
.sd-empty-state { text-align: center; padding: 48px 20px; }
.sd-empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--sd-bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: var(--sd-text-light);
}
.sd-empty-state-title { font-size: 16px; font-weight: 600; color: var(--sd-text-dark); margin-bottom: 6px; }
.sd-empty-state-text { font-size: var(--sd-fs-sm); color: var(--sd-text-muted); margin-bottom: 16px; }

/* ─── Detail List (Sidebar) ─── */
.sd-detail-list { list-style: none; padding: 0; margin: 0; }
.sd-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--sd-border-light);
}
.sd-detail-item:last-child { border-bottom: none; }
.sd-detail-item dt {
    font-size: var(--sd-fs-xs);
    font-weight: 500;
    color: var(--sd-text-muted);
}
.sd-detail-item dd {
    font-size: var(--sd-fs-sm);
    font-weight: 600;
    color: var(--sd-text-dark);
    margin: 0;
    text-align: right;
}
.sd-detail-sub { font-size: var(--sd-fs-xs); color: var(--sd-text-light); }

.sd-sla-due { font-size: var(--sd-fs-xs); font-weight: 600; }
.sd-sla-due--overdue { color: var(--sd-danger); }

/* ─── Timeline ─── */
.sd-timeline { display: flex; flex-direction: column; gap: 0; }
.sd-timeline-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    position: relative;
}
.sd-timeline-item::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 34px;
    bottom: -10px;
    width: 2px;
    background: var(--sd-border-light);
}
.sd-timeline-item:last-child::before { display: none; }

.sd-timeline-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    z-index: 1;
    color: #fff;
}
.sd-timeline-icon--created { background: var(--sd-success); }
.sd-timeline-icon--response { background: var(--sd-info); }
.sd-timeline-icon--resolved { background: var(--sd-success); }
.sd-timeline-icon--closed { background: #999; }

.sd-timeline-content { flex: 1; min-width: 0; }
.sd-timeline-title { font-size: var(--sd-fs-sm); font-weight: 500; color: var(--sd-text-dark); }
.sd-timeline-time { font-size: var(--sd-fs-xs); color: var(--sd-text-light); }


/* ================================================================
   5. TICKET COMPONENTS
   ================================================================ */

/* ─── Ticket Header ─── */
.sd-ticket-detail-wrapper { margin-bottom: 16px; }

.sd-ticket-header {
    background: var(--sd-bg-white);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-lg);
    padding: 16px 20px;
    box-shadow: var(--sd-shadow-sm);
}
.sd-ticket-header-back { margin-bottom: 10px; }
.sd-back-link {
    font-size: var(--sd-fs-sm);
    color: var(--sd-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sd-back-link:hover { color: var(--sd-primary); filter: none; }

.sd-ticket-header-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}
.sd-ticket-number {
    font-family: var(--sd-font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--sd-primary);
    margin: 0;
    padding: 6px 14px;
    border: 2px solid var(--sd-primary);
    border-radius: 2px;
    display: inline-block;
    background: rgba(var(--sd-primary-rgb, 96, 50, 172), 0.05);
}
.sd-ticket-subject {
    font-size: var(--sd-fs-base);
    color: var(--sd-text-secondary);
    margin: 0;
}

/* ─── Ticket Requester Bar ─── */
.sd-ticket-requester-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--sd-bg-light);
    border-radius: var(--sd-radius);
    margin-top: 12px;
    border: 1px solid var(--sd-border-light);
}
.sd-requester-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sd-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}
.sd-requester-info { flex: 1; }
.sd-requester-name { font-weight: 600; font-size: var(--sd-fs-sm); color: var(--sd-text-dark); display: flex; align-items: center; gap: 6px; }
.sd-requester-details { font-size: var(--sd-fs-xs); color: var(--sd-text-muted); display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.sd-requester-details i { font-size: 10px; margin-right: 3px; }

/* ─── Tabs ─── */
.sd-tab-navigation {
    display: flex;
    border-bottom: 2px solid var(--sd-border);
    background: var(--sd-bg-white);
    padding: 0 16px;
    gap: 0;
    overflow-x: auto;
}
.sd-tab-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    font-size: var(--sd-fs-sm);
    font-weight: 500;
    color: var(--sd-text-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.sd-tab-link:hover { color: var(--sd-primary); text-decoration: none; filter: none; }
.sd-tab-link.active {
    color: var(--sd-primary);
    border-bottom-color: var(--sd-primary);
    font-weight: 600;
}
.sd-tab-content { display: none; }
.sd-tab-content.active { display: block; }

/* ─── Messages / Conversation ─── */
.sd-ticket-message {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--sd-border-light);
}
.sd-ticket-message:last-child { border-bottom: none; }

.sd-message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}
.sd-message-avatar--agent { background: var(--sd-primary); }
.sd-message-avatar--customer { background: #6c757d; }

.sd-message-content { flex: 1; min-width: 0; }
.sd-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.sd-message-author { font-size: var(--sd-fs-sm); }
.sd-message-author strong { font-weight: 600; color: var(--sd-text-dark); }
.sd-message-email { font-size: var(--sd-fs-xs); color: var(--sd-text-muted); }
.sd-message-time { font-size: var(--sd-fs-xs); color: var(--sd-text-light); text-align: right; }
.sd-message-body {
    font-size: var(--sd-fs-base);
    color: var(--sd-text-body);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.sd-reply-message { border-left: 3px solid transparent; padding-left: 12px; margin-left: -12px; }
.sd-reply-message--agent { border-left-color: var(--sd-primary); }
.sd-reply-message--customer { border-left-color: #6c757d; }
.sd-reply-message--internal {
    border-left-color: var(--sd-warning);
    background: #fef9e7;
    padding: 10px 12px;
    border-radius: 0 var(--sd-radius) var(--sd-radius) 0;
}

.sd-user-badge, .sd-internal-badge {
    font-size: var(--sd-fs-xs);
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--sd-radius);
}
.sd-user-badge { background: #e8f4fd; color: #0c5460; }
.sd-internal-badge { background: #fff3cd; color: #856404; }

/* ─── Attachments (in messages) ─── */
.sd-msg-attachments { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--sd-border-light); }
.sd-msg-attachments-header {
    font-size: var(--sd-fs-xs);
    font-weight: 600;
    color: var(--sd-text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.sd-msg-attachments-list { display: flex; flex-wrap: wrap; gap: 6px; }
.sd-attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius);
    font-size: var(--sd-fs-xs);
    color: var(--sd-text-secondary);
    text-decoration: none;
    background: var(--sd-bg-light);
    transition: background .15s;
}
.sd-attachment-item:hover { background: var(--sd-bg-muted); text-decoration: none; filter: none; color: var(--sd-text-dark); }
.sd-attachment-name { font-weight: 500; }
.sd-attachment-size { color: var(--sd-text-light); }

/* ─── Resolution ─── */
.sd-resolution-container { max-width: 860px; }
.sd-resolution-header {
    background: #eafaf1 !important;
    border-bottom-color: #c8e6c9 !important;
}
.sd-resolution-header i { color: var(--sd-success) !important; }
.sd-resolution-header h3 { color: var(--sd-success); }
.sd-resolution-header p { color: var(--sd-text-muted); font-size: var(--sd-fs-sm); margin: 0; }

.sd-resolution-type-option {
    border: 2px solid var(--sd-border);
    border-radius: var(--sd-radius-lg);
    padding: 14px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.sd-resolution-type-option:hover { border-color: var(--sd-primary); background: rgba(var(--sd-primary-rgb), .03); }
.sd-resolution-type-option input[type="radio"]:checked ~ .sd-resolution-type-content { color: var(--sd-primary); }
.sd-resolution-type-title { font-weight: 600; font-size: var(--sd-fs-base); }
.sd-resolution-type-desc { font-size: var(--sd-fs-xs); color: var(--sd-text-muted); margin-top: 2px; }

/* ─── Tasks ─── */
.sd-tasks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.sd-tasks-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--sd-text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sd-tasks-header h2 i { color: var(--sd-primary); }
.sd-tasks-count {
    background: var(--sd-bg-muted);
    padding: 2px 8px;
    border-radius: var(--sd-radius-pill);
    font-size: var(--sd-fs-xs);
    font-weight: 600;
    color: var(--sd-text-muted);
}

.sd-task-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sd-task-title { font-weight: 600; font-size: var(--sd-fs-base); color: var(--sd-text-dark); }
.sd-task-description { font-size: var(--sd-fs-sm); color: var(--sd-text-secondary); margin-top: 4px; }

.sd-task-status {
    font-size: var(--sd-fs-xs);
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--sd-radius);
    white-space: nowrap;
}
.sd-task-status--pending { background: #f0f0f0; color: #777; }
.sd-task-status--in-progress { background: #e0f0ff; color: #0066cc; }
.sd-task-status--completed { background: #e0f5e8; color: #1e7e34; }

.sd-task-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    font-size: var(--sd-fs-xs);
    color: var(--sd-text-muted);
}
.sd-task-footer .sd-overdue { color: var(--sd-danger); font-weight: 600; }

/* ─── History Table Extras ─── */
.sd-table-time-main { font-weight: 500; font-size: var(--sd-fs-sm); }
.sd-table-time-sub { font-size: var(--sd-fs-xs); color: var(--sd-text-light); }
.sd-table-user { display: flex; align-items: center; gap: 6px; }
.sd-table-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}
.sd-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--sd-fs-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--sd-radius);
}
.sd-action-badge--created { background: #e0f5e8; color: #1e7e34; }
.sd-action-badge--updated { background: rgba(var(--sd-primary-rgb), .1); color: var(--sd-primary); }
.sd-action-badge--resolved { background: #e0f5e8; color: #1e7e34; }
.sd-action-badge--closed { background: #f0f0f0; color: #777; }
.sd-action-badge--reply { background: rgba(var(--sd-primary-rgb), .1); color: var(--sd-primary); }
.sd-action-badge--note { background: #fff3cd; color: #856404; }

.sd-activity-changes { margin-top: 6px; }
.sd-change-item {
    font-size: var(--sd-fs-xs);
    color: var(--sd-text-secondary);
    padding: 2px 0;
}
.sd-change-field { font-weight: 600; }
.sd-change-old { color: var(--sd-text-light); text-decoration: line-through; }
.sd-change-new { font-weight: 600; color: var(--sd-text-dark); }


/* ================================================================
   6. FORM COMPONENTS
   ================================================================ */

/* ─── Form Help / Error ─── */
.sd-form-help {
    font-size: var(--sd-fs-xs);
    color: var(--sd-text-light);
    margin-top: 4px;
}
.sd-form-error {
    font-size: var(--sd-fs-xs);
    color: var(--sd-danger);
    margin-top: 4px;
}

/* ─── Form Actions ─── */
.sd-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--sd-border-light);
}
.sd-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--sd-fs-sm);
    cursor: pointer;
}

/* ─── Template Dropdown ─── */
.sd-template-dropdown-wrap { position: relative; }
.sd-template-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--sd-bg-white);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius);
    font-size: var(--sd-fs-base);
    color: var(--sd-text-secondary);
    cursor: pointer;
    transition: border-color .15s;
    text-align: left;
}
.sd-template-btn:hover { border-color: var(--sd-primary); }
.sd-template-btn.sd-open { border-color: var(--sd-primary); box-shadow: 0 0 0 2px rgba(var(--sd-primary-rgb), .12); }
.sd-template-btn i:last-child { transition: transform .2s; font-size: 11px; color: var(--sd-text-light); }

.sd-template-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--sd-bg-white);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-lg);
    box-shadow: var(--sd-shadow-dropdown);
    z-index: 100;
    max-height: 340px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.sd-template-dropdown-search {
    padding: 10px;
    border-bottom: 1px solid var(--sd-border-light);
}
.sd-template-dropdown-search-wrap {
    position: relative;
}
.sd-template-dropdown-search-wrap i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sd-text-light);
    font-size: 12px;
}
.sd-template-dropdown-search-wrap input {
    width: 100%;
    padding: 6px 10px 6px 32px;
    border: 1px solid var(--sd-border-light);
    border-radius: var(--sd-radius);
    font-size: var(--sd-fs-sm);
    outline: none;
}
.sd-template-dropdown-search-wrap input:focus { border-color: var(--sd-primary); }

.sd-template-list { overflow-y: auto; max-height: 270px; }
.sd-template-group-header {
    padding: 8px 14px;
    font-size: var(--sd-fs-xs);
    font-weight: 700;
    color: var(--sd-text-secondary);
    background: var(--sd-bg-light);
    text-transform: uppercase;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--sd-border-light);
}
.sd-template-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 28px;
    cursor: pointer;
    font-size: var(--sd-fs-sm);
    color: var(--sd-text-body);
    transition: background .1s;
    border-bottom: 1px solid var(--sd-border-light);
}
.sd-template-option:last-child { border-bottom: none; }
.sd-template-option:hover { background: rgba(var(--sd-primary-rgb), .05); }
.sd-template-option i { color: var(--sd-text-muted); font-size: 13px; }
.sd-template-option-text { flex: 1; }
.sd-template-option-text strong { display: block; font-weight: 500; }
.sd-template-option-text span { font-size: var(--sd-fs-xs); color: var(--sd-text-light); }

.sd-template-selected-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(var(--sd-primary-rgb), .06);
    border: 1px solid rgba(var(--sd-primary-rgb), .15);
    border-radius: var(--sd-radius);
    margin-top: 10px;
    font-size: var(--sd-fs-sm);
    color: var(--sd-primary);
}
.sd-template-selected-strip i.fa-check-circle { color: var(--sd-success); margin-right: 5px; }
.sd-template-selected-strip-clear {
    background: none;
    border: none;
    color: var(--sd-text-light);
    cursor: pointer;
    font-size: 13px;
    padding: 2px;
}
.sd-template-selected-strip-clear:hover { color: var(--sd-danger); }

/* ─── Requester Autocomplete ─── */
.sd-autocomplete-wrap { position: relative; }
.sd-autocomplete-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sd-text-light);
    font-size: 13px;
    pointer-events: none;
}
.sd-autocomplete-input { padding-left: 32px !important; }

.sd-autocomplete-list {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: var(--sd-bg-white);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius);
    box-shadow: var(--sd-shadow-dropdown);
    max-height: 220px;
    overflow-y: auto;
    z-index: 90;
}
.sd-autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--sd-border-light);
    font-size: var(--sd-fs-sm);
    transition: background .1s;
}
.sd-autocomplete-item:last-child { border-bottom: none; }
.sd-autocomplete-item:hover { background: rgba(var(--sd-primary-rgb), .05); }
.sd-autocomplete-item-main { display: flex; align-items: center; justify-content: space-between; }
.sd-autocomplete-item-name { font-weight: 500; color: var(--sd-text-dark); }
.sd-autocomplete-item-meta { font-size: var(--sd-fs-xs); color: var(--sd-text-muted); }

/* ─── Dropzone (File Upload) ─── */
.sd-dropzone {
    border: 2px dashed var(--sd-border);
    border-radius: var(--sd-radius-lg);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    color: var(--sd-text-muted);
}
.sd-dropzone:hover { border-color: var(--sd-primary); background: rgba(var(--sd-primary-rgb), .02); }
.sd-dropzone.sd-dragover { border-color: var(--sd-primary); background: rgba(var(--sd-primary-rgb), .05); }
.sd-dropzone i { font-size: 28px; color: var(--sd-text-light); margin-bottom: 8px; display: block; }
.sd-dropzone p { margin: 4px 0; font-size: var(--sd-fs-sm); }
.sd-dropzone-sub { font-size: var(--sd-fs-xs); color: var(--sd-text-light); }

/* ─── File List ─── */
.sd-file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--sd-fs-sm);
    font-weight: 600;
    margin-bottom: 8px;
}
.sd-file-list-header button {
    background: none;
    border: none;
    color: var(--sd-danger);
    font-size: var(--sd-fs-xs);
    cursor: pointer;
}
.sd-file-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border: 1px solid var(--sd-border-light);
    border-radius: var(--sd-radius);
    margin-bottom: 4px;
    font-size: var(--sd-fs-sm);
}
.sd-file-list-item i.sd-file-icon { color: var(--sd-text-light); font-size: 16px; width: 20px; text-align: center; }
.sd-file-list-item-info { flex: 1; min-width: 0; }
.sd-file-list-item-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-file-list-item-size { font-size: var(--sd-fs-xs); color: var(--sd-text-light); }
.sd-file-remove {
    background: none;
    border: none;
    color: var(--sd-text-light);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
}
.sd-file-remove:hover { color: var(--sd-danger); }

/* ─── Summary Panel ─── */
.sd-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--sd-border-light);
    font-size: var(--sd-fs-sm);
}
.sd-summary-row:last-child { border-bottom: none; }
.sd-summary-row-label { color: var(--sd-text-muted); font-weight: 500; }
.sd-summary-row-value { color: var(--sd-text-light); font-weight: 500; text-align: right; }
.sd-summary-row-value.sd-filled { color: var(--sd-text-dark); font-weight: 600; }


/* ================================================================
   7. BADGES & UTILITIES
   ================================================================ */

/* ─── Info Box ─── */
.sd-info-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: var(--sd-radius);
    font-size: var(--sd-fs-xs);
    color: #0c5460;
}
.sd-info-box i { margin-top: 2px; flex-shrink: 0; }
.sd-info-box p { margin: 0; line-height: 1.5; }
.sd-info-box a { color: var(--sd-primary); font-weight: 500; }

/* ─── Tips Box ─── */
.sd-tips-box {
    background: #f0f7ff;
    border: 1px solid #c5ddf5;
    border-radius: var(--sd-radius-lg);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.sd-tips-box h4 {
    font-size: var(--sd-fs-sm);
    font-weight: 600;
    color: var(--sd-text-dark);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sd-tips-box h4 i { color: var(--sd-warning); }
.sd-tips-list { list-style: none; padding: 0; margin: 0; }
.sd-tips-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: var(--sd-fs-xs);
    color: var(--sd-text-secondary);
    margin-bottom: 6px;
}
.sd-tips-list li:last-child { margin-bottom: 0; }
.sd-tips-list li i { color: var(--sd-info); font-size: 10px; margin-top: 3px; flex-shrink: 0; }

/* ─── Validation Errors ─── */
.sd-validation-errors ul { margin: 0; padding-left: 18px; }
.sd-validation-errors li { font-size: var(--sd-fs-sm); margin-bottom: 2px; }

/* ─── Requester Card (Sidebar) ─── */
.sd-requester-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.sd-requester-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--sd-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}
.sd-requester-card-info { flex: 1; min-width: 0; }
.sd-requester-card-name {
    font-weight: 600;
    font-size: var(--sd-fs-base);
    color: var(--sd-text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}
.sd-requester-card-email {
    font-size: var(--sd-fs-sm);
    color: var(--sd-text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sd-requester-card-email a { color: var(--sd-primary); }
.sd-requester-card-company {
    font-size: var(--sd-fs-sm);
    color: var(--sd-text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sd-requester-card-phone {
    font-size: var(--sd-fs-sm);
    color: var(--sd-text-muted);
    margin-top: 2px;
}


/* ================================================================
   8. RESPONSIVE OVERRIDES
   ================================================================ */

/* Tablet and below (< 992px): stack two-column layouts */
@media (max-width: 991.98px) {
    .sd-ticket-header-title { flex-wrap: wrap; }
    .sd-ticket-requester-bar { flex-wrap: wrap; }
    .sd-tab-link { padding: 8px 12px; font-size: var(--sd-fs-xs); }
}

/* Small tablets and large phones (< 768px) */
@media (max-width: 767.98px) {
    .sd-nav-inner { padding: 0 12px; }
    .sd-page-header { flex-direction: column; gap: 8px; }
    .sd-page-title { font-size: 17px; }
    .sd-filters-bar { flex-direction: column; align-items: stretch; }
    .sd-filter-input-wrapper { min-width: 100%; }
    .sd-table thead th, .sd-table tbody td { padding: 6px 8px; font-size: var(--sd-fs-xs); }
    .sd-ticket-number { font-size: 16px; }
}

/* Mobile (< 576px) */
@media (max-width: 575.98px) {
    .sd-stat-card { padding: 10px 12px; }
    .sd-stat-value { font-size: 18px; }
    .sd-stat-icon { width: 36px; height: 36px; font-size: 15px; }
    /* Hide less important table columns on mobile */
    .sd-col-category, .sd-col-agent { display: none; }
    .sd-ticket-header-title { gap: 6px; }
    .sd-panel-body { padding: 12px; }
    .sd-panel-header { padding: 8px 12px; font-size: var(--sd-fs-sm); }
}

/* ================================================================
   9. REQUEST INDEX PAGE (Toolbar-Only Layout)
   ================================================================ */

/* Page Container */
.sd-page-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Toolbar Button States */
.sd-toolbar-btn.sd-btn-primary {
    background: var(--sd-primary);
    color: #fff;
    border-color: var(--sd-primary);
}

.sd-toolbar-btn.sd-btn-primary:hover {
    filter: brightness(0.9);
    color: #fff;
}

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

.sd-toolbar-btn.sd-btn-active:hover {
    filter: brightness(0.9);
}

/* Search Row */
.sd-search-row {
    background: #f8f9fa;
    border-bottom: 2px solid var(--sd-primary);
}

.sd-search-row th {
    padding: 8px;
    vertical-align: middle;
}

.sd-search-row .sd-search-input {
    width: 100%;
    font-size: var(--sd-fs-xs);
    border: 1px solid #dee2e6;
    background: #fff;
}

.sd-search-row .sd-search-input:focus {
    border-color: var(--sd-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--sd-primary-rgb), 0.15);
}

/* Dropdown Menu Enhancements */
.dropdown-menu .dropdown-item.active {
    background: var(--sd-primary);
    color: #fff;
}

.dropdown-menu .dropdown-item .badge {
    font-size: 10px;
    padding: 2px 6px;
}

.dropdown-menu .dropdown-item i {
    width: 18px;
    text-align: center;
    margin-right: 6px;
}

/* Responsive Adjustments for Toolbar */
@media (max-width: 991.98px) {
    .sd-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .sd-toolbar-left,
    .sd-toolbar-right {
        flex-wrap: wrap;
    }
    
    .sd-toolbar-btn span {
        display: none;
    }
    
    .sd-toolbar-btn {
        padding: 6px 12px;
    }
}

@media (max-width: 767.98px) {
    .sd-search-row {
        display: none !important; /* Hide search row on mobile, use simple search instead */
    }
}

/* Additional Column Widths for All Ticket Columns */
.sd-col-subcategory { width: 150px; }
.sd-col-item { width: 140px; }
.sd-col-department { width: 140px; }
.sd-col-mode { width: 100px; }
.sd-col-impact { width: 100px; }
.sd-col-urgency { width: 100px; }
.sd-col-updated { width: 130px; }
.sd-col-due_date { width: 120px; }
.sd-col-resolved_at { width: 140px; }
