/* =========================================================
   تذكرتي (Tazkarati Enterprise) - Modern Official Corporate Design System
   With Calm & Deep Tone Analytical Indicators (ألوان مؤشرات هادئة وغامقة)
   ========================================================= */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Tajawal:wght@300;400;500;600;700;800;900&display=swap');

/* --- CSS Variables: Official Executive Palette with Deep Calm Indicators --- */
:root {
    /* Brand Colors - Deep Royal Navy & Sapphire */
    --primary-dark: #0A1E3F;        /* Deep Official Navy */
    --primary: #0F2C59;             /* Imperial Navy */
    --primary-light: #1E3A8A;       /* Deep Sapphire */
    --primary-accent: #1D4ED8;      /* Calm Deep Corporate Blue */
    --primary-hover: #1E40AF;       /* Deep Royal Blue Hover */
    --primary-subtle: #EFF6FF;      /* Subtle Ice Blue Tint */
    --primary-glow: rgba(29, 78, 216, 0.12);

    /* Clean Corporate Light Backgrounds */
    --bg-app: #F8FAFC;              /* Clean Slate-50 Background */
    --bg-app-gradient: linear-gradient(180deg, #F0F4F8 0%, #F8FAFC 100%);
    --bg-card: #FFFFFF;             /* Crisp Pure White */
    --bg-card-hover: #FAFCFF;
    --bg-surface-subtle: #F8FAFC;   /* Slate-50 */
    --bg-surface-alt: #F1F5F9;      /* Slate-100 */

    /* Border & Separator Colors */
    --border-color: #E2E8F0;        /* Slate-200 */
    --border-color-light: #F1F5F9;  /* Slate-100 */
    --border-color-hover: #CBD5E1;  /* Slate-300 */
    --border-focus: #1D4ED8;

    /* Typography / Text Palette */
    --text-main: #0F172A;           /* Slate-900 (High contrast dark) */
    --text-heading: #0A1E3F;        /* Official Dark Navy */
    --text-sub: #475569;            /* Slate-600 */
    --text-muted: #94A3B8;          /* Slate-400 */

    /* =========================================================
       Calm, Deep & Dark Indicator Colors (ألوان مؤشرات هادئة وغامقة)
       ========================================================= */

    /* 1. Deep Burgundy / Brick Red (أحمر مستعجل هادئ وغامق) */
    --red: #991B1B;                 /* Deep Crimson / Burgundy */
    --red-hover: #7F1D1D;
    --red-light: #FEF2F2;
    --red-border: #FECACA;
    --red-glow: rgba(153, 27, 27, 0.12);

    /* 2. Deep Burnt Amber / Ochre (عنبري قيد المعالجة هادئ وغامق) */
    --orange: #B45309;              /* Deep Warm Ochre / Amber */
    --orange-hover: #92400E;
    --orange-light: #FFFBEB;
    --orange-border: #FDE68A;
    --orange-glow: rgba(180, 83, 9, 0.12);

    /* 3. Deep Forest / Emerald Green (أخضر زمردي هادئ وغامق) */
    --green: #065F46;               /* Deep Pine / Forest Emerald */
    --green-hover: #064E3B;
    --green-light: #ECFDF5;
    --green-border: #A7F3D0;
    --green-glow: rgba(6, 95, 70, 0.12);

    /* 4. Deep Indigo / Royal Purple (بنفسجي نيلي هادئ وغامق) */
    --purple: #3730A3;              /* Deep Royal Indigo */
    --purple-hover: #312E81;
    --purple-light: #EEF2FF;
    --purple-border: #C7D2FE;
    --purple-glow: rgba(55, 48, 163, 0.12);

    /* 5. Deep Sapphire / Corporate Blue (أزرق ملكي هادئ وغامق) */
    --blue: #1E40AF;                /* Deep Sapphire Blue */
    --blue-light: #EFF6FF;
    --blue-border: #BFDBFE;

    /* Luxury Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

    /* Border Radii */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= Reset & Global Defaults ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    direction: rtl;
    text-align: right;
    background: var(--bg-app-gradient);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Polished Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Main Container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* ================= Official Top Bar ================= */
.official-topbar {
    background: #0A1E3F;
    color: #F8FAFC;
    padding: 6px 0;
    font-size: 11.5px;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.official-topbar-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
}

.official-emblem-icon {
    display: flex;
    align-items: center;
    color: #60A5FA;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #94A3B8;
}

.system-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(6, 95, 70, 0.3);
    color: #34D399;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.status-pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #34D399;
    border-radius: 50%;
    box-shadow: 0 0 6px #34D399;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ================= App Header ================= */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    padding: 12px 0;
    transition: all var(--transition-normal);
}

.header-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* Logo & Title */
.app-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    cursor: default;
}

