/* ============================================
   LINE PRODUCTIONS - Design System
   Premium Industrial Dark Theme
   ============================================ */

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

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    /* Color Palette - Industrial Premium */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-card-hover: #222838;
    --bg-glass: rgba(26, 31, 46, 0.85);
    --bg-sidebar: #0d1117;
    --bg-input: #151b2b;

    /* Accent Colors */
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.3);
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.15);
    --accent-purple: #8b5cf6;
    --accent-indigo: #6366f1;

    /* Status Colors */
    --status-excellent: #00e676;
    --status-excellent-bg: rgba(0, 230, 118, 0.1);
    --status-good: #ffd600;
    --status-good-bg: rgba(255, 214, 0, 0.1);
    --status-warning: #ff9800;
    --status-warning-bg: rgba(255, 152, 0, 0.1);
    --status-critical: #ff1744;
    --status-critical-bg: rgba(255, 23, 68, 0.1);

    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #3b82f6;

    /* Borders */
    --border-color: rgba(148, 163, 184, 0.1);
    --border-active: rgba(59, 130, 246, 0.5);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);
    --shadow-glow-cyan: 0 0 20px rgba(6, 182, 212, 0.15);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 65px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Base Reset & Typography
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Background Ambient Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-cyan);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* ============================================
   Layout System
   ============================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    padding-top: calc(var(--header-height) + 24px);
    transition: margin-left var(--transition-smooth);
    min-height: 100vh;
}



/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-smooth);
    overflow-y: auto;
    overflow-x: hidden;
    transform: none;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.sidebar-brand {
    padding: 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    min-height: var(--header-height);
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.sidebar-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand .brand-text h1 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand .brand-text small {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-blue);
    border-radius: 0 4px 4px 0;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* Mobile Sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    pointer-events: auto;
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }
}

/* ============================================
   Header
   ============================================ */
.app-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: left var(--transition-smooth);
}



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

.header-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.header-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
}



.header-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

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

.header-time {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-cyan);
    font-weight: 500;
}

.header-time i {
    font-size: 14px;
}

.shift-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-cyan);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: var(--text-primary);
}

.user-menu:hover {
    border-color: var(--border-active);
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

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

.user-info .name {
    font-size: 13px;
    font-weight: 600;
}

.user-info .role-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   Cards
   ============================================ */
.pp-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.pp-card:hover {
    border-color: rgba(59, 130, 246, 0.15);
    box-shadow: var(--shadow-glow-blue);
}

.pp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), var(--accent-cyan), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.pp-card:hover::before {
    opacity: 0.6;
}

.card-header-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-header-custom h3 {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.card-header-custom .card-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

/* ============================================
   Stats Cards (KPI)
   ============================================ */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 6px;
}

.stat-card.stat-blue .stat-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.stat-card.stat-blue .stat-value {
    color: var(--accent-blue);
}

.stat-card.stat-cyan .stat-icon {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

.stat-card.stat-cyan .stat-value {
    color: var(--accent-cyan);
}

.stat-card.stat-green .stat-icon {
    background: var(--status-excellent-bg);
    color: var(--status-excellent);
}

.stat-card.stat-green .stat-value {
    color: var(--status-excellent);
}

.stat-card.stat-orange .stat-icon {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

.stat-card.stat-orange .stat-value {
    color: var(--status-warning);
}

.stat-card.stat-red .stat-icon {
    background: var(--status-critical-bg);
    color: var(--status-critical);
}

.stat-card.stat-red .stat-value {
    color: var(--status-critical);
}

.stat-card.stat-purple .stat-icon {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.stat-card.stat-purple .stat-value {
    color: var(--accent-purple);
}

/* ============================================
   Tables
   ============================================ */
.pp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}

.pp-table thead th {
    background: rgba(59, 130, 246, 0.06);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

.pp-table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.pp-table thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.pp-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    transition: background var(--transition-fast);
}

.pp-table tbody tr:hover td {
    background: rgba(59, 130, 246, 0.04);
}

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

/* Score row colors */
.pp-table tbody tr.row-excellent td {
    background: var(--status-excellent-bg);
}

.pp-table tbody tr.row-good td {
    background: var(--status-good-bg);
}

.pp-table tbody tr.row-warning td {
    background: var(--status-warning-bg);
}

.pp-table tbody tr.row-critical td {
    background: var(--status-critical-bg);
}

/* ============================================
   Badges
   ============================================ */
.pp-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-excellent {
    background: var(--status-excellent-bg);
    color: var(--status-excellent);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.badge-good {
    background: var(--status-good-bg);
    color: var(--status-good);
    border: 1px solid rgba(255, 214, 0, 0.2);
}

.badge-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning);
    border: 1px solid rgba(255, 152, 0, 0.2);
}

.badge-critical {
    background: var(--status-critical-bg);
    color: var(--status-critical);
    border: 1px solid rgba(255, 23, 68, 0.2);
}

/* ============================================
   Buttons
   ============================================ */
.pp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.pp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pp-btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    color: white;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
}

