/* ==========================================================================
   GRAAL / MED OS THEME - LifeScan МРТ КТ Clinical Helpdesk
   Restrained, Minimalist, Matte Graphite (Zero Neon, Single Accent)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
    --bg-color: #111111;
    --header-bg: #161616;
    --sidebar-bg: #161616;
    --card-bg: #1c1c1c;
    --card-hover-bg: #202020;
    --card-border: #282828;
    --card-border-hover: #383838;
    
    --text-primary: #f0f0f0;
    --text-secondary: #8e8e8e;
    --text-muted: #555555;
    
    --primary: #ffffff;
    --green: #34c759;
    --amber: #eab308;
    --red: #ef4444;
    
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.15s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-ui);
}

html {
    overflow-y: scroll; /* Permanently reserve vertical scrollbar track to eliminate layout shift */
    scrollbar-gutter: stable; /* Modern CSS standard: keeps layout stable whether scrolling or not */
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-color) !important;
    color: var(--text-primary) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px 40px 16px;
}

/* Sticky Header */
.top-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #141414;
    border-bottom: 1px solid var(--card-border);
    padding: 10px 0;
    margin-bottom: 16px;
}

.top-header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo-img {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain !important;
    border-radius: 4px !important;
    display: block !important;
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* View Switcher Tabs - Single Unified Pill Bar (Exact 32px height) */
.view-tabs-bar {
    display: inline-flex !important;
    align-items: center !important;
    background: #181818 !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 7px !important;
    padding: 2px !important;
    gap: 2px !important;
    height: 32px !important;
    box-sizing: border-box !important;
}

.view-tab-btn {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--text-secondary) !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    padding: 0 10px !important;
    height: 26px !important;
    line-height: 26px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: var(--transition) !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

.view-tab-btn:hover {
    color: var(--text-primary) !important;
}

.view-tab-btn.active {
    background: #2b2b2b !important;
    border-color: #3d3d3d !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}

/* Header Action Buttons (Exact 32px height) */
.btn-header {
    height: 32px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 12px !important;
    border-radius: 7px !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    line-height: 1 !important;
}

.btn-header.btn-secondary {
    background: #181818 !important;
    border: 1px solid var(--card-border) !important;
    color: #d4d4d8 !important;
}

.btn-header.btn-secondary:hover {
    background: #222222 !important;
    border-color: #383838 !important;
    color: var(--text-primary) !important;
}

.btn-header.btn-primary {
    background: #2b2b2b !important;
    border: 1px solid #3d3d3d !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.btn-header.btn-primary:hover {
    background: #363636 !important;
    border-color: #4a4a4a !important;
    color: #ffffff !important;
}

.btn-header.btn-excel {
    background: #181818 !important;
    border: 1px solid var(--card-border) !important;
    color: var(--green) !important;
    padding: 0 10px !important;
}

.btn-header.btn-excel:hover {
    color: #4ade80 !important;
    background: #222222 !important;
    border-color: #383838 !important;
}

/* Buttons (Graal btn-primary & btn-secondary) */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.2;
    text-decoration: none;
}

.btn-primary {
    background: #2b2b2b;
    border: 1px solid #3d3d3d;
    color: #ffffff;
}

.btn-primary:hover {
    background: #363636;
    border-color: #4a4a4a;
    color: #ffffff;
}

.btn-secondary {
    background: #1c1c1c;
    border: 1px solid var(--card-border);
    color: #a0a0a0;
}

.btn-secondary:hover {
    background: #222222;
    border-color: #383838;
    color: var(--text-primary);
}

.btn-excel {
    color: var(--green);
}

.btn-excel:hover {
    color: #4ade80;
}

/* ==========================================================================
   2. KPI ROW (GRAAL STAT CARDS - RESTRAINED MONOCHROME)
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 9px;
    padding: 12px 14px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--card-border-hover);
    background: var(--card-hover-bg);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.stat-icon {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    background: #222222;
    border: 1px solid #2a2a2a;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 6px;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   3. FILTER PILLS BAR (IDENTICAL TO GRAAL 1.8)
   ========================================================================== */

.filter-pills-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.filter-pills-bar::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 30px;
    line-height: 30px;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.filter-pill:hover {
    color: var(--text-primary);
    background: #202020;
}

.filter-pill.active {
    color: #ffffff;
    background: #252525;
    border: 1px solid #383838;
    font-weight: 500; /* Identical font-weight keeps button width 100% constant */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.filter-pill .pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    height: 18px;
    line-height: 18px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    background: #202020;
    color: #888888;
}

.filter-pill.active .pill-count {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

/* ==========================================================================
   4. KANBAN BOARD (4 COMPACT COLUMNS ~285px)
   ========================================================================== */

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
    min-height: 560px;
}

.kanban-column {
    background: #141414;
    border: 1px solid #202020;
    border-radius: 9px;
    padding: 10px 8px;
    min-height: 540px;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 10px 6px;
    border-bottom: 1px solid #1e1e1e;
    margin-bottom: 10px;
}

.column-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.col-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #555555;
}