.app-logo-image-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #0A1E3F 0%, #1E3A8A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(10, 30, 63, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform var(--transition-normal);
}

.app-logo-image-wrapper:hover {
    transform: translateY(-1px);
}

.app-logo-image-wrapper img {
    max-width: 40px;
    max-height: 40px;
    border-radius: calc(var(--radius-md) - 2px);
    object-fit: contain;
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-badge-official {
    font-size: 10px;
    font-weight: 700;
    background: #EFF6FF;
    color: #1E40AF;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #BFDBFE;
}

.logo-text p {
    font-size: 11.5px;
    color: var(--text-sub);
    font-weight: 500;
    margin-top: 1px;
}

/* ================= Header Navigation & Portal Menu Dropdown ================= */
.header-nav-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-menu-container {
    position: relative;
    user-select: none;
}

.portal-menu-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: all var(--transition-fast);
}

.portal-menu-trigger-btn:hover {
    border-color: var(--primary-accent);
    background: #F8FAFC;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.portal-menu-container.is-open .portal-menu-trigger-btn {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: #F0F7FF;
    color: var(--primary-accent);
}

.portal-menu-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-accent);
}

.active-portal-title {
    font-weight: 700;
    color: var(--text-main);
}

.portal-menu-container.is-open .active-portal-title {
    color: var(--primary-accent);
}

.portal-menu-chevron {
    color: #64748B;
    transition: transform 0.2s ease, color 0.2s ease;
    margin-inline-start: 4px;
}

.portal-menu-container.is-open .portal-menu-chevron {
    transform: rotate(180deg);
    color: var(--primary-accent);
}

/* Dropdown Overlay */
.portal-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    min-width: 290px;
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.16), 0 6px 14px -2px rgba(15, 23, 42, 0.08);
    z-index: 1060;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: customDropdownFade 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[dir="rtl"] .portal-menu-dropdown {
    right: 0;
    left: auto;
}

[dir="ltr"] .portal-menu-dropdown {
    left: 0;
    right: auto;
}

.portal-menu-container.is-open .portal-menu-dropdown {
    display: flex;
}

.portal-menu-header {
    padding: 10px 16px;
    font-size: 11.5px;
    font-weight: 800;
    color: #64748B;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.2px;
}

.portal-menu-list {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.portal-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    text-align: start;
    transition: all var(--transition-fast);
}

.portal-menu-item:hover {
    background: #F1F5F9;
    border-color: #E2E8F0;
}

.portal-menu-item.active {
    background: #EFF6FF;
    border-color: #BFDBFE;
}

.portal-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-item-icon.blue { background: #DBEAFE; color: #1E40AF; }
.portal-item-icon.orange { background: #FEF3C7; color: #D97706; }
.portal-item-icon.purple { background: #EDE9FE; color: #6D28D9; }
.portal-item-icon.green { background: #D1FAE5; color: #047857; }

.portal-item-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.portal-item-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
}

.portal-menu-item.active .portal-item-title {
    color: var(--primary-accent);
}

.portal-item-sub {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 1px;
}

.portal-item-check {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-accent);
    width: 16px;
    text-align: center;
}

/* ================= Main Content Area ================= */
.app-main {
    flex: 1;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 24px 64px;
}

/* ================= Cards & Containers ================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
    position: relative;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color-hover);
}

.card.glass {
    background: #FFFFFF;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color-light);
}

.header-titles h2 {
    font-size: 17.5px;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.3px;
}

.header-titles p {
    font-size: 12.5px;
    color: var(--text-sub);
    margin-top: 3px;
    font-weight: 400;
}

/* Icon Circles */
.icon-circle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.icon-circle.primary {
    background-color: var(--primary-subtle);
    color: var(--primary-accent);
    border-color: var(--blue-border);
}

.icon-circle.info {
    background-color: #EFF6FF;
    color: var(--blue);
    border-color: #BFDBFE;
}

.icon-circle.warning {
    background-color: var(--orange-light);
    color: var(--orange);
    border-color: var(--orange-border);
}

.icon-circle.success {
    background-color: var(--green-light);
    color: var(--green);
    border-color: var(--green-border);
}

.icon-circle.large {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
}

/* ================= Form Controls ================= */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.required {
    color: var(--red);
    font-weight: 800;
    margin-right: 2px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 11px 16px;
    font-size: 13.5px;
    font-family: inherit;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    outline: none;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    font-size: 13px;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-color-hover);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--border-focus);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* Native Select Dropdowns */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 38px;
    cursor: pointer;
    background-color: #FFFFFF;
}

