/* ==========================================================================
   TIME PAY / DAVOMAT PRO STYLES (WITH LANGUAGE SELECTOR & DATEPICKER)
   ========================================================================== */

:root {
    --bg-main: #ced6e0;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    
    /* Primary Accent - EURO PRINT Orange */
    --primary-orange: #ed5a24;
    --primary-orange-hover: #d04f20;
    --primary-orange-light: #fef1ea;
    
    /* Status Colors */
    --stat-green-bg: #dcfce7;
    --stat-green-text: #166534;
    --stat-teal-bg: #ccfbf1;
    --stat-teal-text: #0f766e;
    --stat-orange-bg: #ffedd5;
    --stat-orange-text: #9a3412;
    --stat-rose-bg: #ffe4e6;
    --stat-rose-text: #9f1239;

    --badge-gray-bg: #f1f5f9;
    --badge-gray-text: #475569;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ================= LANGUAGE SELECTOR STYLES ================= */
.lang-selector-wrapper {
    position: relative;
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    background: #ffffff;
    transition: background 0.15s ease;
}

.lang-selector:hover {
    background-color: var(--bg-main);
}

.lang-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 170px;
    padding: 6px;
    z-index: 1200;
}

.lang-dropdown-menu.active {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lang-option {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease;
}

.lang-option:hover {
    background-color: var(--primary-orange-light);
    color: var(--primary-orange-hover);
}

/* Flags */
.flag-uz {
    width: 20px;
    height: 14px;
    background: linear-gradient(to bottom, #0099b5 33%, #ce1126 33%, #ce1126 36%, #ffffff 36%, #ffffff 64%, #ce1126 64%, #ce1126 67%, #1eb53a 67%);
    border-radius: 2px;
    display: inline-block;
}

.flag-ru {
    width: 20px;
    height: 14px;
    background: linear-gradient(to bottom, #ffffff 33%, #0039a6 33%, #0039a6 66%, #d52b1e 66%);
    border-radius: 2px;
    display: inline-block;
}

.flag-en {
    width: 20px;
    height: 14px;
    background: linear-gradient(to bottom, #00247d 40%, #cf142b 40%, #cf142b 60%, #00247d 60%);
    border-radius: 2px;
    display: inline-block;
}

/* Datepicker Badge Button */
.date-picker-badge-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.date-picker-badge-btn:hover {
    border-color: var(--primary-orange);
    color: var(--text-primary);
}

/* ================= ARIZALAR & LEAVE CARDS STYLES ================= */
.accordion-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.ml-3 { margin-left: 12px; }

.arizalar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    padding: 16px;
}

.ariza-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ariza-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ariza-type-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background-color: #e0f2fe;
    color: #0369a1;
}

.ariza-reason-text {
    font-size: 13px;
    color: var(--text-primary);
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--primary-orange);
}

.ariza-dates {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ariza-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.ariza-actions {
    display: flex;
    gap: 8px;
}

.btn-approve {
    background-color: #dcfce7;
    color: #166534;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-reject {
    background-color: #ffe4e6;
    color: #9f1239;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* ================= LOGIN SCREEN STYLES ================= */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 36px 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    animation: loginPop 0.3s ease-out;
}

@keyframes loginPop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    object-fit: cover;
    margin-bottom: 14px;
    box-shadow: 0 8px 16px rgba(237, 90, 36, 0.35);
}

.login-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-pass {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.login-options a {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 500;
}

.login-error-alert {
    background-color: #ffe4e6;
    color: #9f1239;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-btn {
    padding: 12px;
    font-size: 15px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
}

.demo-badge {
    display: inline-block;
    background: #f1f5f9;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
}

.user-logout-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 8px;
}

.admin-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 8px;
}

