/* ==========================================================================
   Manpower & Attendance Tracker - Custom Styles (Premium Obsidian Theme)
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #070a13;
    --bg-panel: rgba(13, 20, 35, 0.75);
    --bg-card: #0f172a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(6, 182, 212, 0.15);
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Status Colors (Matched to Excel Image) */
    --color-present: #f97316; /* ส้ม - ทำงาน C */
    --color-holiday: #eab308; /* เหลือง - วันหยุด H */
    --color-leave: #2563eb;    /* น้ำเงิน - ลากิจ L */
    --color-sick: #8b5cf6;     /* ม่วง - ลาป่วย SC */
    --color-half: #06b6d4;     /* ฟ้า - ลาครึ่งวัน HO */
    --color-absent: #ef4444;   /* แดง - ขาดงาน A */
    
    /* Neon Accents */
    --cyan: #06b6d4;
    --violet: #8b5cf6;
    --emerald: #10b981;
    --rose: #f43f5e;
    
    /* Layout & Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --sidebar-width: 260px;
    --header-height: 70px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Settings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Layout Architecture */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 40%),
                radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.05), transparent 40%);
}

/* Header Styling */
.app-header {
    height: var(--header-height);
    background-color: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-area i {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.logo-area h1 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-area .subtitle {
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    margin-top: -2px;
    font-weight: 600;
}

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

/* Cloud Status Badge */
.cloud-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
}

.cloud-status-badge i {
    width: 14px;
    height: 14px;
}

.cloud-status-badge.online {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--emerald);
    border-color: rgba(16, 185, 129, 0.3);
}

.cloud-status-badge.syncing {
    background-color: rgba(234, 179, 8, 0.1);
    color: var(--color-holiday);
    border-color: rgba(234, 179, 8, 0.3);
    animation: pulseGlow 1.5s infinite alternate;
}

.cloud-status-badge.offline {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border-color: var(--border-color);
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 4px rgba(234, 179, 8, 0.2); }
    to { box-shadow: 0 0 10px rgba(234, 179, 8, 0.4); }
}

.header-info {
    display: flex;
    gap: 14px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.header-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.role-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 8px;
}

.role-selector-wrapper label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.role-select {
    background: transparent;
    border: none;
    color: var(--cyan);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.role-select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

/* Main Layout Grid */
.main-layout {
    display: flex;
    flex: 1;
    position: relative;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: rgba(10, 15, 30, 0.6);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 12px;
    backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
}

.nav-item i {
    width: 20px;
    height: 20px;
    transition: var(--transition-smooth);
}

.nav-item span {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
}

.nav-item span small {
    font-size: 9px;
    font-weight: 400;
    color: var(--text-muted);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.02));
    border-left: 3px solid var(--cyan);
    color: var(--cyan);
}

.nav-item.active i {
    color: var(--cyan);
    filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.4));
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: var(--text-muted);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - var(--header-height));
}

.view-section {
    animation: fadeIn 0.4s ease-out;
}

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

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

.view-header h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    padding-left: 12px;
}

.view-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background-color: var(--cyan);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--cyan);
}

/* Slicers Panel Styling */
.slicers-wrapper {
    padding: 16px 20px;
}

.slicers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.slicers-header h3 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.btn-outline-clear {
    padding: 6px 12px;
    font-size: 11px;
    border-color: rgba(244, 63, 94, 0.2);
    color: var(--rose);
}

.btn-outline-clear:hover {
    background-color: rgba(244, 63, 94, 0.06);
    border-color: var(--rose);
}

.slicers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

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

.slicer-item label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.slicer-item label i {
    width: 12px;
    height: 12px;
    color: var(--cyan);
}

.slicer-item input, .slicer-item select {
    width: 100%;
    height: 34px;
    padding: 6px 10px;
}

/* Global Form Elements */
.styled-select, .styled-input {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 8px;
    outline: none;
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition-smooth);
}

.styled-select:focus, .styled-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.filter-bar label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan), #0891b2);
    color: #0f172a;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(6, 182, 212, 0.45);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-outline.active {
    background-color: rgba(6, 182, 212, 0.12);
    border-color: var(--cyan);
    color: var(--cyan);
}