select:required:invalid {
    color: var(--text-muted);
}

select option {
    color: var(--text-main);
    background-color: #FFFFFF;
    padding: 8px 12px;
}

select option[disabled] {
    color: var(--text-muted);
}

optgroup {
    font-weight: 700;
    color: var(--primary-accent);
    background-color: #F1F5F9;
    padding: 6px 4px;
    font-size: 13.5px;
}

optgroup option {
    font-weight: 500;
    color: var(--text-main);
    background-color: #FFFFFF;
    padding: 8px 12px;
    font-size: 13px;
}

/* ================= Modern Custom Downward Select Engine ================= */
.custom-select-container {
    position: relative;
    width: 100%;
    user-select: none;
}

.custom-select-native-hidden {
    position: absolute !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    pointer-events: none !important;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text-main);
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: start;
    transition: all var(--transition-fast);
    box-sizing: border-box;
    box-shadow: var(--shadow-xs);
}

.custom-select-trigger:hover {
    border-color: var(--border-color-hover);
    background: #F8FAFC;
}

.custom-select-container.is-open .custom-select-trigger {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: #FFFFFF;
}

.custom-select-trigger-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: start;
}

.custom-select-trigger-text.placeholder {
    color: var(--text-muted);
}

.custom-select-trigger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    transition: transform 0.2s ease, color 0.2s ease;
    margin-inline-start: 10px;
    flex-shrink: 0;
}

.custom-select-container.is-open .custom-select-trigger-icon {
    transform: rotate(180deg);
    color: var(--primary-accent);
}

/* Dropdown overlay: ALWAYS opens downwards with smooth animation */
.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 14px 30px -4px rgba(15, 23, 42, 0.15), 0 6px 12px -2px rgba(15, 23, 42, 0.08);
    max-height: 290px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: customDropdownFade 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.custom-select-container.is-open .custom-select-dropdown {
    display: flex;
}

.custom-select-search-wrap {
    padding: 8px 10px;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 2;
}

.custom-select-search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-main);
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    box-sizing: border-box;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.custom-select-search-input:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.custom-select-options-list {
    max-height: 235px;
    overflow-y: auto;
    padding: 4px 0;
    overscroll-behavior: contain;
}

.custom-select-options-list::-webkit-scrollbar {
    width: 6px;
}
.custom-select-options-list::-webkit-scrollbar-track {
    background: #F8FAFC;
}
.custom-select-options-list::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
.custom-select-options-list::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.custom-select-group-header {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-accent);
    background: #F1F5F9;
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
    margin-top: 4px;
    user-select: none;
    letter-spacing: -0.2px;
}

.custom-select-group-header:first-child {
    margin-top: 0;
    border-top: none;
}

.custom-select-option {
    padding: 9px 14px;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--transition-fast), color var(--transition-fast);
    user-select: none;
    line-height: 1.4;
}

.custom-select-option:hover,
.custom-select-option.is-focused {
    background: #F1F5F9;
    color: var(--primary-dark);
}

.custom-select-option.is-selected {
    background: #EFF6FF;
    color: var(--primary-accent);
    font-weight: 700;
}

