/* ==========================================================================
   STROYNA FACEID DESKTOP SUITE - DESIGN SYSTEM & STYLESHEET
   Modern Desktop Application Interface (Fluent / Linear Aesthetics)
   ========================================================================== */

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

/* --- THEME VARIABLES --- */
:root, :root[data-theme="dark"] {
    --app-font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono-font: 'JetBrains Mono', monospace;

    /* Base Colors (Sleek Dark Slate / Cyber Executive) */
    --bg-app: #080c14;
    --bg-surface: #0f172a;
    --bg-surface-elevated: #1e293b;
    --bg-surface-hover: #273549;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-sidebar: #0a0f1d;
    --bg-titlebar: #070a12;
    --bg-input: #131d31;
    --bg-modal: rgba(15, 23, 42, 0.95);
    
    /* Borders & Dividers */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-focus: #6366f1;
    
    /* Text Hierarchy */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    
    /* Brand & Accent Accents */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    --primary-glow: rgba(99, 102, 241, 0.35);
    
    --accent-cyan: #06b6d4;
    --accent-cyan-light: rgba(6, 182, 212, 0.15);
    
    /* Status Colors */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --success-border: rgba(16, 185, 129, 0.3);
    
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --warning-border: rgba(245, 158, 11, 0.3);
    
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --danger-border: rgba(239, 68, 68, 0.3);
    
    --info: #38bdf8;
    --info-light: rgba(56, 189, 248, 0.15);

    /* Shadows & Glassmorphism */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px var(--primary-glow);
    --glass-blur: blur(16px);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --sidebar-width: 270px;
    --titlebar-height: 52px;
}

:root[data-theme="light"] {
    --bg-app: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f8fafc;
    --bg-surface-hover: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-sidebar: #ffffff;
    --bg-titlebar: #f8fafc;
    --bg-input: #f1f5f9;
    --bg-modal: rgba(255, 255, 255, 0.98);
    
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-medium: rgba(0, 0, 0, 0.14);
    --border-focus: #4f46e5;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.1);
    --primary-glow: rgba(79, 70, 229, 0.2);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* --- RESET & GLOBAL STYLES --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: var(--app-font);
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

input, textarea, select, table {
    user-select: text;
}

/* Custom Desktop Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- DESKTOP APP FRAMEWORK --- */
/* Interactive Background Canvas for Stars & Constellations */
#spaceCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

/* Ambient Cursor Spotlight Glow */
#cursorAura {
    position: fixed;
    top: 0;
    left: 0;
    width: 450px;
    height: 450px;
    margin-left: -225px;
    margin-top: -225px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(6, 182, 212, 0.06) 45%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    filter: blur(20px);
    transition: opacity 0.3s ease;
    will-change: transform;
}

/* --- DESKTOP APP FRAMEWORK --- */
.desktop-window {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: transparent;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* --- TOP TITLEBAR (Native OS App Header) --- */
.desktop-titlebar {
    height: var(--titlebar-height);
    background: rgba(7, 10, 18, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 100;
    flex-shrink: 0;
}

.titlebar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    cursor: pointer;
}

.app-brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-brand:hover .app-brand-icon {
    transform: rotate(10deg) scale(1.08);
}

.app-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.app-brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0.15rem 0.45rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.titlebar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-subtle);
}

.desktop-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.825rem;
    color: var(--text-secondary);
}

.desktop-breadcrumbs span.active {
    color: var(--text-primary);
    font-weight: 600;
}

/* Titlebar Center: Global Instant Search */
.titlebar-center {
    flex: 1;
    max-width: 450px;
    margin: 0 1.5rem;
}

.desktop-quick-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.desktop-quick-search input {
    width: 100%;
    height: 34px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0 2.5rem 0 2.25rem;
    font-size: 0.825rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

.desktop-quick-search input:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.desktop-quick-search .search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

.desktop-quick-search .search-shortcut {
    position: absolute;
    right: 0.6rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.68rem;
    font-family: var(--mono-font);
    color: var(--text-muted);
    pointer-events: none;
}

/* Titlebar Right: Indicators & Controls */
.titlebar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.device-status-cluster {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.device-tag {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: statusPulse 2s infinite;
}

.status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
    animation: none;
}

@keyframes statusPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.75; }
}