.col-dot.new { background: var(--red); }
.col-dot.in_prog { background: var(--amber); }
.col-dot.sched { background: #8e8e8e; }
.col-dot.done { background: var(--green); }

.column-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    background: #1c1c1c;
    border: 1px solid var(--card-border);
    padding: 1px 7px;
    border-radius: 5px;
}

/* Month Filter Button in Column Headers (Discreet & Elegant) */
.column-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.col-month-filter-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #6e6e6e;
    height: 22px;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.col-month-filter-btn:hover {
    color: #d4d4d8;
    background: #1e1e1e;
    border-color: #2c2c2c;
}

.col-month-filter-btn.active {
    background: #242424;
    border-color: #383838;
    color: #ffffff;
    font-weight: 500;
    padding: 0 6px;
}

.col-month-label {
    font-size: 10.5px;
    font-family: var(--font-mono);
    color: #ffffff;
}

.col-month-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-left: 2px;
    font-size: 12px;
    line-height: 1;
    color: #888888;
    cursor: pointer;
}

.col-month-clear:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.col-month-popover {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 100;
    min-width: 210px;
    background: #181818;
    border: 1px solid #2e2e2e;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 2px 6px rgba(0, 0, 0, 0.4);
    padding: 6px;
    font-size: 12px;
    animation: fadeInPopover 0.15s ease;
}

@keyframes fadeInPopover {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.month-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 8px 6px;
    border-bottom: 1px solid #242424;
    margin-bottom: 4px;
}

.month-popover-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #8e8e8e;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.month-popover-close {
    background: transparent;
    border: none;
    color: #666666;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
}

.month-popover-close:hover {
    color: #ffffff;
    background: #242424;
}

.month-popover-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 2px 0;
}

.month-popover-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 5px;
    color: #d4d4d8;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    font-size: 12px;
}

.month-popover-item:hover {
    background: #242424;
    color: #ffffff;
}

.month-popover-item.selected {
    background: #2b2b2b;
    color: #ffffff;
    font-weight: 600;
}

.month-popover-item-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #71717a;
    background: #141414;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid #262626;
}

.month-popover-item.selected .month-popover-item-count {
    color: #ffffff;
    border-color: #404040;
}

.month-popover-footer {
    padding: 6px 6px 2px 6px;
    border-top: 1px solid #242424;
    margin-top: 4px;
}

.month-popover-sync-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #888888;
    cursor: pointer;
    user-select: none;
}

.month-popover-sync-label input[type="checkbox"] {
    accent-color: #3b82f6;
    cursor: pointer;
}


.column-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* ==========================================================================
   5. TICKET CARD (GRAAL STYLE - NO COLORED BORDER, CLEAN HIGHLIGHTED RESULT)
   ========================================================================== */

.ticket-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 11px 11px 9px 11px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-card:hover {
    background: var(--card-hover-bg);
    border-color: var(--card-border-hover);
}