.custom-select-option.is-selected .option-check {
    color: var(--primary-accent);
    font-weight: 800;
}

.custom-select-empty-hint {
    padding: 16px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ================= Priority Selector (Formal 3-Card Group) ================= */
.priority-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.priority-option {
    position: relative;
    cursor: pointer;
}

.priority-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.priority-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.priority-card:hover {
    border-color: var(--border-color-hover);
    background: #F8FAFC;
    transform: translateY(-1px);
}

.priority-option input:checked + .priority-card {
    border-color: var(--primary-accent);
    background: #F0F7FF;
    box-shadow: 0 0 0 1px var(--primary-accent), 0 4px 10px rgba(29, 78, 216, 0.12);
}

.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-dot.urgent { background-color: var(--red); box-shadow: 0 0 6px rgba(153, 27, 27, 0.4); }
.priority-dot.medium { background-color: var(--orange); box-shadow: 0 0 6px rgba(180, 83, 9, 0.4); }
.priority-dot.normal { background-color: var(--blue); box-shadow: 0 0 6px rgba(30, 64, 175, 0.4); }

.priority-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.priority-desc {
    font-size: 10.5px;
    color: var(--text-sub);
    margin-top: 3px;
    line-height: 1.3;
}

/* ================= File Upload Zone ================= */
.file-upload-zone {
    border: 2px dashed #CBD5E1;
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    background: #F8FAFC;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
    border-color: var(--primary-accent);
    background: #EFF6FF;
}

.upload-icon {
    color: var(--primary-accent);
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
}

.upload-prompt p {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
}

.browse-link {
    color: var(--primary-accent);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
}

.file-limits {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Attachment preview items */
.attachment-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.attachment-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    box-shadow: var(--shadow-xs);
}

.attachment-preview-item .remove-file {
    color: var(--red);
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
}

.attachment-preview-item .remove-file:hover {
    color: var(--red-hover);
}

/* ================= Buttons ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    gap: 8px;
    transition: all var(--transition-normal);
    user-select: none;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, #0F2C59 0%, #1E3A8A 100%);
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(15, 44, 89, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0A1E3F 0%, #1D4ED8 100%);
    box-shadow: 0 4px 12px rgba(15, 44, 89, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #F1F5F9;
    color: var(--text-main);
    border-color: var(--border-color);
}

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

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--red-border);
    color: var(--red);
    background-color: var(--red-light);
}

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

.btn-small {
    padding: 6px 14px;
    font-size: 12.5px;
    border-radius: var(--radius-xs);
}

.full-width {
    width: 100%;
}

/* ================= Layout Grids ================= */
.grid-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 28px;
}

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

/* ================= Search & Tracker ================= */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex-grow: 1;
}

.tracker-results {
    min-height: 250px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-sub);
    gap: 12px;
}

.empty-state p {
    font-size: 13.5px;
    max-width: 340px;
    line-height: 1.6;
}

/* ================= Portal Sections Visibility ================= */
.portal-section {
    display: none;
}

.portal-section.active {
    display: block;
    animation: fadeIn var(--transition-normal);
}

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

.hidden {
    display: none !important;
}

/* ================= Badges (Official Formal Badges with Deep Colors) ================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.badge.priority-urgent { background-color: var(--red-light); color: var(--red); border-color: var(--red-border); }
.badge.priority-high { background-color: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.badge.priority-medium { background-color: var(--orange-light); color: var(--orange); border-color: var(--orange-border); }
.badge.priority-low { background-color: #F1F5F9; color: #475569; border-color: #CBD5E1; }
.badge.priority-normal { background-color: var(--blue-light); color: var(--blue); border-color: var(--blue-border); }

.badge.status-new { background-color: #EFF6FF; color: var(--blue); border-color: #BFDBFE; }
.badge.status-assigned { background-color: #EEF2FF; color: #4338CA; border-color: #C7D2FE; }
.badge.status-in_progress { background-color: var(--orange-light); color: var(--orange); border-color: var(--orange-border); }
.badge.status-pending { background-color: #FEF9C3; color: #854D0E; border-color: #FEF08A; }
.badge.status-solved, .badge.status-resolved { background-color: var(--purple-light); color: var(--purple); border-color: var(--purple-border); }
.badge.status-closed { background-color: var(--green-light); color: var(--green); border-color: var(--green-border); }

/* ================= Tracker Ticket Card Item ================= */
.tracker-card-item {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 14px;
    transition: all var(--transition-normal);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
}