.desktop-live-clock {
    font-family: var(--mono-font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.action-icon-btn {
    width: 34px;
    height: 34px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.action-icon-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

/* --- MAIN WORKSPACE LAYOUT --- */
.desktop-body {
    display: flex;
    flex: 1;
    height: calc(100vh - var(--titlebar-height));
    overflow: hidden;
    position: relative;
}

/* --- DESKTOP SIDEBAR --- */
.desktop-sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 15, 29, 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.85rem;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 10;
}

.sidebar-group {
    margin-bottom: 1.25rem;
}

.sidebar-category-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem 0.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-nav-link svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.sidebar-nav-link:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.sidebar-nav-link:hover svg {
    transform: scale(1.1);
}

.sidebar-nav-item.active .sidebar-nav-link {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-nav-item.active .sidebar-nav-link::before {
    content: '';
    position: absolute;
    left: -0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--primary);
}

.sidebar-nav-badge {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.service-runtime-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.service-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.service-meta-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.service-meta-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    color: var(--danger);
    text-decoration: none;
    font-size: 0.825rem;
    font-weight: 600;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: var(--danger-light);
}

/* --- MAIN DESKTOP CONTENT VIEW --- */
.desktop-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.75rem 2.25rem 3rem;
    position: relative;
    animation: desktopFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Content Header / Hero Bar */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.view-titles h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.view-titles p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Desktop Input Groups */
.desktop-date-picker {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.85rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s;
}

.desktop-date-picker:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.desktop-date-picker label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.desktop-date-picker input {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}

/* Buttons System */
.btn-desktop {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    font-size: 0.825rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-desktop svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4338ca);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7174f8, var(--primary));
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-medium);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* --- STATS KPI GRID --- */
.desktop-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transform-style: preserve-3d;
    perspective: 1000px;
    will-change: transform;
    transition: transform 0.15s ease-out, box-shadow 0.25s ease, border-color 0.25s ease;
}

.kpi-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.1), transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.kpi-card:hover::before {
    opacity: 1;
}

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

.kpi-icon-box {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon-box.indigo { background: var(--primary-light); color: var(--primary); }
.kpi-icon-box.green { background: var(--success-light); color: var(--success); }
.kpi-icon-box.amber { background: var(--warning-light); color: var(--warning); }
.kpi-icon-box.red { background: var(--danger-light); color: var(--danger); }
.kpi-icon-box.cyan { background: var(--accent-cyan-light); color: var(--accent-cyan); }

.kpi-info {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.15rem;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--mono-font);
    color: var(--text-primary);
    line-height: 1.1;
}

.kpi-sub {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* --- DESKTOP TOOLBAR & FILTER CHIPS --- */
.desktop-toolbar {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filter-chips-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.35rem 0.8rem;
    font-size: 0.775rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--bg-app);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-chip:hover {
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.desktop-select {
    background: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.85rem;
    font-size: 0.825rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.desktop-select:focus {
    border-color: var(--primary);
}

/* --- DESKTOP TABLE CARDS & STICKY JADVALLAR --- */
.desktop-table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.table-scroll-wrapper {
    overflow-x: auto;
    max-height: calc(100vh - 280px);
}

.desktop-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.desktop-data-table th {
    position: sticky;
    top: 0;
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 0.85rem 1.15rem;
    text-align: left;
    border-bottom: 1px solid var(--border-medium);
    z-index: 10;
    white-space: nowrap;
}

.desktop-data-table td {
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
    transition: background 0.15s;
}

.desktop-data-table tbody tr {
    transition: background 0.15s, transform 0.15s;
}

.desktop-data-table tbody tr:hover td {
    background: var(--bg-surface-hover);
}

.desktop-data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status-colored row accents */
.row-late td:first-child { border-left: 3px solid var(--warning); }
.row-absent td:first-child { border-left: 3px solid var(--danger); }
.row-present td:first-child { border-left: 3px solid var(--success); }

/* --- USER PROFILE COMPONENT --- */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.avatar-wrapper {
    position: relative;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-medium);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
    cursor: pointer;
}

.avatar-img:hover {
    transform: scale(3.5);
    transform-origin: left center;
    border-radius: var(--radius-md);
    z-index: 1000;
    position: relative;
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.avatar-initials {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-surface-elevated), var(--bg-surface-hover));
    border: 1px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--primary);
}

.user-meta-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.15s;
}

.user-meta-name:hover {
    color: var(--primary);
}

.user-meta-role {
    font-size: 0.725rem;
    color: var(--text-muted);
}

/* Time Badges */
.time-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    font-family: var(--mono-font);
    font-size: 0.775rem;
    font-weight: 600;
}