.btn-danger {
    background-color: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--rose);
}

.btn-danger:hover {
    background-color: var(--rose);
    color: white;
}

/* Glassmorphic Panel Styles */
.glass-panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.gradient-border-cyan::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), transparent);
}

.gradient-border-rose::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--rose), transparent);
}

.gradient-border-violet::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--violet), transparent);
}

.gradient-border-amber::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-holiday), transparent);
}

/* Dashboard Metrics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.bg-cyan-dim { background-color: rgba(6, 182, 212, 0.12); }
.bg-rose-dim { background-color: rgba(244, 63, 94, 0.12); }
.bg-violet-dim { background-color: rgba(139, 92, 246, 0.12); }
.bg-amber-dim { background-color: rgba(234, 179, 8, 0.12); }

.text-cyan { color: var(--cyan); }
.text-rose { color: var(--rose); }
.text-violet { color: var(--violet); }
.text-amber { color: var(--color-holiday); }

.stat-info {
    flex: 1;
    overflow: hidden;
}

.stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-info h3 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-info h3 small {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-subtext {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.progress-bar-container {
    height: 5px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
    width: 100%;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--violet), var(--cyan));
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

/* Dashboard Analytics Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1.3fr; /* Resize layout */
    }
}

.dashboard-card {
    display: flex;
    flex-direction: column;
}

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

.card-header h3 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--cyan);
}

.card-body {
    padding: 20px;
    flex: 1;
}