.tracker-card-item:hover {
    border-color: var(--primary-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tracker-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ticket-id {
    font-weight: 800;
    font-size: 13px;
    color: var(--blue);
    background: #EFF6FF;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #BFDBFE;
}

.tracker-card-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.tracker-card-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-sub);
    flex-wrap: wrap;
}

/* ================= Login Wrapper Views ================= */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.login-card {
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    background: #FFFFFF;
}

.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.login-header h2 {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-heading);
    margin-top: 14px;
}

.login-header p {
    font-size: 13px;
    color: var(--text-sub);
    margin-top: 4px;
}

/* ================= Dashboard Elements ================= */
.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 24px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.tech-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #0A1E3F 0%, #1E3A8A 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 17px;
    box-shadow: 0 4px 10px rgba(10, 30, 63, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tech-profile h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.tech-profile p {
    font-size: 12px;
    color: var(--text-sub);
}

/* Dashboard Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) 1.2fr;
    gap: 18px;
    margin-bottom: 24px;
}

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

@media (max-width: 1200px) {
    .stats-grid,
    .stats-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-grid .full-width-sm {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .stats-grid,
    .stats-grid.cols-4 {
        grid-template-columns: 1fr;
    }
    .stats-grid .full-width-sm {
        grid-column: span 1;
    }
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: transparent;
    transition: background 0.3s ease;
}

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

.stat-card:hover::after {
    background: var(--primary-accent);
}

.stat-subtext {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

/* 4-Card Analytics Grid */
.analytics-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

@media (max-width: 992px) {
    .analytics-grid-2x2 {
        grid-template-columns: 1fr;
    }
}

/* SLA Quality Grid */
.sla-quality-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 14px;
}

@media (max-width: 992px) {
    .sla-quality-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    .sla-quality-grid {
        grid-template-columns: 1fr;
    }
}

.sla-metric-box {
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all var(--transition-fast);
}

.sla-metric-box:hover {
    background: #FFFFFF;
    border-color: var(--primary-accent);
    box-shadow: var(--shadow-sm);
}

.sla-metric-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sla-metric-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.5px;
}

.sla-metric-target {
    font-size: 11px;
    color: var(--text-muted);
}

.sla-compliance-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
    background: #ECFDF5;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #A7F3D0;
    width: fit-content;
    margin-top: 4px;
}

/* ================= Diverse Analytical Shapes Styles ================= */

/* --- Card 1: Status Mini Badges Grid --- */
.status-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.status-card-box {
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all var(--transition-fast);
}

.status-card-box:hover {
    background: #FFFFFF;
    box-shadow: var(--shadow-xs);
    transform: translateY(-1px);
}

.status-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
}

.status-card-count {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-heading);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.status-card-pct {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.status-card-box.blue { border-right: 3px solid var(--blue); }
.status-card-box.orange { border-right: 3px solid var(--orange); }
.status-card-box.purple { border-right: 3px solid var(--purple); }
.status-card-box.green { border-right: 3px solid var(--green); }

/* --- Card 2: Priority Breakdown (Modern Workload Matrix) --- */
.priority-matrix-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    gap: 12px;
}

/* Unified Segmented Distribution Bar */
.priority-segmented-track {
    width: 100%;
    height: 10px;
    background: #E2E8F0;
    border-radius: var(--radius-full);
    display: flex;
    overflow: hidden;
    margin-bottom: 2px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.priority-segment {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.priority-segment.seg-urgent { background-color: var(--red); }
.priority-segment.seg-medium { background-color: var(--orange); }
.priority-segment.seg-normal { background-color: var(--blue); }

/* Tier Rows List */
.priority-tier-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.priority-tier-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    gap: 16px;
}

.priority-tier-item:hover {
    background: #FFFFFF;
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-xs);
    transform: translateX(-2px);
}