/* Ticket Header */
.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card-ticket-id {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-eq-badge {
    background: #242424;
    border: 1px solid #303030;
    color: #a1a1aa;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Card Body */
.card-problem-text {
    color: #d4d4d8;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 400;
    word-break: break-word;
}

/* Highlighted Result Box (User's Resolution - Green clinical tint) */
.card-result-box {
    background: rgba(52, 199, 89, 0.06);
    border: 1px solid rgba(52, 199, 89, 0.22);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.card-result-title {
    color: var(--green);
    font-size: 11.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-result-content {
    color: #e4e4e7;
    font-size: 12.5px;
    line-height: 1.45;
}

/* Photo Thumbnail */
.card-photo-wrapper {
    position: relative;
    border-radius: 6px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    height: 115px;
    background: #111111;
    cursor: pointer;
}

.card-photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.card-photo-wrapper:hover img {
    transform: scale(1.02);
}

.photo-zoom-tag {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Card Footer */
.card-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid #222222;
    padding-top: 7px;
    margin-top: 2px;
}

.card-author {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
}

.card-timestamp {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Card Actions (Compact & Restrained) */
.card-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

.btn-card-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-card-take {
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.25);
    color: var(--amber);
}

.btn-card-take:hover {
    background: rgba(234, 179, 8, 0.16);
    border-color: rgba(234, 179, 8, 0.4);
}

.btn-card-done {
    background: rgba(52, 199, 89, 0.08);
    border-color: rgba(52, 199, 89, 0.25);
    color: var(--green);
}

.btn-card-done:hover {
    background: rgba(52, 199, 89, 0.16);
    border-color: rgba(52, 199, 89, 0.4);
}

.btn-card-reopen {
    background: #242424;
    border-color: #303030;
    color: #a1a1aa;
}

.btn-card-reopen:hover {
    background: #2b2b2b;
    color: #ffffff;
}

.btn-card-delete {
    background: transparent;
    border: none;
    color: #555555;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-card-delete:hover {
    color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}

/* Empty Kanban State */
.empty-kanban-state {
    padding: 24px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 11.5px;
    font-style: italic;
    border: 1px dashed #242424;
    border-radius: 7px;
}

/* ==========================================================================
   6. MODALS & LIGHTBOX (DARKROOM MED OS)
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-backdrop.hidden {
    display: none !important;
}

.modal-card {
    background: #181818;
    border: 1px solid var(--card-border);
    border-radius: 9px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #242424;
}

.modal-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.modal-close:hover {
    color: #ffffff;
    background: #252525;
}

.modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
    background: #141414;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: #444444;
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #242424;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Lightbox Darkroom */
.lightbox-card {
    background: #141414;
    border: 1px solid var(--card-border);
    border-radius: 9px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lightbox-img-wrap {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d0d0d;
    padding: 16px;
}

.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.lightbox-img-wrap img.zoomed {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

/* ==========================================================================
   7. ANALYTICS & DETAILED CLINICAL REPORTING SUITE
   ========================================================================== */
.analytics-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Analytics Filter & Actions Toolbar */
.analytics-toolbar {
    background: #161616;
    border: 1px solid var(--card-border);
    border-radius: 9px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.analytics-filters-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
}

.filter-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.graal-select, .graal-input {
    background: #141414 !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 6px !important;
    color: var(--text-primary) !important;
    padding: 4px 8px !important;
    font-size: 12.5px !important;
    outline: none !important;
    transition: border-color 0.15s ease !important;
    height: 32px !important;
    box-sizing: border-box !important;
}

.graal-select:focus, .graal-input:focus {
    border-color: #444444 !important;
}

.date-picker {
    color-scheme: dark;
    font-family: var(--font-mono);
    font-size: 11.5px !important;
    width: 125px;
}

.analytics-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 4 KPI Summary Grid */
.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .analytics-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-subtitle {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rate-badge {
    color: var(--green);
    font-weight: 600;
    background: rgba(52, 199, 89, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(52, 199, 89, 0.25);
    margin-right: 3px;
    font-family: var(--font-mono);
}

/* 2 Spacious Charts Grid (50 / 50 Layout) */
.analytics-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 900px) {
    .analytics-charts-grid {
        grid-template-columns: 1fr;
    }
}

.analytics-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 9px;
    padding: 16px;
    position: relative;
}

.analytics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.analytics-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Detailed Tasks Table */
.analytics-table-card {
    padding: 14px;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 9px;
    color: #666666;
    font-size: 11.5px;
}

.search-input {
    padding-left: 28px !important;
    width: 280px;
    height: 32px !important;
    font-size: 12px !important;
}

.table-responsive {
    overflow-x: auto;
    max-height: 520px;
    overflow-y: auto;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: #141414;
}

.graal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
}

.graal-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #181818;
    color: #8e8e8e;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.graal-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid #202020;
    color: #d4d4d8;
    vertical-align: top;
    font-size: 12.5px;
    line-height: 1.4;
}

.graal-table tbody tr {
    cursor: pointer;
    transition: background 0.12s ease;
}

.graal-table tbody tr:hover {
    background: #202020;
}

.graal-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-status.completed {
    color: var(--green);
    background: rgba(52, 199, 89, 0.08);
    border: 1px solid rgba(52, 199, 89, 0.25);
}

.badge-status.in_progress {
    color: var(--amber);
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.25);
}

.badge-status.new {
    color: var(--red);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-status.scheduled {
    color: #a1a1aa;
    background: #222222;
    border: 1px solid #333333;
}

/* Print-Only Header & Media Print */
.print-header {
    display: none;
}

@page {
    size: A4 landscape;
    margin: 8mm 8mm 8mm 8mm;
}

@media print {
    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-sizing: border-box !important;
    }

    html, body {
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        background: #ffffff !important;
        color: #111111 !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
        font-size: 11px !important;
        line-height: 1.35 !important;
    }

    /* Hide non-printable UI chrome */
    .top-header,
    .stats-grid,
    #equipment-filter-bar,
    .analytics-toolbar,
    .search-input-wrap,
    .btn-header,
    .modal-backdrop,
    #view-board,
    #col-month-popover,
    .mobile-bottom-nav,
    .mobile-col-selector,
    .analytics-charts-grid {
        display: none !important;
    }

    /* Unlock pagination across all parent containers */
    .app-container,
    main,
    #main-content,
    #view-analytics,
    .analytics-view,
    .analytics-card,
    .analytics-table-card,
    .table-responsive {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        position: static !important;
        float: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Printable Official Header */
    .print-header {
        display: block !important;
        margin-bottom: 12px !important;
        border-bottom: 2px solid #18181b !important;
        padding-bottom: 8px !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    .print-header-top {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* 4 KPI Summary Cards Grid */
    .analytics-kpi-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .stat-card {
        background: #fafafa !important;
        border: 1px solid #d4d4d8 !important;
        border-radius: 6px !important;
        color: #111111 !important;
        padding: 8px 10px !important;
        box-shadow: none !important;
    }

    .stat-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 2px !important;
    }

    .stat-title {
        font-size: 9.5px !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        color: #52525b !important;
        letter-spacing: 0.3px !important;
    }

    .stat-icon {
        width: 20px !important;
        height: 20px !important;
        font-size: 9px !important;
        background: #e4e4e7 !important;
        color: #27272a !important;
        border-radius: 4px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .stat-value {
        font-size: 17px !important;
        font-weight: 700 !important;
        color: #09090b !important;
        margin: 3px 0 1px 0 !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    }

    .stat-subtitle {
        font-size: 9px !important;
        color: #71717a !important;
    }

    /* Table Section Header */
    .analytics-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 6px !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    .analytics-title {
        font-size: 11.5px !important;
        font-weight: 700 !important;
        color: #09090b !important;
    }

    #rep-table-count {
        font-size: 9.5px !important;
        font-weight: 600 !important;
        background: #f4f4f5 !important;
        color: #27272a !important;
        border: 1px solid #d4d4d8 !important;
        padding: 1px 6px !important;
        border-radius: 4px !important;
    }

    /* The Clinical Tasks Table (100% Fixed Table Layout) */
    .graal-table {
        display: table !important;
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        border: 1px solid #b4b4b8 !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
        background: #ffffff !important;
    }

    .graal-table thead {
        display: table-header-group !important;
    }

    .graal-table thead tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .graal-table thead th {
        position: static !important;
        background: #f0f0f2 !important;
        color: #09090b !important;
        font-weight: 700 !important;
        font-size: 8.5px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
        padding: 6px 5px !important;
        border: 1px solid #b4b4b8 !important;
        vertical-align: middle !important;
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .graal-table tbody {
        display: table-row-group !important;
    }

    .graal-table tbody tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: auto !important;
        break-after: auto !important;
    }

    .graal-table tbody td {
        padding: 5px 6px !important;
        border: 1px solid #d4d4d8 !important;
        color: #18181b !important;
        vertical-align: top !important;
        font-size: 9px !important;
        line-height: 1.35 !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        overflow: hidden !important;
        max-width: none !important;
        background: #ffffff !important;
        box-sizing: border-box !important;
    }

    /* 8 Columns - 100% Total Width Allocation in Landscape */
    .graal-table th:nth-child(1), .graal-table td:nth-child(1) { width: 8% !important; min-width: 0 !important; }    /* № Заявки */
    .graal-table th:nth-child(2), .graal-table td:nth-child(2) { width: 10% !important; min-width: 0 !important; }   /* Апарат */
    .graal-table th:nth-child(3), .graal-table td:nth-child(3) { width: 8.5% !important; min-width: 0 !important; }  /* Дата */
    .graal-table th:nth-child(4), .graal-table td:nth-child(4) { width: 23.5% !important; min-width: 0 !important; } /* Опис завдання */
    .graal-table th:nth-child(5), .graal-table td:nth-child(5) { width: 13.5% !important; min-width: 0 !important; } /* Заявник */
    .graal-table th:nth-child(6), .graal-table td:nth-child(6) { width: 13.5% !important; min-width: 0 !important; } /* Статус */
    .graal-table th:nth-child(7), .graal-table td:nth-child(7) { width: 7% !important; min-width: 0 !important; }    /* Час робіт */
    .graal-table th:nth-child(8), .graal-table td:nth-child(8) { width: 16% !important; min-width: 0 !important; }   /* Рішення / Результат */

    /* Typography & Badges in Print */
    .card-num {
        font-family: 'JetBrains Mono', monospace !important;
        font-weight: 600 !important;
        color: #09090b !important;
        font-size: 8.5px !important;
        white-space: nowrap !important;
    }

    .card-eq-badge {
        display: inline-flex !important;
        align-items: center !important;
        gap: 3px !important;
        padding: 2px 5px !important;
        border-radius: 4px !important;
        border: 1px solid #d4d4d8 !important;
        background: #fafafa !important;
        color: #18181b !important;
        font-size: 8.5px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
    }

    /* Col 5: Заявник strictly confined, proportional font */
    .graal-table td:nth-child(5) {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .graal-table td:nth-child(5) span {
        font-size: 8.5px !important;
        font-family: var(--font-ui), sans-serif !important;
        letter-spacing: -0.2px !important;
        color: #0284c7 !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        vertical-align: middle !important;
    }

    .graal-table td:nth-child(5) i {
        font-size: 9.5px !important;
        color: #0284c7 !important;
        display: inline-block !important;
        flex-shrink: 0 !important;
    }

    /* Col 6: Статус */
    .graal-table td:nth-child(6) {
        padding: 5px 6px !important;
        overflow: hidden !important;
    }

    .badge-status {
        display: inline-flex !important;
        align-items: center !important;
        gap: 3px !important;
        padding: 2.5px 6px !important;
        border-radius: 4px !important;
        font-size: 8px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        border: 1px solid #a1a1aa !important;
        color: #18181b !important;
        background: #f4f4f5 !important;
    }

    .badge-status.completed {
        border-color: #16a34a !important;
        background: #f0fdf4 !important;
        color: #15803d !important;
    }

    .badge-status.in_progress {
        border-color: #ca8a04 !important;
        background: #fefce8 !important;
        color: #a16207 !important;
    }

    .badge-status.new {
        border-color: #dc2626 !important;
        background: #fef2f2 !important;
        color: #b91c1c !important;
    }

    .badge-status.scheduled {
        border-color: #71717a !important;
        background: #f4f4f5 !important;
        color: #3f3f46 !important;
    }

    .graal-table tbody td div {
        color: #18181b !important;
    }
}


/* ==========================================================================
   2FA LOGIN & PIN KEYPAD (LIFESCAN AUTHENTIC MED OS)
   ========================================================================== */

.login-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0d0d0d;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.login-card {
    background: #141414;
    border: 1px solid #242424;
    border-radius: 16px;
    width: 380px;
    max-width: 100%;
    padding: 34px 28px 28px 28px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.04);
    text-align: center;
    position: relative;
    animation: loginFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo-wrap {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-glow {
    position: absolute;
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
}

.login-brand-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.login-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.login-brand-name {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 2.2px;
    color: #ffffff;
}

.login-modality-badge {
    background: #202020;
    color: #a1a1aa;
    border: 1px solid #2f2f2f;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.login-system-title {
    font-size: 12px;
    color: #888888;
    margin-bottom: 12px;
    font-weight: 400;
}

.login-security-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    background: #181818;
    border: 1px solid #262626;
    border-radius: 20px;
    font-size: 11px;
    color: #888888;
    font-weight: 500;
    margin-bottom: 20px;
}

.login-security-tag i {
    font-size: 11px;
    color: #71717a;
}

.login-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 0 0 16px 0;
}

.login-picker-label {
    font-size: 11px;
    color: #888888;
    text-align: left;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recipients-pills-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    text-align: left;
}

.recipient-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    padding: 0 16px;
    background: #181818;
    border: 1px solid #262626;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.recipient-pill:hover {
    background: #1f1f1f;
    border-color: #363636;
}

.recipient-pill.active {
    background: #252525;
    border: 1px solid #444444;
    box-shadow: none;
}

.recipient-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #a1a1aa;
    letter-spacing: -0.1px;
}

.recipient-pill.active .recipient-name {
    color: #ffffff;
}

.recipient-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #383838;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    background: transparent;
}

.recipient-pill.active .recipient-check {
    border-color: #ffffff;
    background: #ffffff;
}

.recipient-check i {
    font-size: 10px;
    color: #111111;
    opacity: 0;
    transition: opacity 0.15s;
}

.recipient-pill.active .recipient-check i {
    opacity: 1;
}

.btn-request-tg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 42px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 9px !important;
    background: #242424 !important;
    border: 1px solid #363636 !important;
    color: #ffffff !important;
    transition: all 0.15s ease !important;
    width: 100%;
    cursor: pointer;
}

.btn-request-tg:hover {
    background: #2c2c2c !important;
    border-color: #4a4a4a !important;
    box-shadow: none !important;
}

.btn-request-tg i {
    color: #ffffff;
    font-size: 14px;
}

.login-pin-prompt {
    font-size: 12.5px;
    color: #888888;
    margin-bottom: 14px;
    line-height: 1.4;
}

.login-pin-input {
    width: 100%;
    background: #101010 !important;
    border: 1px solid #2b2b2b !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    text-align: center;
    letter-spacing: 12px;
    font-size: 24px;
    font-weight: 700;
    font-family: monospace, monospace;
    padding: 10px 14px;
    outline: none !important;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.login-pin-input:focus {
    border-color: #555555 !important;
    box-shadow: none !important;
}

.pin-keyboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px auto 0 auto;
    width: 230px;
}

.pin-key {
    background: #1a1a1a;
    border: 1px solid #282828;
    color: #f5f5f5;
    font-size: 18px;
    font-weight: 600;
    border-radius: 9px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
}

.pin-key:hover {
    background: #252525;
    border-color: #3a3a3a;
}

.pin-key:active {
    background: #303030;
    transform: scale(0.96);
}

.pin-key-action {
    color: #888888;
    font-size: 14px;
}

.btn-login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 9px !important;
    background: #2b2b2b !important;
    border: 1px solid #3d3d3d !important;
    color: #ffffff !important;
    transition: all 0.15s ease !important;
    width: 100%;
    margin-top: 14px;
    cursor: pointer;
}