.flex-column-layout {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chart-container-wrapper {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.compact-chart {
    min-height: 200px;
}

/* Drilldown list styling */
.drilldown-panel {
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    animation: slideDownPanel 0.3s ease-out;
}

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

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

.drilldown-header h4 {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    color: var(--cyan);
}

.btn-close-sm {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-sm:hover {
    background-color: rgba(255,255,255,0.05);
    color: white;
}

.drilldown-list-wrapper {
    max-height: 180px;
    overflow-y: auto;
}

.compact-table th {
    padding: 6px 10px;
    font-size: 10px;
}

.compact-table td {
    padding: 6px 10px;
    font-size: 11px;
}

/* Badge styling */
.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.badge-success { background-color: rgba(16, 185, 129, 0.15); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge.badge-warning { background-color: rgba(234, 179, 8, 0.15); color: var(--color-holiday); border: 1px solid rgba(234, 179, 8, 0.3); }
.badge.badge-danger { background-color: rgba(239, 68, 68, 0.15); color: var(--rose); border: 1px solid rgba(239, 68, 68, 0.3); }

/* Tables Design */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.styled-table th {
    background-color: rgba(15, 23, 42, 0.4);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 12px 16px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
}

.styled-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.styled-table tbody tr {
    transition: var(--transition-smooth);
}

.styled-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.text-center { text-align: center; }

/* Shift Summary Bar */
.shift-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    align-items: center;
}

.shift-summary-bar .bar-item {
    display: flex;
    flex-direction: column;
}

.shift-summary-bar .bar-item .label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.shift-summary-bar .bar-item .value {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.bar-item-status {
    margin-left: auto;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

.bar-item-status.ok { background-color: rgba(16, 185, 129, 0.15); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.bar-item-status.warn { background-color: rgba(234, 179, 8, 0.15); color: var(--color-holiday); border: 1px solid rgba(234, 179, 8, 0.3); }
.bar-item-status.critical { background-color: rgba(239, 68, 68, 0.15); color: var(--rose); border: 1px solid rgba(239, 68, 68, 0.3); }

/* Mobile Day Checkin Operator Cards */
.mobile-checkin-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.view-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.search-box input {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px 10px 42px;
    border-radius: 8px;
    outline: none;
    font-size: 13px;
    transition: var(--transition-smooth);
}

.search-box input:focus {
    border-color: var(--cyan);
}

.quick-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.operator-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.operator-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    transition: var(--transition-smooth);
}

.operator-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-color: rgba(6, 182, 212, 0.3);
}

.operator-card.row-grp-injection {
    border-left: 4px solid #f97316;
}
.operator-card.row-grp-blow {
    border-left: 4px solid #0ea5e9;
}
.operator-card.row-grp-rc {
    border-left: 4px solid #a855f7;
}
.operator-card.row-grp-asm {
    border-left: 4px solid #ec4899;
}
.operator-card.row-grp-feed {
    border-left: 4px solid #eab308;
}
.operator-card.row-grp-support {
    border-left: 4px solid #6b7280;
}

.operator-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.operator-info {
    overflow: hidden;
    padding-right: 8px;
}

.operator-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.operator-id-pos {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.operator-level-badge {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-top: 4px;
    display: inline-block;
}

.operator-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 12px;
    margin-top: auto;
    gap: 12px;
}

.assigned-mc-trigger {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    height: 36px;
}

.assigned-mc-trigger span {
    font-weight: 700;
    color: var(--text-primary);
}

.touch-status-badge {
    width: 65px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.touch-status-badge.status-unchecked {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--text-muted);
    color: var(--text-muted);
}

/* 31-Day Excel-like Spreadsheet Grid */
.spreadsheet-container {
    width: 100%;
    overflow: hidden;
}

.table-wrapper-horizontal {
    overflow-x: auto;
    width: 100%;
}

.spreadsheet-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.spreadsheet-table th, .spreadsheet-table td {
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0;
    text-align: center;
    vertical-align: middle;
    height: 34px;
}

.spreadsheet-table th {
    background-color: #0f172a;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Column Sizing classes */
.col-pos { width: 110px; }
.col-lvl { width: 45px; }
.col-id { width: 70px; }
.col-name { width: 140px; text-align: left !important; padding-left: 8px !important; }
.col-day { width: 34px; }
.col-calc { width: 45px; font-weight: bold; }
.col-calc-pct { width: 68px; font-weight: bold; font-size: 10px; }

/* Sticky columns */
.sticky-col {
    position: sticky;
    z-index: 10;
    background-color: #0f172a;
    transition: background-color 0.2s ease;
}

.col-pos-sticky { left: 0; }
.col-lvl-sticky { left: 110px; }
.col-id-sticky { left: 155px; }
.col-name-sticky { left: 225px; box-shadow: 2px 0 5px rgba(0,0,0,0.3); }

/* Row Group Highlights by Machine */
.row-grp-injection .sticky-col {
    background-color: #1e1511; /* subtle orange tint */
}
.row-grp-injection .col-pos-sticky {
    border-left: 3px solid #f97316; /* orange indicator */
}

.row-grp-blow .sticky-col {
    background-color: #0e1b29; /* subtle sky blue tint */
}
.row-grp-blow .col-pos-sticky {
    border-left: 3px solid #0ea5e9; /* sky blue indicator */
}

.row-grp-rc .sticky-col {
    background-color: #181424; /* subtle purple tint */
}
.row-grp-rc .col-pos-sticky {
    border-left: 3px solid #a855f7; /* purple indicator */
}

.row-grp-asm .sticky-col {
    background-color: #1e131d; /* subtle pink tint */
}
.row-grp-asm .col-pos-sticky {
    border-left: 3px solid #ec4899; /* pink indicator */
}

.row-grp-feed .sticky-col {
    background-color: #1c1a11; /* subtle yellow tint */
}
.row-grp-feed .col-pos-sticky {
    border-left: 3px solid #eab308; /* yellow indicator */
}

.row-grp-support .sticky-col {
    background-color: #141720; /* subtle gray/slate tint */
}
.row-grp-support .col-pos-sticky {
    border-left: 3px solid #6b7280; /* gray indicator */
}

/* Day Cells - Editable */
.day-cell {
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: var(--transition-smooth);
    user-select: none;
    position: relative;
}

.day-cell:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.day-cell:focus {
    outline: 2px solid var(--cyan);
    z-index: 5;
}

/* Inline Input Box inside grid cells */
.grid-inline-input {
    width: 100%;
    height: 100%;
    border: none;
    background-color: rgba(6, 182, 212, 0.25);
    color: white;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    outline: none;
    padding: 0;
    margin: 0;
}

/* Autocomplete Dropdown for Cell Editing */
.cell-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    min-width: 240px;
    max-height: 260px;
    overflow-y: auto;
    background: #0f172a;
    border: 1px solid rgba(6,182,212,0.4);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(6,182,212,0.1);
    z-index: 9999;
    padding: 4px;
    backdrop-filter: blur(12px);
    animation: acDropIn 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes acDropIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cell-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: var(--font-body);
    white-space: nowrap;
}

.cell-autocomplete-item:hover,
.cell-autocomplete-item.active {
    background-color: rgba(6, 182, 212, 0.15);
}

.ac-code {
    display: inline-block;
    min-width: 60px;
    text-align: center;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid;
    font-size: 10px;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.ac-desc {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-c     { background-color: var(--color-present) !important; color: #fff !important; }    /* Work C */
.cell-h     { background-color: var(--color-holiday) !important; color: #000 !important; }    /* Holiday H */
.cell-l     { background-color: var(--color-leave) !important; color: #fff !important; }      /* Leave L */
.cell-sc    { background-color: var(--color-sick) !important; color: #fff !important; }       /* Sick SC */
.cell-ho    { background-color: var(--color-half) !important; color: #fff !important; }       /* Half HO */
.cell-a     { background-color: var(--color-absent) !important; color: #fff !important; }     /* Absent A */
.cell-awol  { background-color: #dc2626 !important; color: #fff !important; font-weight: 900; } /* AWOL */
.cell-other { background-color: rgba(100,116,139,0.35) !important; color: #cbd5e1 !important; } /* OTHER */

/* Injection 2500T - Indigo */
.cell-i4   { background-color: rgba(99,102,241,0.55) !important; color: #e0e7ff !important; }
.cell-i4-f { background-color: rgba(99,102,241,0.35) !important; color: #c7d2fe !important; }
.cell-i4-r { background-color: rgba(99,102,241,0.25) !important; color: #a5b4fc !important; }
.cell-i4-c { background-color: rgba(99,102,241,0.20) !important; color: #a5b4fc !important; }

/* Injection 700T - Pink */
.cell-i5   { background-color: rgba(236,72,153,0.55) !important; color: #fce7f3 !important; }
.cell-i5-f { background-color: rgba(236,72,153,0.35) !important; color: #fbcfe8 !important; }
.cell-i5-r { background-color: rgba(236,72,153,0.25) !important; color: #f9a8d4 !important; }
.cell-i5-o { background-color: rgba(236,72,153,0.15) !important; color: #f9a8d4 !important; }

/* BM6 - Amber */
.cell-b6   { background-color: rgba(245,158,11,0.55) !important; color: #fef3c7 !important; }
.cell-b6-f { background-color: rgba(245,158,11,0.35) !important; color: #fde68a !important; }
.cell-b6-r { background-color: rgba(245,158,11,0.25) !important; color: #fcd34d !important; }
.cell-b6-c { background-color: rgba(245,158,11,0.20) !important; color: #fcd34d !important; }
.cell-b6-o { background-color: rgba(245,158,11,0.12) !important; color: #fcd34d !important; }

/* BM7 - Emerald */
.cell-b7   { background-color: rgba(16,185,129,0.55) !important; color: #d1fae5 !important; }
.cell-b7-f { background-color: rgba(16,185,129,0.35) !important; color: #a7f3d0 !important; }
.cell-b7-r { background-color: rgba(16,185,129,0.25) !important; color: #6ee7b7 !important; }
.cell-b7-c { background-color: rgba(16,185,129,0.20) !important; color: #6ee7b7 !important; }
.cell-b7-o { background-color: rgba(16,185,129,0.12) !important; color: #6ee7b7 !important; }

/* BM8 - Cyan */
.cell-b8   { background-color: rgba(6,182,212,0.55) !important; color: #cffafe !important; }
.cell-b8-f { background-color: rgba(6,182,212,0.35) !important; color: #a5f3fc !important; }
.cell-b8-r { background-color: rgba(6,182,212,0.25) !important; color: #67e8f9 !important; }
.cell-b8-c { background-color: rgba(6,182,212,0.20) !important; color: #67e8f9 !important; }
.cell-b8-o { background-color: rgba(6,182,212,0.12) !important; color: #67e8f9 !important; }

/* BM9 - Red */
.cell-b9   { background-color: rgba(239,68,68,0.55) !important; color: #fee2e2 !important; }
.cell-b9-f { background-color: rgba(239,68,68,0.35) !important; color: #fecaca !important; }
.cell-b9-r { background-color: rgba(239,68,68,0.25) !important; color: #fca5a5 !important; }
.cell-b9-c { background-color: rgba(239,68,68,0.20) !important; color: #fca5a5 !important; }
.cell-b9-o { background-color: rgba(239,68,68,0.12) !important; color: #fca5a5 !important; }

/* BM10 - Violet */
.cell-b10   { background-color: rgba(168,85,247,0.55) !important; color: #ede9fe !important; }
.cell-b10-f { background-color: rgba(168,85,247,0.35) !important; color: #ddd6fe !important; }
.cell-b10-r { background-color: rgba(168,85,247,0.25) !important; color: #c4b5fd !important; }
.cell-b10-c { background-color: rgba(168,85,247,0.20) !important; color: #c4b5fd !important; }
.cell-b10-o { background-color: rgba(168,85,247,0.12) !important; color: #c4b5fd !important; }

/* ASSY / RC - Teal */
.cell-w  { background-color: rgba(20,184,166,0.45) !important; color: #ccfbf1 !important; }
.cell-rc { background-color: rgba(20,184,166,0.30) !important; color: #99f6e4 !important; }
.cell-mc { background-color: #ea580c !important; color: white !important; }

/* Calculated Columns coloring */
.cell-calc-present { background-color: rgba(16, 185, 129, 0.08); color: var(--emerald) !important; }
.cell-calc-absent { background-color: rgba(239, 68, 68, 0.08); color: var(--rose) !important; }
.cell-calc-total { background-color: rgba(255,255,255,0.02); }
.cell-calc-pct { background-color: rgba(139, 92, 246, 0.08); color: var(--violet) !important; }
.cell-calc-pct.pct-green { background-color: rgba(16, 185, 129, 0.15) !important; color: var(--emerald) !important; }

/* STD vs Actual Summary Grid Table (Bottom of spreadsheet) */
.manpower-summary-grid-section {
    padding: 20px;
}

.manpower-summary-grid-section .section-title {
    margin-bottom: 16px;
}

.manpower-summary-grid-section .section-title h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
}

.summary-grid-table th {
    background-color: #1e293b;
}

.summary-grid-table td {
    font-size: 11px;
    font-weight: 600;
}

.summary-grid-row-header {
    width: 250px;
    text-align: left !important;
    padding-left: 12px !important;
    position: sticky;
    left: 0;
    background-color: #1e293b;
    z-index: 10;
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
}

.summary-grid-row-header.sub-header {
    background-color: #0f172a;
    font-weight: 700;
    text-transform: uppercase;
}

.row-plan { background-color: rgba(255, 255, 255, 0.01); color: var(--text-secondary); }
.row-actual { background-color: rgba(6, 182, 212, 0.03); color: var(--text-primary); }

.summary-cell-status {
    font-weight: 800;
}

.summary-cell-status.status-met { color: var(--emerald) !important; background-color: rgba(16, 185, 129, 0.1) !important; }
.summary-cell-status.status-missed { color: var(--rose) !important; background-color: rgba(239, 68, 68, 0.1) !important; }

/* Drag & Drop Import zone on Web UI */
.excel-import-zone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px dashed var(--cyan);
    background-color: rgba(6, 182, 212, 0.03);
    color: var(--cyan);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.excel-import-zone:hover, .excel-import-zone.dragover {
    background-color: rgba(6, 182, 212, 0.08);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
    border-style: solid;
}

.excel-import-zone input[type="file"] {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.drop-icon {
    width: 16px;
    height: 16px;
}

/* Filter Bar Grid Page */
.filter-bar-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-bar-grid .filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-bar-grid .filter-item label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.status-legend {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legend-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
}

.legend-badge.status-c    { background-color: var(--color-present); color: white; }
.legend-badge.status-h    { background-color: var(--color-holiday); color: black; }
.legend-badge.status-l    { background-color: var(--color-leave); color: white; }
.legend-badge.status-sc   { background-color: var(--color-sick); color: white; }
.legend-badge.status-ho   { background-color: var(--color-half); color: white; }
.legend-badge.status-a    { background-color: var(--color-absent); color: white; }
.legend-badge.status-awol { background-color: #dc2626; color: white; border: 1px solid #ef4444; }

/* ─── View Header Left (title + hint) ───────────────────────────── */
.view-header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.edit-hint-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: linear-gradient(90deg, rgba(6,182,212,0.08), rgba(99,102,241,0.08));
    border: 1px solid rgba(6,182,212,0.2);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    animation: hintPulse 2s ease-in-out infinite alternate;
}

.edit-hint-bar code {
    background: rgba(6,182,212,0.2);
    border: 1px solid rgba(6,182,212,0.35);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    color: var(--cyan);
    font-weight: 700;
}

.edit-hint-icon {
    font-size: 16px;
}

@keyframes hintPulse {
    from { border-color: rgba(6,182,212,0.2); }
    to   { border-color: rgba(6,182,212,0.5); }
}

/* ─── Bulk Fill Bar ─────────────────────────────────────────────── */
.bulk-fill-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 5px 10px;
}

.bulk-fill-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-xs {
    font-size: 10px !important;
    padding: 3px 8px !important;
    height: auto !important;
    border-radius: 5px !important;
    font-weight: 700;
}

.btn-danger-outline {
    border-color: rgba(239,68,68,0.4) !important;
    color: #f87171 !important;
}

.btn-danger-outline:hover {
    background-color: rgba(239,68,68,0.1) !important;
    border-color: #ef4444 !important;
}

/* ─── Import / Export Collapsible ───────────────────────────────── */
.import-export-details {
    position: relative;
}

.import-export-details summary {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.import-export-details summary::-webkit-details-marker { display: none; }

.import-export-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: #0f172a;
    border: 1px solid rgba(6,182,212,0.25);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 500;
    animation: acDropIn 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ie-option-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: var(--transition-smooth);
}

.ie-option-btn:hover {
    background: rgba(6,182,212,0.1);
    border-color: rgba(6,182,212,0.3);
    color: var(--cyan);
}

.ie-option-btn i {
    width: 14px;
    height: 14px;
}

.import-export-dropdown .excel-import-zone {
    padding: 8px 12px;
    font-size: 11px;
    justify-content: flex-start;
}

/* Color Meanings List settings Page */
.color-meaning-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-meaning-list li {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-badge {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.color-badge.bg-orange { background-color: var(--color-present); }
.color-badge.bg-yellow { background-color: var(--color-holiday); }
.color-badge.bg-blue { background-color: var(--color-leave); }
.color-badge.bg-violet { background-color: var(--color-sick); }
.color-badge.bg-cyan { background-color: var(--color-half); }
.color-badge.bg-rose { background-color: var(--color-absent); }

.color-meaning-list .label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Modals Overlay and Wrapper */
.modal-wrapper {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(2, 6, 12, 0.8);
    backdrop-filter: blur(4px);
}

.modal-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    box-shadow: 0 24px 50px rgba(0,0,0,0.5);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    animation: scaleInModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.large-modal {
    max-width: 780px;
}

@keyframes scaleInModal {
    from { transform: scale(0.9) translateY(10px); }
    to { transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.btn-close:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.modal-form {
    padding: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="number"] {
    background-color: rgba(2, 6, 12, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
    border-color: var(--cyan);
}

.form-row {
    display: flex;
    gap: 16px;
}

.flex-1 { flex: 1; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Modal Import Preview bubbles */
.import-stats-summary {
    display: flex;
    justify-content: space-around;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-bubble .label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-bubble .val {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    margin-top: 4px;
}

.max-height-300 {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Bottom Sheet Modal for Mobile status picker */
.bottom-sheet-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 600;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bottom-sheet-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(2, 6, 12, 0.75);
    backdrop-filter: blur(2px);
}

.bottom-sheet-content {
    position: relative;
    z-index: 10;
    background-color: #0b0f19;
    border-top: 1px solid var(--border-color);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: slideUpSheet 0.3s cubic-bezier(0.32, 0.94, 0.6, 1);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}

@keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.bottom-sheet-header {
    padding: 16px 20px 8px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.drag-handle {
    width: 40px;
    height: 4px;
    background-color: var(--text-muted);
    border-radius: 2px;
    margin: 0 auto 12px auto;
}

.bottom-sheet-header h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
}

.operator-meta {
    font-size: 11px;
    color: var(--cyan);
    font-weight: 600;
}

.bottom-sheet-body {
    padding: 20px;
}

.sheet-section-title {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.status-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.status-opt-btn {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-body);
    transition: var(--transition-smooth);
}

.status-opt-btn:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: var(--text-secondary);
}

.status-opt-btn .circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 13px;
}

.status-opt-btn span {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
}

.status-opt-btn span small {
    font-size: 9px;
    color: var(--text-muted);
}

/* Machine Task Assignment list in Bottom Sheet */
.task-options-scroll {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.task-opt-btn {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
    transition: var(--transition-smooth);
}

.task-opt-btn:hover {
    background-color: rgba(6, 182, 212, 0.05);
    border-color: var(--cyan);
    color: var(--cyan);
}

.task-opt-btn.active {
    background-color: var(--color-present);
    border-color: var(--color-present);
    color: white;
}

.sheet-actions {
    display: flex;
    justify-content: center;
}

.sheet-actions .btn {
    width: 100%;
}

/* Cloud Settings form card */
.cloud-settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Toast alert notification styling */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #0f172a;
    border: 1px solid var(--cyan);
    border-radius: 8px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.15);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-smooth);
}

.toast-container.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    color: var(--cyan);
}

.toast-message {
    font-weight: 600;
    font-size: 13px;
}

.ml-2 { margin-left: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

/* Alert box */
.alert-box {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.alert-info {
    background-color: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.15);
    color: var(--text-secondary);
}

.alert-info i {
    color: var(--cyan);
    flex-shrink: 0;
}

/* Responsive Hide/Show elements based on screensize and RBAC */
.mobile-nav {
    display: none;
}

/* Desktop layout settings */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }
    
    .app-header {
        padding: 0 16px;
    }
    
    .header-right .header-info {
        display: none;
    }
    
    .content-area {
        padding: 16px;
        padding-bottom: 80px; /* Space for mobile nav */
        max-height: calc(100vh - var(--header-height));
    }
    
    /* Show mobile navigation bar */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 60px;
        background-color: rgba(15, 23, 42, 0.95);
        border-top: 1px solid var(--border-color);
        backdrop-filter: blur(12px);
        z-index: 150;
        justify-content: space-around;
        align-items: center;
        padding: 0 8px;
    }
    
    .mobile-nav-item {
        background: transparent;
        border: none;
        color: var(--text-secondary);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        cursor: pointer;
        padding: 6px 12px;
        border-radius: 8px;
        transition: var(--transition-smooth);
        flex: 1;
    }
    
    .mobile-nav-item i {
        width: 20px;
        height: 20px;
    }
    
    .mobile-nav-item span {
        font-size: 9px;
        font-family: var(--font-heading);
        font-weight: 600;
    }
    
    .mobile-nav-item.active {
        color: var(--cyan);
    }
    
    .mobile-nav-item.active i {
        filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.4));
    }
    
    /* Layout adjustments */
    .view-header {
        margin-bottom: 16px;
    }
    
    .view-header h2 {
        font-size: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px;
        gap: 10px;
    }
    
    .stat-icon-wrapper {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .stat-info h3 {
        font-size: 18px;
    }
    
    .slicers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .slicers-wrapper {
        padding: 12px;
    }
    
    .status-legend {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .slicers-grid {
        grid-template-columns: 1fr;
    }
}