.tier-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tier-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tier-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tier-indicator-dot.urgent { background-color: var(--red); box-shadow: 0 0 6px rgba(153, 27, 27, 0.4); }
.tier-indicator-dot.medium { background-color: var(--orange); box-shadow: 0 0 6px rgba(180, 83, 9, 0.4); }
.tier-indicator-dot.normal { background-color: var(--blue); box-shadow: 0 0 6px rgba(30, 64, 175, 0.4); }

.tier-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-heading);
}

.tier-sla-hint {
    font-size: 10.5px;
    color: var(--text-muted);
    background: #EEF2F6;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.tier-bar-track {
    width: 100%;
    height: 6px;
    background-color: #E2E8F0;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.tier-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.tier-bar-fill.urgent { background-color: var(--red); }
.tier-bar-fill.medium { background-color: var(--orange); }
.tier-bar-fill.normal { background-color: var(--blue); }

.tier-stats-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 45px;
}

.tier-count-val {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.1;
}

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

.tier-pct-val {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.urgency-risk-meter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color-light);
    font-size: 11.5px;
}

/* --- Card 3: Department Leadership Ranking --- */
.dept-ranking-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dept-rank-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.dept-rank-card:hover {
    background: #FFFFFF;
    border-color: var(--primary-accent);
    box-shadow: var(--shadow-xs);
}

.dept-rank-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dept-rank-medal {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}

.dept-rank-medal.gold { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.dept-rank-medal.silver { background: #F1F5F9; color: #334155; border: 1px solid #CBD5E1; }
.dept-rank-medal.bronze { background: #FFEDD5; color: #9A3412; border: 1px solid #FED7AA; }
.dept-rank-medal.slate { background: #F8FAFC; color: #64748B; border: 1px solid #E2E8F0; }

.dept-name-text {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-heading);
}

.dept-stats-pill {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dept-count-badge {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--blue);
    background: #EFF6FF;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid #BFDBFE;
}

.dept-pct-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

/* --- Card 4: Dual Circular Radial Dials for Meeting Rooms --- */
.room-dials-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.room-dials-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 6px 0;
}

.radial-dial-card {
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.radial-dial-card:hover {
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.radial-svg-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radial-svg {
    transform: rotate(-90deg);
    width: 80px;
    height: 80px;
}

.radial-circle-bg {
    fill: none;
    stroke: #E2E8F0;
    stroke-width: 6;
}

.radial-circle-progress {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.radial-circle-progress.blue { stroke: var(--blue); }
.radial-circle-progress.green { stroke: var(--green); }

.radial-center-val {
    position: absolute;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-heading);
}

.radial-room-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.radial-room-hours {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.room-footer-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color-light);
    font-size: 11.5px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.stat-icon.info { background-color: #EFF6FF; color: var(--blue); border-color: #BFDBFE; }
.stat-icon.new { background-color: #EFF6FF; color: var(--blue); border-color: #BFDBFE; }
.stat-icon.warning { background-color: var(--orange-light); color: var(--orange); border-color: var(--orange-border); }
.stat-icon.success { background-color: var(--green-light); color: var(--green); border-color: var(--green-border); }
.stat-icon.duration { background-color: var(--purple-light); color: var(--purple); border-color: var(--purple-border); }
.stat-icon.primary { background-color: var(--primary-subtle); color: var(--primary-accent); border-color: var(--blue-border); }

.stat-info h3 {
    font-size: 12.5px;
    color: var(--text-sub);
    font-weight: 700;
}

.stat-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-heading);
    display: block;
    margin-top: 2px;
    letter-spacing: -0.5px;
}

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

.font-medium {
    font-size: 17px;
    font-weight: 700;
}

/* ================= Tables Section ================= */
.dashboard-table-card {
    padding: 0;
    overflow: hidden;
    background: #FFFFFF;
}

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

.table-card-header h2 {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-heading);
}

/* Filter Tabs */
.table-filters {
    display: flex;
    background: #F1F5F9;
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 3px;
    border: 1px solid var(--border-color);
}

.filter-tab {
    border: none;
    background: transparent;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-sub);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-family: inherit;
}

.filter-tab:hover {
    color: var(--primary-dark);
}

.filter-tab.active {
    background: #FFFFFF;
    color: var(--primary-accent);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Table Styling */
.table-container {
    overflow-x: auto;
    width: 100%;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 13.5px;
}

.dashboard-table th {
    padding: 14px 20px;
    font-weight: 700;
    color: var(--text-sub);
    background-color: #F8FAFC;
    border-bottom: 1px solid var(--border-color);
    font-size: 12.5px;
    white-space: nowrap;
}

.dashboard-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-main);
    vertical-align: middle;
}

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

.dashboard-table tbody tr {
    transition: background-color var(--transition-fast);
}

.dashboard-table tbody tr:hover {
    background-color: #F8FAFC;
}

/* ================= Global Modal Overlay ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(10, 30, 63, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    width: 100%;
    max-width: 800px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    position: relative;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    transform: scale(0.96);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 18px;
    left: 18px;
    background: #F1F5F9;
    border: 1px solid var(--border-color);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: all var(--transition-fast);
    font-size: 20px;
    line-height: 1;
}

.modal-close-btn:hover {
    background: #E2E8F0;
    color: var(--text-main);
}

.modal-body {
    padding: 32px;
}

/* Modal Content Details Layout */
.modal-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 18px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 14px;
}

