@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* HSL Theme Colors (Optimal Red Light Theme) */
    --bg-dark: 220 20% 97%;
    --bg-card: 0 0% 100%;
    --border-card: 220 15% 90%;
    --border-glow: 354 100% 38%;
    
    --primary: 354 100% 38%; /* Optimal Logo Red */
    --primary-hover: 354 100% 45%;
    --primary-light: 354 100% 95%;
    
    --secondary: 215 90% 50%; /* Deep Blue */
    --secondary-light: 215 90% 95%;
    
    --text-main: 220 20% 25%;
    --text-muted: 220 12% 55%;
    --text-bright: 220 20% 10%;
    
    /* Semantic Colors */
    --success: 142 70% 35%;
    --warning: 35 90% 45%;
    --danger: 350 80% 45%;
    --info: 210 90% 45%;
    
    /* Layout Dimensions */
    --sidebar-width: 280px;
    --header-height: 70px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: hsl(var(--text-main));
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: hsl(var(--bg-dark));
    background-image: 
        radial-gradient(at 0% 0%, hsla(263, 70%, 50%, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(190, 90%, 45%, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: hsla(var(--text-muted) / 0.2);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: hsla(var(--text-muted) / 0.4);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: hsl(var(--text-bright));
    letter-spacing: -0.02em;
}

/* Glassmorphism Styles */
.glass-panel {
    background: rgba(13, 17, 28, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-card {
    background: rgba(18, 24, 38, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.glass-card-interactive {
    cursor: pointer;
}
.glass-card-interactive:hover {
    border-color: hsla(var(--primary) / 0.3);
    box-shadow: 0 0 20px hsla(var(--primary) / 0.15);
}

/* Buttons */
.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.glass-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}
.glass-btn:active {
    transform: scale(0.97);
}

.glass-btn-primary {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(275 80% 55%));
    border: none;
    color: hsl(var(--text-bright));
}
.glass-btn-primary:hover {
    background: linear-gradient(135deg, hsl(var(--primary-hover)), hsl(275 80% 60%));
    box-shadow: 0 0 15px hsla(var(--primary) / 0.4);
}

.glass-btn-danger {
    background: linear-gradient(135deg, hsl(var(--danger)), hsl(350 80% 42%));
    border: none;
    color: hsl(var(--text-bright));
}
.glass-btn-danger:hover {
    box-shadow: 0 0 15px hsla(var(--danger) / 0.4);
}

.glass-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* Form Controls */
.glass-form-group {
    margin-bottom: 20px;
}
.glass-form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: hsl(var(--text-muted));
}
.glass-form-label span.required {
    color: hsl(var(--danger));
    margin-left: 3px;
}

.glass-input, .glass-textarea, .glass-select {
    width: 100%;
    background: rgba(10, 15, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: all 0.25s ease;
}
.glass-input:focus, .glass-textarea:focus, .glass-select:focus {
    border-color: hsla(var(--primary) / 0.6);
    box-shadow: 0 0 0 3px hsla(var(--primary) / 0.15);
    background: rgba(10, 15, 28, 0.8);
}
.glass-select option {
    background: hsl(var(--bg-card));
    color: hsl(var(--text-main));
}

.glass-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}
.glass-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    background: rgba(10, 15, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    outline: none;
    transition: all 0.2s;
}
.glass-checkbox:checked {
    background: hsl(var(--primary));
    border-color: hsl(var(--primary));
}
.glass-checkbox:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: white;
    font-weight: bold;
}

/* Badges */
.glass-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.priority-low {
    color: hsl(var(--info));
    background: hsla(var(--info) / 0.12);
    border-color: hsla(var(--info) / 0.2);
}
.priority-medium {
    color: hsl(var(--success));
    background: hsla(var(--success) / 0.12);
    border-color: hsla(var(--success) / 0.2);
}
.priority-high {
    color: hsl(var(--warning));
    background: hsla(var(--warning) / 0.12);
    border-color: hsla(var(--warning) / 0.2);
}
.priority-urgent {
    color: hsl(var(--danger));
    background: hsla(var(--danger) / 0.12);
    border-color: hsla(var(--danger) / 0.2);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { border-color: hsla(var(--danger) / 0.2); }
    50% { border-color: hsla(var(--danger) / 0.6); }
    100% { border-color: hsla(var(--danger) / 0.2); }
}

/* App Layout Grid */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    background: rgba(8, 11, 20, 0.6);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.sidebar-brand-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, hsl(var(--text-bright)) 30%, hsl(var(--primary)) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.sidebar-link svg {
    width: 20px;
    height: 20px;
    stroke: hsl(var(--text-muted));
    fill: none;
    transition: stroke 0.2s ease;
}
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.02);
}
.sidebar-link:hover svg {
    stroke: hsl(var(--text-main));
}
.sidebar-link.active {
    background: hsla(var(--primary) / 0.12);
    border-color: hsla(var(--primary) / 0.2);
    color: hsl(var(--text-bright));
}
.sidebar-link.active svg {
    stroke: hsl(var(--primary-hover));
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.current-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
}
.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--secondary)));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}
.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.user-name {
    font-size: 13px;
    font-weight: 600;
    color: hsl(var(--text-bright));
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.user-role-badge {
    font-size: 10px;
    color: hsl(var(--text-muted));
    font-weight: 500;
}

/* Content Area */
.app-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styling */
.app-header {
    height: var(--header-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(8, 11, 20, 0.4);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.header-title-section {
    display: flex;
    flex-direction: column;
}
.header-title {
    font-size: 20px;
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* User Switcher Dropdown */
.session-switcher {
    position: relative;
}
.switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: hsla(var(--primary) / 0.15);
    border: 1px solid hsla(var(--primary) / 0.3);
    color: hsl(var(--text-bright));
    padding: 8px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.switcher-btn:hover {
    background: hsla(var(--primary) / 0.25);
    border-color: hsla(var(--primary) / 0.50);
}
.switcher-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    width: 250px;
    background: hsl(var(--bg-card));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: none;
    z-index: 110;
}
.switcher-dropdown.show {
    display: block;
    animation: slide-down 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slide-down {
    0% { transform: translateY(-8px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.switcher-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}
.switcher-item:hover {
    background: rgba(255, 255, 255, 0.03);
}
.switcher-item.active {
    background: hsla(var(--primary) / 0.08);
}
.switcher-item-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--secondary)));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* Page Frame Content */
.page-container {
    padding: 32px;
    flex-grow: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* Dashboard Analytics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}
.metric-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.metric-title {
    font-size: 13px;
    font-weight: 500;
    color: hsl(var(--text-muted));
    margin-bottom: 4px;
}
.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: hsl(var(--text-bright));
}
.metric-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.metric-icon-wrapper svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: hsl(var(--text-muted));
}
.metric-card:hover .metric-icon-wrapper {
    background: hsla(var(--primary) / 0.1);
    border-color: hsla(var(--primary) / 0.2);
}
.metric-card:hover .metric-icon-wrapper svg {
    stroke: hsl(var(--primary-hover));
}

.dashboard-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}
@media (max-width: 1024px) {
    .dashboard-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* SVG Chart Styles */
.chart-container {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chart-bar-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}
.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.chart-bar-label {
    width: 140px;
    font-size: 13px;
    font-weight: 500;
    color: hsl(var(--text-muted));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chart-bar-outer {
    flex-grow: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    overflow: hidden;
}
.chart-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--secondary)));
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.chart-bar-value {
    width: 30px;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    color: hsl(var(--text-bright));
}