.time-tag.in {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.time-tag.out {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.time-tag.neutral {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* Status Badges */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.status-pill.present { background: var(--success-light); color: var(--success); }
.status-pill.absent { background: var(--danger-light); color: var(--danger); }
.status-pill.late { background: var(--warning-light); color: var(--warning); }
.status-pill.early { background: var(--danger-light); color: var(--danger); }
.status-pill.holiday { background: var(--info-light); color: var(--info); }

/* Work Time Mini Progress Bar */
.work-progress-track {
    width: 100px;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 0.3rem;
}

.work-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- TABEL MONTHLY GRID (High Density Desktop Grid) --- */
.tabel-grid-table th.day-cell-th, 
.tabel-grid-table td.day-cell-td {
    padding: 0.5rem 0.35rem;
    text-align: center;
    min-width: 32px;
    font-size: 0.75rem;
}

.tabel-grid-table th.weekend-header {
    background: rgba(239, 68, 68, 0.15) !important;
    color: var(--danger);
}

.tabel-cell-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    font-family: var(--mono-font);
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.tabel-cell-action:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.cell-present { background: var(--success-light); color: var(--success); }
.cell-absent { background: var(--danger-light); color: var(--danger); }
.cell-tatil { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.cell-kasal { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.cell-sababli { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.cell-dam { background: var(--bg-surface-elevated); color: var(--text-muted); }

/* --- DOSSIER & FORMS (Xodim Kartotekasi) --- */
.dossier-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.dossier-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.dossier-avatar-upload {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px dashed var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--bg-input);
    transition: border-color 0.2s;
}

.dossier-avatar-upload:hover {
    border-color: var(--primary);
}

.dossier-avatar-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.desktop-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.desktop-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.desktop-form-group label {
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.desktop-form-group input, 
.desktop-form-group select, 
.desktop-form-group textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.95rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

.desktop-form-group input:focus, 
.desktop-form-group select:focus, 
.desktop-form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--bg-surface);
}

.form-full-width { grid-column: 1 / -1; }
.form-two-width { grid-column: span 2; }

/* --- INTERACTIVE MODALS & OVERLAYS --- */
.desktop-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.desktop-modal-backdrop.active {
    display: flex;
}

.desktop-modal-window {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    transition: color 0.15s;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--bg-titlebar);
}

/* --- TOAST NOTIFICATION NOTIFIER --- */
.desktop-toast-dock {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
    pointer-events: none;
}

.desktop-toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- LOGIN SCREEN (High-Tech Lockscreen) --- */
.lockscreen-wrapper {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1e1b4b 0%, #080c14 70%);
    position: relative;
    overflow: hidden;
}

.lockscreen-card {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 2.75rem 2.5rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 10;
}

.lockscreen-logo-ring {
    width: 68px;
    height: 68px;
    margin: 0 auto 1.5rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
}

/* --- RESPONSIVE ADAPTATIONS --- */
@media (max-width: 1100px) {
    .desktop-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 850px) {
    .desktop-window {
        overflow-y: auto;
    }
    .desktop-body {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    .desktop-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    .desktop-content {
        padding: 1.25rem;
        overflow: visible;
    }
    .titlebar-center {
        display: none;
    }
    .desktop-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Optimization */
@media print {
    .desktop-titlebar, .desktop-sidebar, .desktop-toolbar, .view-controls {
        display: none !important;
    }
    .desktop-window, .desktop-body, .desktop-content {
        height: auto !important;
        overflow: visible !important;
        background: white !important;
        color: black !important;
    }
    .desktop-table-container {
        border: none !important;
        box-shadow: none !important;
    }
    .desktop-data-table th {
        background: #f1f5f9 !important;
        color: black !important;
    }
}


/* ==========================================================================
   ADVANCED INTERACTIVE ANIMATIONS & VISUAL EFFECTS
   ========================================================================== */

/* 3D Interactive Card Tilt with Specular Glare */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    will-change: transform;
    transition: transform 0.12s ease-out, box-shadow 0.25s ease;
    position: relative;
}

.tilt-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(500px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.09), transparent 65%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 2;
}

.tilt-card:hover::before {
    opacity: 1;
}

/* Border Beam Effect (Rotating Conic Glow) */
.border-beam {
    position: relative;
}

.border-beam::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent-cyan), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderBeamSlide 3.5s linear infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes borderBeamSlide {
    0% { filter: hue-rotate(0deg); opacity: 0.5; }
    50% { opacity: 1; }
    100% { filter: hue-rotate(360deg); opacity: 0.5; }
}

/* Fluid Liquid Button Ripple */
.btn-desktop, .filter-chip, .sidebar-nav-link, .action-icon-btn {
    position: relative;
    overflow: hidden;
}

.fluid-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: fluidRippleAnim 0.65s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(99, 102, 241, 0.25) 50%, transparent 100%);
    pointer-events: none;
}

@keyframes fluidRippleAnim {
    to {
        transform: scale(4.5);
        opacity: 0;
    }
}

/* Cascading Stagger Entrance Animations */
@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.report-row {
    animation: slideUpFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.kpi-card {
    animation: slideUpFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Pulsing Status Glows */
.status-pill.present {
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.status-pill.late {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.status-pill.absent {
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

/* Smooth Table Container Glass */
.desktop-table-container {
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