.modal-ticket-id {
    font-size: 13px;
    color: var(--blue);
    font-weight: 700;
}

.modal-ticket-header h2 {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-heading);
    margin-top: 4px;
}

.modal-badge-group {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

/* Details Grid inside Modal */
.modal-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 11px;
    color: var(--text-sub);
    font-weight: 700;
}

.detail-item span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

/* Description Body */
.modal-description-box {
    margin-bottom: 24px;
}

.modal-description-box h3 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.description-text {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-wrap;
}

/* Attachments Preview */
.modal-attachments-box {
    margin-bottom: 24px;
}

.modal-attachments-box h3 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.attachments-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.attachment-preview-item {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.attachment-preview-item:hover {
    border-color: var(--primary-accent);
    box-shadow: var(--shadow-sm);
}

.attachment-preview-item img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 4px;
}

.attachment-preview-item .attach-icon {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    background-color: #EFF6FF;
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-preview-item .attach-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.attachment-preview-item .attach-name {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-preview-item .attach-size {
    font-size: 10px;
    color: var(--text-muted);
}

/* History Logs Timeline */
.modal-timeline-box {
    margin-bottom: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.modal-timeline-box h3 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 14px;
}

.timeline {
    position: relative;
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 5px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
}

.timeline-dot {
    position: absolute;
    right: -20px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 0 2px var(--border-color);
}

.timeline-item.active .timeline-dot {
    background: var(--blue);
    box-shadow: 0 0 0 2px #BFDBFE;
}

.timeline-item.success .timeline-dot {
    background: var(--green);
    box-shadow: 0 0 0 2px #A7F3D0;
}

.timeline-content {
    background: #F8FAFC;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-sub);
    margin-bottom: 4px;
}

.timeline-msg {
    font-size: 12.5px;
    color: var(--text-main);
    font-weight: 500;
}

/* Technician Action Box */
.modal-action-box {
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 20px;
}

.modal-action-box h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 12px;
}

.action-buttons-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ================= Toast Notification Styles ================= */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: slideInLeft var(--transition-normal);
    min-width: 300px;
    max-width: 400px;
}

.toast.toast-primary .toast-icon { color: var(--blue); }
.toast.toast-success .toast-icon { color: var(--green); }
.toast.toast-warning .toast-icon { color: var(--orange); }

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.toast-message {
    font-size: 12px;
    color: var(--text-sub);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ================= Progress Bar Helpers ================= */
.progress-bar-bg {
    width: 100%;
    height: 7px;
    background-color: #E2E8F0;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 6px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.progress-bar-fill.info { background-color: var(--blue); }
.progress-bar-fill.warning { background-color: var(--orange); }
.progress-bar-fill.purple-bar { background-color: var(--purple); }
.progress-bar-fill.success { background-color: var(--green); }
.progress-bar-fill.urgent { background-color: var(--red); }

.visual-bar-group .bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 600;
}

.visual-bar-group .bar-labels .bold {
    color: var(--text-heading);
    font-weight: 800;
}

/* ================= Donut Chart Component ================= */
.donut-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.donut-chart {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: background 0.6s cubic-bezier(0.1, 0.8, 0.2, 1), transform 0.3s ease;
}

.donut-chart:hover {
    transform: scale(1.03);
}

.donut-hole {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color-light);
}