/* General Layout Filters */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
}

.filters-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.search-wrapper {
    position: relative;
    min-width: 240px;
}
.search-wrapper svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: hsl(var(--text-muted));
    fill: none;
}
.search-wrapper .glass-input {
    padding-left: 36px;
}

.filter-select {
    width: auto;
    font-size: 13px;
    padding: 8px 32px 8px 12px;
}

.view-tabs {
    display: flex;
    background: rgba(10, 15, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 4px;
    border-radius: 8px;
}
.view-tab {
    background: transparent;
    border: none;
    outline: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.view-tab svg {
    width: 16px;
    height: 16px;
    stroke: hsl(var(--text-muted));
    fill: none;
}
.view-tab:hover {
    color: hsl(var(--text-bright));
}
.view-tab.active {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: hsl(var(--text-bright));
}
.view-tab.active svg {
    stroke: hsl(var(--text-bright));
}

/* Database Table Layout */
.table-panel {
    overflow: hidden;
    padding: 0;
}

.glass-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.glass-table th, .glass-table td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.glass-table th {
    background: rgba(255, 255, 255, 0.01);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: hsl(var(--text-muted));
}
.glass-table tr:last-child td {
    border-bottom: none;
}
.glass-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.table-ticket-title {
    font-weight: 600;
    color: hsl(var(--text-bright));
    text-decoration: none;
    font-size: 14px;
    display: block;
}
.table-ticket-title:hover {
    color: hsl(var(--primary-hover));
}
.table-ticket-sub {
    font-size: 12px;
    color: hsl(var(--text-muted));
    margin-top: 4px;
}

/* Kanban Board Layout */
.kanban-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    align-items: start;
    min-height: 500px;
}

.kanban-column {
    background: rgba(10, 15, 28, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 450px;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 2px solid transparent;
}
.kanban-column-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.kanban-column-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.kanban-column-count {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: hsl(var(--text-muted));
}

.kanban-cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 380px;
}

.kanban-card {
    padding: 16px;
    cursor: grab;
}
.kanban-card:active {
    cursor: grabbing;
}
.kanban-card-title {
    font-size: 14px;
    font-weight: 600;
    color: hsl(var(--text-bright));
    margin-bottom: 12px;
    line-height: 1.4;
    text-decoration: none;
    display: block;
}
.kanban-card-title:hover {
    color: hsl(var(--primary-hover));
}
.kanban-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: hsl(var(--text-muted));
}
.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.kanban-card-drag-over {
    border-style: dashed;
    border-color: hsla(var(--primary) / 0.5);
    background: hsla(var(--primary) / 0.03);
}