.logout-btn {
    background: #ffe4e6;
    color: #9f1239;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.logout-btn:hover { background: #fecdd3; }

/* ================= HEADER ================= */
.main-header {
    height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(237, 90, 36, 0.3);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item {
    position: relative;
}

.nav-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
}

.nav-btn.active {
    background-color: var(--primary-orange);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}

.nav-btn .caret {
    font-size: 11px;
    opacity: 0.8;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    padding: 6px;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    display: flex;
    flex-direction: column;
}

.dropdown-menu a {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.dropdown-menu a:hover {
    background-color: var(--primary-orange-light);
    color: var(--primary-orange-hover);
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.icon-btn.telegram {
    background-color: #0088cc;
    color: #ffffff;
    border: none;
}

.brand-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background-color: var(--bg-main);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.brand-tag img {
    height: 22px;
    display: block;
}

/* ================= APP CONTAINER ================= */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.tab-view { display: none; }
.tab-view.active { display: block; }

.sub-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.sub-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #ffffff;
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.sub-tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.sub-tab-btn.active {
    background-color: var(--primary-orange);
    color: #ffffff;
    font-weight: 600;
}

.action-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-faceid {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: transform 0.15s ease;
}

.btn-faceid:hover { transform: translateY(-1px); }

.filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-secondary);
}

.btn-primary {
    background-color: var(--primary-orange);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
    background-color: var(--primary-orange-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: #ffffff;
    border: 1px solid var(--primary-orange);
    color: var(--primary-orange);
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.subview { display: none; }
.subview.active { display: block; }

/* ================= STATS CARDS ================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.icon-green { background-color: #22c55e; color: #ffffff; }
.icon-teal { background-color: #0d9488; color: #ffffff; }
.icon-orange { background-color: #f97316; color: #ffffff; }
.icon-pink { background-color: #f43f5e; color: #ffffff; }

.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text-primary); }

/* ================= TABLES & KPI BALLS ================= */
.table-section {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.section-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title { font-size: 18px; font-weight: 700; }

.kpi-info-hint { display: flex; gap: 12px; font-size: 12px; }
.kpi-rule-tag { padding: 4px 10px; border-radius: 6px; font-weight: 600; }
.tag-plus { background-color: #dcfce7; color: #15803d; }
.tag-minus { background-color: #fee2e2; color: #b91c1c; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.data-table th {
    padding: 14px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    background-color: #fafafa;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.user-cell { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background-color: #e2e8f0; }
.user-details { display: flex; flex-direction: column; gap: 2px; }
.user-name { font-weight: 600; color: var(--text-primary); }

.dept-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
}

.kpi-score-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ================= GENERIC STATUS BADGES ================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background-color: var(--stat-green-bg); color: var(--stat-green-text); }
.badge-danger { background-color: var(--stat-rose-bg); color: var(--stat-rose-text); }
.badge-warning { background-color: var(--stat-orange-bg); color: var(--stat-orange-text); }
.badge-info { background-color: #e0f2fe; color: #0369a1; }
.badge-gray { background-color: var(--badge-gray-bg); color: var(--badge-gray-text); }

.kpi-score-pill.positive { background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.kpi-score-pill.negative { background-color: #ffe4e6; color: #9f1239; border: 1px solid #fecdd3; }

/* ================= KANBAN BOARD ================= */
.task-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    overflow-x: auto;
}

.kanban-col {
    background: #f1f5f9;
    border-radius: var(--radius-lg);
    padding: 14px;
    min-height: 450px;
}

.col-header { display: flex; align-items: center; font-weight: 600; font-size: 13px; margin-bottom: 14px; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-green { background-color: #22c55e; }
.dot-orange { background-color: #f97316; }
.dot-red { background-color: #ef4444; }
.dot-teal { background-color: #0d9488; }
.dot-rose { background-color: #f43f5e; }

.kanban-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* ================= MONITORING & LEADERBOARDS ================= */
.chart-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chart-legend { display: flex; gap: 16px; font-size: 13px; }
.leg-item { display: flex; align-items: center; gap: 6px; }
.leg-dot { width: 10px; height: 10px; border-radius: 50%; }
.leg-dot.red { background: #ef4444; }
.leg-dot.green { background: #22c55e; }
.leg-dot.orange { background: #f97316; }

.trend-graph-svg-container { width: 100%; height: 180px; }
.trend-svg { width: 100%; height: 100%; }

.leaderboards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ranking-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.card-header-icon { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.card-header-icon i { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.card-header-icon.orange i { background-color: #ffedd5; color: #c2410c; }
.card-header-icon.red i { background-color: #ffe4e6; color: #be123c; }
.card-header-icon.green i { background-color: #dcfce7; color: #15803d; }

.ranking-list { display: flex; flex-direction: column; gap: 12px; }
.rank-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: #f8fafc; }
.rank-user { display: flex; align-items: center; gap: 10px; }
.rank-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.rank-name { font-weight: 600; font-size: 13px; }
.rank-pos { font-size: 11px; color: var(--text-secondary); }

.rank-badge { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.rank-badge.orange { background: #ffedd5; color: #c2410c; }
.rank-badge.red { background: #ffe4e6; color: #be123c; }
.rank-badge.green { background: #dcfce7; color: #15803d; }

/* ================= MODALS & TOAST NOTIFICATION ================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.close-btn { background: transparent; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-select, .form-control {
    padding: 9px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 14px;
}

.modal-footer { margin-top: 24px; }

.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    animation: toastIn 0.3s ease-out;
}

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

.toast-icon { font-size: 24px; color: #0088cc; }
.toast-body h5 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.toast-body p { font-size: 12px; color: #94a3b8; }