.pp-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
    color: white;
}

.pp-btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.pp-btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
    color: white;
}

.pp-btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

.pp-btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
    color: white;
}

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

.pp-btn-outline:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

.pp-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.pp-btn-ghost:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-blue);
}

.pp-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.pp-btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.pp-btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.pp-btn-icon.sm {
    width: 32px;
    height: 32px;
}

/* ============================================
   Forms
   ============================================ */
.pp-form-group {
    margin-bottom: 20px;
}

.pp-form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pp-form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.pp-form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: var(--bg-secondary);
}

.pp-form-control::placeholder {
    color: var(--text-muted);
}

select.pp-form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.pp-form-control.form-control-lg {
    padding: 14px 18px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    font-family: var(--font-mono);
}

/* Number input special styling */
input[type="number"].pp-form-control {
    font-family: var(--font-mono);
    font-weight: 600;
}

/* ============================================
   Alerts / Flash Messages
   ============================================ */
.pp-alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.pp-alert-success {
    background: var(--status-excellent-bg);
    border: 1px solid rgba(0, 230, 118, 0.2);
    color: var(--status-excellent);
}

.pp-alert-danger {
    background: var(--status-critical-bg);
    border: 1px solid rgba(255, 23, 68, 0.2);
    color: var(--status-critical);
}

.pp-alert-warning {
    background: var(--status-warning-bg);
    border: 1px solid rgba(255, 152, 0, 0.2);
    color: var(--status-warning);
}

.pp-alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

/* ============================================
   Score Display (Large)
   ============================================ */
.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.score-value {
    font-size: 48px;
    font-weight: 900;
    font-family: var(--font-mono);
    letter-spacing: -0.04em;
    line-height: 1;
}

.score-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 8px;
    font-weight: 600;
}

.score-excellent {
    color: var(--status-excellent);
    text-shadow: 0 0 20px rgba(0, 230, 118, 0.3);
}

.score-good {
    color: var(--status-good);
    text-shadow: 0 0 20px rgba(255, 214, 0, 0.3);
}

.score-warning {
    color: var(--status-warning);
    text-shadow: 0 0 20px rgba(255, 152, 0, 0.3);
}

.score-critical {
    color: var(--status-critical);
    text-shadow: 0 0 20px rgba(255, 23, 68, 0.3);
}

/* ============================================
   Ranking List
   ============================================ */
.ranking-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.ranking-item:hover {
    border-color: rgba(59, 130, 246, 0.2);
    background: var(--bg-card-hover);
}

.ranking-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}

.ranking-number.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.ranking-number.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    color: #1a1a1a;
}

.ranking-number.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b8722d);
    color: white;
}

.ranking-number.rank-default {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.ranking-info {
    flex: 1;
}

.ranking-info .line-name {
    font-weight: 600;
    font-size: 14px;
}

.ranking-info .line-detail {
    font-size: 12px;
    color: var(--text-muted);
}

.ranking-score {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 800;
}

/* ============================================
   Quick Input Form (Hourly Log)
   ============================================ */
.quick-input-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--border-active);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-glow-blue);
}

.quick-input-card .input-header {
    text-align: center;
    margin-bottom: 32px;
}

.quick-input-card .input-header h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}

.quick-input-card .input-header p {
    color: var(--text-muted);
    font-size: 13px;
}

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

.quick-input-field {
    position: relative;
}

.quick-input-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.quick-input-field label i {
    font-size: 14px;
    color: var(--accent-cyan);
}

.quick-input-field .big-input {
    width: 100%;
    padding: 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    transition: all var(--transition-fast);
}

.quick-input-field .big-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.quick-input-field .big-input::placeholder {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 400;
}