.btn-login-submit:hover {
    background: #363636 !important;
    border-color: #4a4a4a !important;
    box-shadow: none !important;
}

.login-resend-area {
    margin-top: 14px;
    text-align: center;
}

.btn-resend-link {
    background: transparent;
    border: none;
    color: #888888;
    font-size: 11.5px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.15s;
}

.btn-resend-link:hover {
    color: #e5e5e5;
}

.login-error-alert {
    margin-top: 14px;
    padding: 9px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    color: #f87171;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE ENGINE (v3 - Exact Clinical Touch UX)
   ========================================================================== */

/* Mobile column selector indicator pills (hidden on desktop) */
.mobile-col-pills {
    display: none;
}


/* Tablet adjustments (<= 992px) */
@media (max-width: 992px) {
    .app-container {
        padding: 0 14px 30px 14px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .stats-grid .stat-card:nth-child(4),
    .stats-grid .stat-card:nth-child(5) {
        grid-column: span 1;
    }
    
    .kanban-board {
        gap: 10px !important;
    }
}

/* Mobile Phones (<= 768px) */
@media (max-width: 768px) {
    /* Safe Area Insets */
    html, body {
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        overflow-x: hidden;
    }

    .app-container {
        padding: 0 10px 32px 10px !important;
    }

        /* 1. Header (Single logout button, perfectly sized to never overflow) */
    .top-header {
        padding: 6px 0 8px 0 !important;
        margin-bottom: 8px !important;
    }

    .top-header-inner {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 0 10px !important;
    }

    .brand-area {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .brand-title {
        font-size: 14px !important;
        letter-spacing: -0.2px !important;
        font-weight: 700 !important;
    }

    .header-controls {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .view-tabs-bar {
        flex: 0 0 auto !important;
        height: 32px !important;
    }

    .view-tab-btn {
        padding: 0 8px !important;
        font-size: 11.5px !important;
        height: 26px !important;
    }

    #btn-schedule-task {
        height: 32px !important;
        width: 32px !important;
        padding: 0 !important;
        flex: 0 0 32px !important;
        justify-content: center !important;
    }

    #btn-schedule-task span {
        display: none !important;
    }

    #btn-new-ticket {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        height: 32px !important;
        padding: 0 8px !important;
        font-size: 11.5px !important;
        font-weight: 600 !important;
        justify-content: center !important;
    }

    #btn-new-ticket span {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    #btn-logout {
        flex: 0 0 32px !important;
        width: 32px !important;
        padding: 0 !important;
        justify-content: center !important;
        height: 32px !important;
    }

    /* 2. Hide KPI counter row completely on mobile screens (Kept visible on desktop) */
    .stats-grid {
        display: none !important;
    }

    /* 3. Equipment Filter Bar */
    .filter-pills-bar {
        display: flex !important;
        gap: 5px !important;
        padding: 2px 0 6px 0 !important;
        margin-bottom: 8px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .filter-pills-bar::-webkit-scrollbar {
        display: none !important;
    }

    .filter-pill {
        height: 30px !important;
        padding: 0 10px !important;
        font-size: 11.5px !important;
        border-radius: 6px !important;
        flex-shrink: 0 !important;
    }

    /* 4. Kanban Clean 100% Width Tab Switching (Issue #3 Fix: NO side peek!) */
    .mobile-col-pills {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        overflow-x: auto !important;
        padding: 2px 0 6px 0 !important;
        margin-bottom: 8px !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .mobile-col-pills::-webkit-scrollbar {
        display: none !important;
    }

    .mobile-col-btn {
        background: #161616 !important;
        border: 1px solid var(--card-border) !important;
        color: var(--text-secondary) !important;
        border-radius: 6px !important;
        padding: 5px 8px !important;
        font-size: 11.5px !important;
        font-weight: 500 !important;
        white-space: nowrap !important;
        cursor: pointer !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 5px !important;
        flex: 1 1 auto !important;
        justify-content: center !important;
        transition: var(--transition) !important;
    }

    .mobile-col-btn.active {
        background: #272727 !important;
        border-color: #3f3f3f !important;
        color: #ffffff !important;
        font-weight: 600 !important;
    }

    .m-col-badge {
        background: #1f1f1f !important;
        border-radius: 4px !important;
        padding: 1px 4px !important;
        font-size: 10px !important;
        font-family: var(--font-mono) !important;
        color: #888888 !important;
    }

    .mobile-col-btn.active .m-col-badge {
        background: #383838 !important;
        color: #ffffff !important;
    }

    /* Full Width 100% Column (NO side peek!) */
    .kanban-board {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    .kanban-column {
        display: none !important; /* Inactive columns completely hidden on mobile */
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 8px !important;
        background: #141414 !important;
        box-sizing: border-box !important;
    }

    .kanban-column.mobile-active-col {
        display: block !important; /* Only active column is shown at 100% width */
        animation: colFade 0.15s ease-out !important;
    }

    @keyframes colFade {
        from { opacity: 0; transform: translateY(3px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .column-header {
        padding: 10px 12px !important;
    }

    .column-cards {
        padding: 8px !important;
        min-height: 180px !important;
    }

    /* 5. Ticket Card Touch Tuning */
    .ticket-card {
        padding: 11px 12px !important;
        border-radius: 8px !important;
        margin-bottom: 8px !important;
    }

    .card-problem-text {
        font-size: 13px !important;
        line-height: 1.45 !important;
    }

    .card-actions-row {
        display: flex !important;
        gap: 6px !important;
        margin-top: 10px !important;
    }

    .btn-card-action {
        height: 36px !important;
        font-size: 12px !important;
        flex: 1 !important;
        justify-content: center !important;
    }

    /* 6. Analytics Mobile Tuning */
    .analytics-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 10px !important;
    }

    .analytics-filters-left {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }

    .filter-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
        width: 100% !important;
    }

    .graal-select, .graal-input {
        width: 100% !important;
        height: 36px !important;
        font-size: 14px !important;
    }

    .analytics-actions-right {
        display: flex !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .analytics-actions-right .btn-header {
        flex: 1 !important;
        height: 36px !important;
        font-size: 12px !important;
    }

    .analytics-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    .analytics-charts-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .analytics-card {
        padding: 10px !important;
    }

    .analytics-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: 0 -10px !important;
        padding: 0 10px !important;
    }
}

/* Bottom Sheet Modals on Mobile Phones (<= 640px) */
@media (max-width: 640px) {
    .modal-backdrop {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .modal-card {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        border-bottom: none !important;
        max-height: 88vh !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        animation: slideUpSheet 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    @keyframes slideUpSheet {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .modal-header {
        padding: 14px 16px 12px 16px !important;
    }

    .modal-body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 14px 16px !important;
        max-height: calc(88vh - 120px) !important;
    }

    .modal-footer {
        padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)) 16px !important;
        gap: 8px !important;
        display: flex !important;
    }

    .modal-footer .btn {
        flex: 1 !important;
        height: 42px !important;
        font-size: 13.5px !important;
        justify-content: center !important;
    }

    /* iOS Safari Input auto-zoom fix (MUST be at least 16px) */
    .form-input, .form-select, .form-textarea, .graal-input, .graal-select {
        font-size: 16px !important;
    }
}

/* 2FA Login Screen Mobile Optimization (<= 480px) */
@media (max-width: 480px) {
    .login-container {
        padding: 12px !important;
    }

    .login-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 24px 16px 20px 16px !important;
        border-radius: 14px !important;
    }

    .login-brand-name {
        font-size: 16px !important;
    }

    .login-system-title {
        font-size: 12px !important;
        margin-bottom: 12px !important;
    }

    .recipients-pills-list {
        gap: 6px !important;
    }

    .recipient-pill-btn {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }

    .login-pin-input {
        font-size: 26px !important;
        letter-spacing: 10px !important;
        height: 48px !important;
    }

    .pin-keyboard {
        gap: 8px !important;
        max-width: 290px !important;
        margin: 12px auto !important;
    }

    .pin-key {
        height: 46px !important;
        font-size: 17px !important;
        border-radius: 8px !important;
    }

    .btn-login-submit {
        height: 44px !important;
        font-size: 13.5px !important;
    }
}


/* ==========================================================================
   DIRECTOR APPROVAL & EVIDENCE PHOTO STYLES
   ========================================================================== */

.card-director-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    width: fit-content;
}

.card-director-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.card-director-badge.rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.card-director-badge.approved {
    background: rgba(52, 199, 89, 0.15);
    color: #4ade80;
    border: 1px solid rgba(52, 199, 89, 0.35);
}

.resolution-upload-box {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.resolution-upload-box:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.04);
}

.resolution-previews-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.resolution-preview-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #000;
}

.resolution-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resolution-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.resolution-preview-remove:hover {
    background: #ef4444;
}

.resolution-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.resolution-gallery-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    cursor: pointer;
    position: relative;
    background: #000;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.resolution-gallery-thumb:hover {
    transform: scale(1.03);
    border-color: #38bdf8;
}

.resolution-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