/* Modals Overlay (Native Dialog) */
.glass-dialog {
    background: transparent;
    border: none;
    outline: none;
    margin: auto;
    max-width: 600px;
    width: calc(100% - 32px);
    z-index: 1000;
}
.glass-dialog::backdrop {
    background: rgba(4, 6, 12, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fade-in 0.25s ease;
}

.dialog-content {
    padding: 32px;
}
.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.dialog-body {
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 24px;
}

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

/* Form Builder styles */
.builder-split {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 32px;
}
@media (max-width: 900px) {
    .builder-split {
        grid-template-columns: 1fr;
    }
}

.type-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.type-nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}
.type-nav-item.active {
    background: hsla(var(--primary) / 0.08);
    border-color: hsla(var(--primary) / 0.2);
}

.fields-editor-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.field-editor-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: rgba(10, 15, 28, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
}

/* Roles Matrix & ACL Grid */
.roles-matrix {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}
.roles-matrix th, .roles-matrix td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    text-align: center;
}
.roles-matrix th:first-child, .roles-matrix td:first-child {
    text-align: left;
    font-weight: 500;
}
.roles-matrix tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.matrix-checkbox {
    margin: 0 auto;
}

/* Status Configuration styles */
.status-settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.status-setting-card {
    display: grid;
    grid-template-columns: auto 1fr 1.2fr auto;
    gap: 24px;
    align-items: center;
}
.status-handle {
    cursor: grab;
    display: flex;
    align-items: center;
    color: hsl(var(--text-muted));
}
.status-handle svg {
    stroke: hsl(var(--text-muted));
}
.color-picker-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
}

/* Status transition checkboxes list */
.allowed-roles-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.allowed-role-pill {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: hsl(var(--text-muted));
}

/* Alert Banners */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    border-left: 4px solid transparent;
}
.alert-success {
    background: hsla(var(--success) / 0.12);
    border-color: hsl(var(--success));
}
.alert-error {
    background: hsla(var(--danger) / 0.12);
    border-color: hsl(var(--danger));
}

/* CSS dynamic chart labels mapping */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 16px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: hsl(var(--text-muted));
}
.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Repeater & Dynamic Forms Block Styling */
.repeater-container {
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 12px;
}

.repeater-blocks-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.repeater-block {
    background: rgba(10, 15, 28, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 16px;
    position: relative;
    animation: fade-in 0.2s ease-in-out;
}

.repeater-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.repeater-block-title {
    font-size: 13px;
    font-weight: 600;
    color: hsl(var(--primary-hover));
    letter-spacing: 0.02em;
}

.repeater-block-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.repeater-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: hsla(var(--primary) / 0.1);
    border: 1px dashed hsla(var(--primary) / 0.3);
    color: hsl(var(--primary-hover));
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.repeater-add-btn:hover {
    background: hsla(var(--primary) / 0.2);
    border-color: hsla(var(--primary) / 0.5);
    color: hsl(var(--text-bright));
}

.subfields-builder-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 16px;
}

.subfield-builder-row {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.subfield-builder-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr auto;
    gap: 12px;
    align-items: center;
}

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