/* ============================================
   Login Page
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan), var(--accent-purple));
}

.login-brand {
    text-align: center;
    margin-bottom: 36px;
}

.login-brand .brand-icon-lg {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin-bottom: 16px;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
}

.login-brand h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ============================================
   Page Headers
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.page-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h4 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
}

/* ============================================
   Modal Style Override
   ============================================ */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 16px;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

/* ============================================
   Animations
   ============================================ */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slide-down {
    animation: slideDown 0.3s ease forwards;
}

/* Live indicator pulse */
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-excellent);
    display: inline-block;
    animation: pulse 2s infinite;
    margin-right: 6px;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-mono {
    font-family: var(--font-mono);
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-excellent {
    color: var(--status-excellent) !important;
}

.text-good {
    color: var(--status-good) !important;
}

.text-warning {
    color: var(--status-warning) !important;
}

.text-critical {
    color: var(--status-critical) !important;
}

.text-cyan {
    color: var(--accent-cyan) !important;
}

.text-blue {
    color: var(--accent-blue) !important;
}

.fw-800 {
    font-weight: 800;
}

.fs-sm {
    font-size: 12px;
}

/* ============================================
   Responsive - Tablet (≤991px)
   ============================================ */
@media (max-width: 991px) {
    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: calc(var(--header-height) + 20px);
    }

    .app-header {
        left: 0;
        padding: 0 16px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .header-toggle {
        display: flex;
    }
}

/* ============================================
   Responsive - Mobile (≤767px)
   ============================================ */
@media (max-width: 767px) {
    :root {
        --header-height: 56px;
    }

    .main-content {
        padding: 12px;
        padding-top: calc(var(--header-height) + 12px);
    }

    /* === Header Mobile === */
    .app-header {
        padding: 0 12px;
        gap: 8px;
    }

    .header-left {
        gap: 10px;
        min-width: 0;
        flex: 1;
    }

    .header-title {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-subtitle {
        font-size: 10px;
    }

    .header-toggle {
        width: 36px;
        height: 36px;
        font-size: 18px;
        flex-shrink: 0;
        background: var(--bg-card);
        border: 1px solid var(--border-active);
        color: var(--accent-cyan);
    }

    .header-right {
        gap: 8px;
        flex-shrink: 0;
    }

    .header-time,
    .shift-badge {
        display: none !important;
    }

    .user-info {
        display: none;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .user-menu {
        padding: 4px;
        border: none;
        background: transparent;
    }

    /* === Page Header Mobile === */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }

    .page-header h2 {
        font-size: 18px;
    }

    .page-header p {
        font-size: 12px;
    }

    .page-header .pp-btn {
        width: 100%;
        justify-content: center;
    }

    /* === Cards Mobile === */
    .pp-card {
        padding: 14px;
        border-radius: var(--radius-md);
    }

    .card-header-custom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 14px;
    }

    .card-header-custom h3 {
        font-size: 14px;
    }

    /* === Stat Cards Mobile === */
    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-bottom: 12px;
    }

    .stat-card .stat-value {
        font-size: 22px;
    }

    .stat-card .stat-label {
        font-size: 11px;
    }

    /* === Tables Mobile - Card Style === */
    .table-responsive {
        margin: 0 -14px;
        padding: 0 14px;
    }

    .pp-table {
        font-size: 12px;
    }

    .pp-table thead th {
        font-size: 10px;
        padding: 8px 10px;
        letter-spacing: 0.04em;
    }

    .pp-table tbody td {
        padding: 10px;
        font-size: 12px;
    }

    /* Mobile card-style table */
    .pp-table-mobile thead {
        display: none;
    }

    .pp-table-mobile tbody tr {
        display: block;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 12px;
        margin-bottom: 8px;
    }

    .pp-table-mobile tbody tr:hover td {
        background: transparent;
    }

    .pp-table-mobile tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.06) !important;
    }

    .pp-table-mobile tbody td:last-child {
        border-bottom: none !important;
    }

    .pp-table-mobile tbody td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        flex-shrink: 0;
        margin-right: 12px;
    }

    /* === Quick Input Form Mobile === */
    .quick-input-card {
        padding: 16px;
        border-radius: var(--radius-lg);
    }

    .quick-input-card .input-header {
        margin-bottom: 20px;
    }

    .quick-input-card .input-header h2 {
        font-size: 18px;
    }

    .quick-input-card .input-header p {
        font-size: 12px;
    }

    .quick-input-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .quick-input-field .big-input {
        font-size: 20px;
        padding: 14px;
    }

    .quick-input-field label {
        font-size: 10.5px;
    }

    /* === Ranking Mobile === */
    .ranking-item {
        padding: 12px;
        gap: 12px;
    }

    .ranking-number {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .ranking-info .line-name {
        font-size: 13px;
    }

    .ranking-info .line-detail {
        font-size: 11px;
    }

    .ranking-score {
        font-size: 17px;
    }

    /* === Score Display Mobile === */
    .score-value {
        font-size: 36px;
    }

    #scorePreview .score-value {
        font-size: 36px !important;
    }

    /* === Buttons Mobile === */
    .pp-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .pp-btn-lg {
        padding: 14px 20px;
        font-size: 14px;
    }

    .pp-btn-icon {
        min-width: 38px;
        min-height: 38px;
    }

    /* === Badges Mobile === */
    .pp-badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    /* === Charts Mobile === */
    .chart-container,
    [style*="height: 300px"] {
        height: 220px !important;
    }

    /* === Modals Mobile === */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-content {
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
    }

    .modal-footer .pp-btn {
        width: 100%;
    }

    /* === Alerts Mobile === */
    .pp-alert {
        padding: 10px 14px;
        font-size: 12.5px;
        gap: 8px;
        border-radius: var(--radius-sm);
    }

    /* === Login Mobile === */
    .login-card {
        padding: 24px;
        border-radius: var(--radius-lg);
    }

    .login-brand .brand-icon-lg {
        width: 52px;
        height: 52px;
        font-size: 24px;
    }

    .login-brand h1 {
        font-size: 20px;
    }

    /* === Filter/Form Rows Mobile === */
    .row.g-3>[class*="col-"] {
        margin-bottom: 0;
    }

    /* === Utility === */
    .d-mobile-none {
        display: none !important;
    }

    .d-mobile-block {
        display: block !important;
    }

    .w-mobile-100 {
        width: 100% !important;
    }

    /* === Empty State Mobile === */
    .empty-state {
        padding: 40px 16px;
    }

    .empty-state i {
        font-size: 36px;
    }

    .empty-state h4 {
        font-size: 15px;
    }

    .empty-state p {
        font-size: 12px;
    }
}