.donut-hole span {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.1;
}

.donut-hole .donut-label {
    font-size: 10px;
    color: var(--text-sub);
    font-weight: 600;
    margin-top: 2px;
}

/* Technician actions custom buttons */
.tech-actions {
    display: flex;
    gap: 8px;
}

.tech-actions .btn-edit-tech {
    color: var(--blue);
    border: 1px solid #BFDBFE;
    background-color: #EFF6FF;
}

.tech-actions .btn-edit-tech:hover {
    background-color: #DBEAFE;
    border-color: #93C5FD;
}

.tech-actions .btn-delete-tech {
    color: var(--red);
    border: 1px solid var(--red-border);
    background-color: var(--red-light);
}

.tech-actions .btn-delete-tech:hover {
    background-color: #FEE2E2;
    border-color: var(--red);
}

/* =========================================================
   TIMELINE SCHEDULE VISUAL GRID (Meeting Room Booking)
   ========================================================= */
.timeline-visual-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-visual-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    background: #FFFFFF;
}

.timeline-visual-item.available {
    background-color: #F0FDF4;
    border-color: #BBF7D0;
    cursor: pointer;
}

.timeline-visual-item.available:hover {
    background-color: #DCFCE7;
    border-color: #86EFAC;
    transform: translateX(-4px);
    box-shadow: var(--shadow-sm);
}

.timeline-visual-item.booked {
    background-color: #FEF2F2;
    border-color: #FECACA;
    cursor: not-allowed;
}

.slot-time {
    font-weight: 800;
    font-size: 13.5px;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 6px;
}

.slot-status-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.slot-status-tag.tag-avail {
    background-color: #DCFCE7;
    color: var(--green);
    border: 1px solid #86EFAC;
}

.slot-status-tag.tag-booked {
    background-color: #FEE2E2;
    color: var(--red);
    border: 1px solid #FCA5A5;
}

/* ================= Language Switcher Button ================= */
.header-nav-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.lang-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
    user-select: none;
}

.lang-toggle-btn:hover {
    border-color: var(--primary-accent);
    background: #EFF6FF;
    color: var(--primary-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.lang-toggle-btn svg {
    color: var(--primary-accent);
}

/* ================= LTR (English) System Adjustments ================= */
html[dir="ltr"] body {
    direction: ltr;
    text-align: left;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

html[dir="ltr"] * {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

html[dir="ltr"] select {
    background-position: right 14px center;
    padding-left: 16px;
    padding-right: 38px;
}

html[dir="ltr"] .dashboard-table th,
html[dir="ltr"] .dashboard-table td,
html[dir="ltr"] .table th,
html[dir="ltr"] .table td {
    text-align: left;
}

html[dir="ltr"] .timeline {
    border-right: none;
    border-left: 2px solid var(--border-color);
    padding-right: 0;
    padding-left: 24px;
}

html[dir="ltr"] .timeline::before {
    right: auto;
    left: 5px;
}

html[dir="ltr"] .timeline-dot {
    right: auto;
    left: -31px;
}

html[dir="ltr"] .modal-close-btn {
    left: auto;
    right: 20px;
}

html[dir="ltr"] .stat-card {
    text-align: left;
}

html[dir="ltr"] .btn svg {
    margin-left: 0;
    margin-right: 6px;
}

html[dir="ltr"] .modal-header .modal-close {
    margin-right: 0;
    margin-left: auto;
}

html[dir="ltr"] .urgency-risk-meter {
    justify-content: flex-start;
}

html[dir="ltr"] .dept-rank-info {
    gap: 12px;
}

/* ================= Responsive Adjustments ================= */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .header-nav-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .portal-menu-trigger-btn {
        padding: 7px 12px;
        font-size: 12.5px;
        gap: 6px;
    }

    .portal-menu-dropdown {
        min-width: 260px;
    }
    
    .card {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
}