/* RTL Layout Style Overrides */
html[dir="rtl"] .app-sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}
html[dir="rtl"] .app-content {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}
html[dir="rtl"] .sidebar-link svg {
    margin-right: 0;
    margin-left: 12px;
}
html[dir="rtl"] .current-user-card .user-avatar {
    margin-right: 0;
    margin-left: 12px;
}
html[dir="rtl"] .switcher-dropdown {
    right: auto;
    left: 0;
}
html[dir="rtl"] .switcher-item {
    text-align: right;
}
html[dir="rtl"] .glass-table {
    text-align: right;
}
html[dir="rtl"] .glass-table th:first-child, 
html[dir="rtl"] .glass-table td:first-child {
    text-align: right;
}
html[dir="rtl"] .roles-matrix th:first-child, 
html[dir="rtl"] .roles-matrix td:first-child {
    text-align: right;
}
html[dir="rtl"] .alert-banner {
    border-left: none;
    border-right: 4px solid transparent;
}
html[dir="rtl"] .alert-success {
    border-right-color: hsl(var(--success));
}
html[dir="rtl"] .alert-error {
    border-right-color: hsl(var(--danger));
}
html[dir="rtl"] .search-wrapper svg {
    left: auto;
    right: 12px;
}
html[dir="rtl"] .search-wrapper .glass-input {
    padding-left: 12px;
    padding-right: 36px;
}
html[dir="rtl"] .filter-select {
    padding: 8px 12px 8px 32px;
}
html[dir="rtl"] .glass-checkbox {
    margin-right: 0;
    margin-left: 8px;
}
html[dir="rtl"] .chart-bar-value {
    text-align: left;
}

/* ==============================================
   LIGHT THEME GLASSMORPHIC OVERRIDES
   ============================================== */
body {
    background-color: hsl(var(--bg-dark)) !important;
    background-image: 
        radial-gradient(at 0% 0%, hsla(354, 100%, 38%, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(215, 90%, 50%, 0.05) 0px, transparent 50%) !important;
}
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.glass-card:hover {
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Sidebar and layout overrides */
.app-sidebar {
    background: rgba(255, 255, 255, 0.85);
    border-right: 1px solid rgba(0, 0, 0, 0.07);
}
html[dir="rtl"] .app-sidebar {
    border-right: none;
    border-left: 1px solid rgba(0, 0, 0, 0.07);
}
.app-header {
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

/* Sidebar active link */
.sidebar-link:hover {
    background: rgba(0, 0, 0, 0.02);
}
.sidebar-link.active {
    background: hsla(var(--primary) / 0.06);
    color: hsl(var(--primary));
}
.sidebar-link.active span, .sidebar-link.active svg {
    color: hsl(var(--primary));
    stroke: hsl(var(--primary));
}

/* Sidebar Footer User Card */
.current-user-card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.user-avatar {
    color: white !important;
}

/* Buttons */
.glass-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #000000 !important;
}
.glass-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
    color: #000000 !important;
}
.glass-btn-primary {
    color: #000000 !important;
}
.glass-btn-danger {
    color: #000000 !important;
}
.switcher-btn {
    color: #000000 !important;
}
.repeater-add-btn {
    color: #000000 !important;
}
button, input[type="submit"], input[type="button"] {
    color: #000000 !important;
}
.glass-btn svg, .glass-btn-primary svg, .glass-btn-danger svg, .switcher-btn svg {
    stroke: #000000 !important;
    color: #000000 !important;
}

/* Form Controls */
.glass-input, .glass-textarea, .glass-select, .glass-checkbox {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: hsl(var(--text-main));
}
.glass-input:focus, .glass-textarea:focus, .glass-select:focus {
    background: #ffffff;
    border-color: hsla(var(--primary) / 0.6);
}
.glass-checkbox:checked {
    background: hsl(var(--primary));
}

/* Badges */
.glass-badge {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: hsl(var(--text-main));
}

/* Kanban Columns & Cards */
.kanban-column {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.03);
}
.kanban-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}
.kanban-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Tables */
.glass-table th {
    background: rgba(0, 0, 0, 0.02);
}
.glass-table tr:hover td {
    background: rgba(0, 0, 0, 0.01);
}

/* Dialog Backdrops */
.glass-dialog::backdrop {
    background: rgba(0, 0, 0, 0.25);
}

/* User Switcher Dropdown */
.switcher-dropdown {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.switcher-item-avatar {
    color: white;
}

/* Scrollbars */
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Repeater blocks */
.repeater-container {
    background: rgba(0, 0, 0, 0.005);
    border: 1px dashed rgba(0, 0, 0, 0.08);
}
.repeater-block {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.subfields-builder-container {
    background: rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Matrix Matrix Matrix */
.roles-matrix tr:hover td {
    background: rgba(0, 0, 0, 0.01);
}
.roles-matrix th, .roles-matrix td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Category panel overrides */
.type-nav-item {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.type-nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}
.field-editor-row {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.06);
}