/* ============================================
   Responsive - Small Mobile (≤480px)
   ============================================ */
@media (max-width: 480px) {
    .main-content {
        padding: 8px;
        padding-top: calc(var(--header-height) + 8px);
    }

    .pp-card {
        padding: 12px;
        border-radius: var(--radius-sm);
    }

    .stat-card .stat-value {
        font-size: 20px;
    }

    .stat-card .stat-label {
        font-size: 10px;
    }

    .quick-input-field .big-input {
        font-size: 18px;
        padding: 12px;
    }

    .page-header h2 {
        font-size: 16px;
    }

    .ranking-item {
        padding: 10px;
    }

    .ranking-score {
        font-size: 15px;
    }

    .pp-table tbody td {
        padding: 8px;
        font-size: 11.5px;
    }

    .pp-table thead th {
        padding: 6px 8px;
        font-size: 9.5px;
    }
}

/* ============================================
   Touch Optimization
   ============================================ */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .nav-item {
        padding: 12px 14px;
        min-height: 44px;
    }

    .pp-btn {
        min-height: 44px;
    }

    .pp-btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    .pp-btn-icon.sm {
        min-width: 38px;
        min-height: 38px;
    }

    .pp-form-control {
        min-height: 44px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    select.pp-form-control {
        font-size: 16px;
    }

    .form-check-input {
        width: 20px;
        height: 20px;
    }

    /* Remove hover effects on touch */
    .pp-card:hover {
        transform: none;
        box-shadow: none;
    }

    .stat-card:hover {
        transform: none;
    }

    .pp-btn-primary:hover,
    .pp-btn-success:hover,
    .pp-btn-danger:hover {
        transform: none;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {

    .sidebar,
    .sidebar-overlay,
    .app-header,
    .header-toggle {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
        padding-top: 0;
    }

    body {
        background: white;
        color: #1a1a1a;
    }

    .pp-card {
        border: 1px solid #ddd;
        box-shadow: none;
        break-inside: avoid;
    }
}