/* ==========================================================================
   SIPERKA - Sistem Inspeksi Perangkat Kereta Api
   PT Kereta Api Indonesia (Persero)
   Modern Executive Glassmorphism & High-Precision UI Styling
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    
    --border-glass: #e2e8f0;
    --border-glass-bright: #cbd5e1;
    
    /* Brand Colors (KAI Signature Theme: Electric Sky & KAI Corporate Orange) */
    --brand-blue: #025091; 
    --brand-blue-hover: #0369a1;
    --brand-sky: #0284c7; 
    --brand-orange: #f28c28;
    --brand-orange-hover: #ea580c;
    
    /* Status Colors */
    --accent-emerald: #16a34a; 
    --accent-emerald-subtle: #dcfce7;
    --accent-purple: #8b5cf6;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --danger-red: #ef4444;
    --accent-rose-subtle: #ffe4e6;

    /* Text Colors */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    min-height: 100vh;
    background: var(--bg-primary);
    color: var(--text-main);
    overflow-x: auto;
    position: relative;
}

/* Typography Headings & Numbers */
h1, h2, h3, h4, .stat-value, .brand-title, .dial-number {
    font-family: 'Outfit', sans-serif;
}

/* ==========================================================================
   Ambient Glowing Background
   ========================================================================== */
.ambient-light {
    display: none;
}

.ambient-1 {
    width: 500px;
    height: 500px;
    background: rgba(2, 132, 199, 0.2);
    top: -150px;
    left: -120px;
}

.ambient-2 {
    width: 450px;
    height: 450px;
    background: rgba(249, 115, 22, 0.15);
    bottom: -100px;
    right: -80px;
    animation-delay: -7s;
}

.ambient-3 {
    width: 380px;
    height: 380px;
    background: rgba(139, 92, 246, 0.12);
    top: 40%;
    left: 40%;
    transform: translate(-50%, -50%);
    animation-delay: -3.5s;
}

@keyframes floatAmbient {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(30px, 20px) scale(1.05) rotate(8deg); }
    100% { transform: translate(-20px, 40px) scale(0.95) rotate(-8deg); }
}

/* ==========================================================================
   App Layout & Sidebar
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 290px;
    background: #ffffff url('images/Desain_Menu.png') no-repeat center center / 100% 100%;
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 8px 20px 8px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 20px;
}

.brand-logo-full {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.nav-section-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-blue);
    padding: 0 10px 10px 10px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px; /* Give space for scrollbar */
}

/* Custom scrollbar for sidebar nav */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(15, 48, 87, 0.2);
    border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 48, 87, 0.4);
}

.nav-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--brand-blue);
    width: 100%;
    color: var(--brand-blue);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
    text-align: left;
}

.nav-icon-box {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #ffffff;
    transition: var(--transition-fast);
}

.nav-item:hover {
    background: var(--bg-surface-hover);
    transform: translateX(3px);
}

.nav-item.active {
    background: var(--brand-blue);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.nav-item.active .nav-icon-box {
    background: #ffffff;
    color: var(--brand-blue);
}

.nav-active-pill {
    display: none;
}

.sub-nav {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-left: 20px;
    margin-top: 8px;
    border-left: 2px solid var(--border-glass-bright);
    padding-left: 14px;
}

.sub-nav.expanded {
    display: flex;
}

.submenu-indicator {
    transition: transform var(--transition-fast);
}

.nav-group.expanded .submenu-indicator {
    transform: rotate(180deg);
}

.sub-item {
    padding: 8px 12px;
    font-size: 13px;
    background: #ffffff;
    border: 1px solid var(--brand-blue);
    border-radius: var(--radius-md);
}

.sub-item .nav-icon-box {
    width: 28px;
    height: 28px;
    font-size: 14px;
    background: var(--brand-blue);
    color: #ffffff;
}

.sub-item.active {
    background: var(--brand-blue);
    color: #ffffff;
}

/* Sidebar Info Card */
.sidebar-extra-info {
    margin-bottom: 16px;
}

.kai-badge {
    background: var(--brand-orange);
    border: 1px solid var(--brand-orange-hover);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-kai {
    font-size: 20px;
    color: #ffffff;
}

.kai-badge strong {
    display: block;
    font-size: 12px;
    color: #ffffff;
}

.kai-badge span {
    font-size: 11px;
    color: #ffffff;
    opacity: 0.9;
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 14px;
    border-top: 1px solid var(--border-glass);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1e293b;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-sky));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 15px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.user-status {
    font-size: 11px;
    color: var(--accent-emerald);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

/* ==========================================================================
   Main Content & Top Header
   ========================================================================== */
.main-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    background: #ffffff;
}

.top-header {
    border-bottom: 1px solid var(--border-glass);
}

#views-container {
    padding: 24px 40px;
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
}

.system-status-chip {
    color: var(--brand-blue);
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 2px;
}

.pulse-dot {
    display: none;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

.header-welcome h1 {
    font-size: 48px;
    font-weight: 900;
    color: var(--brand-orange);
    margin-bottom: 4px;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.9), -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
    letter-spacing: -1px;
}

.header-date {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-blue);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    outline: none;
    text-decoration: none;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-blue), #1d4ed8);
    color: white;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.55);
    background: linear-gradient(135deg, #0369a1, #1e40af);
}

.btn-emerald {
    background: linear-gradient(135deg, #10b981, #047857);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-emerald:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--border-glass-bright);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* Solid Cards */
.glass-card {
    background: #ffffff;
    border: 2px solid var(--border-glass-bright);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--brand-blue);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Page Views */
.view-page {
    display: none;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    padding: 24px 10px 40px 10px;
}

.view-page.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title-box {
    margin-bottom: 24px;
}

.page-title-box h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.page-title-box p {
    color: var(--text-muted);
    font-size: 14px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   VIEW 1: Dashboard Elements
   ========================================================================== */
.dashboard-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 2px solid var(--brand-orange);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.banner-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-orange);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.banner-content h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--brand-blue);
}

.banner-content p {
    color: var(--text-main);
    font-size: 14px;
    max-width: 680px;
    line-height: 1.5;
}

.banner-stat-dial {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dial-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--accent-emerald);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dial-number {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
}

.dial-label {
    font-size: 11px;
    color: #ffffff;
    font-weight: 600;
}

/* Metric Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.bg-blue { background: var(--brand-blue); }
.bg-emerald { background: var(--accent-emerald); }
.bg-orange { background: var(--brand-orange); }

.card-blue { border: 2px solid var(--brand-blue); color: var(--brand-blue); }
.card-emerald { border: 2px solid var(--accent-emerald); color: var(--accent-emerald); }
.card-orange { border: 2px solid var(--brand-orange); color: var(--brand-orange); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    font-weight: 700;
}

.stat-value {
    font-size: 36px;
    font-weight: 900;
    line-height: 1.2;
    margin: 2px 0;
}

.stat-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.bg-blue-subtle { background: #e0f2fe; color: var(--brand-blue); border: 1px solid var(--brand-blue); }
.bg-emerald-subtle { background: #dcfce7; color: var(--accent-emerald); border: 1px solid var(--accent-emerald); }
.bg-orange-subtle { background: #ffedd5; color: var(--brand-orange); border: 1px solid var(--brand-orange); }

/* Dashboard Widgets */
.dashboard-widgets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}



.widget-card {
    display: flex;
    flex-direction: column;
}

.card-orange-fill {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: #ffffff;
}

.card-orange-fill h3, .card-orange-fill p, .card-orange-fill .drop-zone p {
    color: #ffffff;
}

.card-orange-fill .icon-accent {
    color: #ffffff;
}

.card-orange-fill .badge-accent {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255,255,255,0.4);
}

.card-orange-fill .drop-zone {
    border-color: rgba(255,255,255,0.4);
    background: transparent;
}

.card-orange-fill .drop-icon-animated {
    color: #ffffff;
}

.card-orange-fill .btn-secondary {
    background: #fdf5e6;
    color: var(--brand-orange);
    border: none;
}

.card-blue-widget {
    border-color: var(--brand-blue);
}

.card-blue-widget .widget-header h3 {
    color: var(--brand-blue);
}

.card-blue-widget .badge {
    background: #e0f2fe;
    color: var(--brand-blue);
    border-color: var(--brand-blue);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-glass);
}

.widget-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-accent {
    color: var(--brand-sky);
}

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-subtle);
    border: 1px solid var(--border-glass);
}

.badge-accent {
    background: rgba(2, 132, 199, 0.2);
    color: var(--brand-sky);
    border-color: rgba(56, 189, 248, 0.3);
}

/* Dropzone Styling */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.drop-zone:hover, .drop-zone.dragover {
    background: rgba(56, 189, 248, 0.08);
    border-color: var(--brand-sky);
    transform: translateY(-2px);
}

.drop-icon-animated {
    font-size: 44px;
    color: var(--brand-sky);
    animation: bounce 2.2s infinite ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.drop-zone h3 {
    font-size: 16px;
    font-weight: 700;
}

.drop-zone p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Progress bars list */
.device-status-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.device-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.device-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-blue);
}

.device-meta i {
    width: 20px;
    color: var(--brand-sky);
}

.progress-bar-bg {
    height: 16px;
    background: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 20px;
    transition: width 1s ease-out;
}

/* ==========================================================================
   VIEW 2: DATASET TABLE
   ========================================================================== */
.table-wrapper {
    padding: 0;
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-glass);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    width: 320px;
    color: var(--text-muted);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 14px;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.table-info {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px 24px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border-glass);
}

.custom-table td {
    padding: 18px 24px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: var(--transition-fast);
}

.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.train-no-badge {
    background: rgba(56, 189, 248, 0.15);
    color: var(--brand-sky);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    white-space: nowrap;
    display: inline-block;
}

.action-btns {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-subtle);
    cursor: pointer;
    transition: var(--transition-fast);
}

.action-btn:hover {
    transform: translateY(-2px);
    color: white;
}

.action-btn.edit:hover { background: var(--brand-blue); border-color: var(--brand-blue); }
.action-btn.print:hover { background: var(--accent-emerald); border-color: var(--accent-emerald); }
.action-btn.view:hover { background: var(--accent-purple); border-color: var(--accent-purple); }
.action-btn.delete:hover { background: var(--accent-rose); border-color: var(--accent-rose); }

/* ==========================================================================
   VIEW 3: HASIL PEMERIKSAAN CARDS GRID
   ========================================================================== */
.filter-pills {
    display: flex;
    gap: 8px;
}

.filter-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.filter-pill.active {
    background: var(--brand-blue);
    color: #fff;
    border-color: var(--brand-blue);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.hasil-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.hasil-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.hasil-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 120px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-glass);
}

.train-title-tag {
    display: flex;
    align-items: center;
    gap: 10px;
}

.train-title-tag h3 {
    font-size: 18px;
    font-weight: 800;
    min-height: 44px;
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

.device-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.metric-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 10px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-pill-label {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.metric-pill-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--brand-sky);
}

.metric-pill-value.has-issue {
    color: var(--accent-rose);
}

.hasil-card-footer {
    display: flex;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border-glass);
}

.hasil-card-footer .btn {
    flex: 1;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(8, 14, 30, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass-bright);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-wide {
    max-width: 820px;
}

.pdf-modal-wide {
    max-width: 1000px;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes scaleIn {
    from { transform: scale(0.94); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btns {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 26px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: white;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-glass);
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-subtle);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-control {
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--brand-sky);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.modal-drop-zone {
    padding: 24px 16px;
    border-width: 2px;
}

.drop-icon {
    font-size: 32px;
    color: var(--brand-sky);
}

.file-badge-info {
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Edit Modal */
.device-edit-section h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--brand-sky);
    font-weight: 700;
}

.device-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.device-edit-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px;
}

.device-edit-card h5 {
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 700;
}

/* PDF Viewer */
.pdf-body-frame {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 520px;
    background: #1e2538;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.pdf-canvas-container {
    width: 100%;
    height: 100%;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 24px 16px;
    background: #182032;
    border-radius: var(--radius-md);
}

.pdf-page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #0f172a;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-glass-bright);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    max-width: 100%;
}

.pdf-page-canvas {
    max-width: 100%;
    height: auto !important;
    border-radius: 4px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.pdf-page-num {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.pdf-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.pdf-fallback-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 50px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-glass-bright);
}

.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius-md);
    background: white;
}

/* Preview Modal Gerbong Accordion/Table */
.gerbong-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.gerbong-preview-table th {
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

.gerbong-preview-table td {
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.item-status-pill {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.status-baik { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.status-rusak { background: rgba(244, 63, 94, 0.18); color: #fb7185; }

/* ==========================================================================
   TOAST & LOADING
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    background: rgba(13, 23, 46, 0.95);
    border: 1px solid var(--border-glass-bright);
    backdrop-filter: blur(16px);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-success { border-left: 4px solid var(--accent-emerald); }
.toast-success i { color: var(--accent-emerald); }

.toast-error { border-left: 4px solid var(--accent-rose); }
.toast-error i { color: var(--accent-rose); }

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(8, 14, 30, 0.88);
    backdrop-filter: blur(12px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--brand-sky);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-subtle);
}


/* ==========================================================================
   Taman Kereta - Import View
   ========================================================================== */

/* Step Bar */
.tk-steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 24px;
    margin-bottom: 32px;
    padding: 20px 30px;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
}

.tk-step {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.4;
    transition: opacity var(--transition-fast);
}

.tk-step.active {
    opacity: 1;
}

.tk-step.active .tk-step-num {
    background: var(--brand-blue);
    color: #fff;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.4);
}

.tk-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.tk-step span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-subtle);
    white-space: nowrap;
}

.tk-step.active span {
    color: var(--text-main);
}

.tk-step-line {
    width: 80px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 24px;
    flex-shrink: 0;
}

/* Upload Card */
.tk-upload-area {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 40px 0;
}

.tk-upload-card {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px 36px 36px;
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.tk-upload-card:hover,
.tk-upload-card.dragover {
    border-color: var(--brand-sky);
    background: rgba(56, 189, 248, 0.04);
}

.tk-upload-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--brand-blue) 0%, #0ea5e9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.3);
}

.tk-upload-text h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.tk-upload-text p {
    font-size: 13px;
    color: var(--text-muted);
}

.tk-upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 4px;
}

.tk-upload-hint i {
    margin-right: 4px;
}

/* Result Header */
.tk-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
}

.tk-result-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.tk-result-header h3 i {
    color: var(--brand-sky);
    margin-right: 8px;
}

.tk-result-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

/* Rangkaian Cards Grid */
.tk-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
}

/* Rangkaian Card */
.tk-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.tk-card:hover {
    border-color: var(--border-glass-bright);
    transform: translateY(-2px);
}

.tk-card-head {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-glass);
}

.tk-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(56, 189, 248, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--brand-sky);
    flex-shrink: 0;
}

.tk-card-title {
    flex: 1;
    min-width: 0;
}

.tk-card-title h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tk-card-title small {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.tk-card-body {
    padding: 16px 20px;
}

.tk-field-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.tk-nama-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast);
}

.tk-nama-input:focus {
    border-color: var(--brand-sky);
}

.tk-ka-select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.tk-ka-select option {
    background: #1e293b;
    color: #f8fafc;
}

.tk-gerbong-list {
    margin-top: 14px;
}

.tk-gerbong-list-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tk-gerbong-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-subtle);
    font-family: 'Outfit', monospace;
    font-weight: 500;
}

.tk-gerbong-chip .chip-num {
    color: var(--brand-sky);
    font-weight: 700;
    font-size: 10px;
    min-width: 14px;
}

.tk-gerbong-more {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.tk-card-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--border-glass);
}

/* WORD-STYLE PRINT MODAL */
.word-print-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #111111;
    z-index: 99999;
    display: none; /* Hidden by default */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.word-print-overlay.active {
    display: block;
}

.word-print-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.word-print-sidebar {
    width: 320px;
    background: #1c1c1c;
    color: #ffffff;
    border-right: 1px solid #333333;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.word-back-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.word-print-title {
    font-size: 24px;
    font-weight: 300;
    margin: 0;
}

.print-action-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.big-print-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: background 0.2s;
}

.big-print-btn i {
    font-size: 24px;
    margin-bottom: 8px;
}

.big-print-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #666;
}

.copies-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.copies-input {
    width: 60px;
    background: #2d2d2d;
    border: 1px solid #444;
    color: #fff;
    padding: 6px;
    border-radius: 4px;
    outline: none;
}

.print-settings-group {
    margin-bottom: 24px;
}

.print-settings-group > label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #e0e0e0;
}

.mock-dropdown {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: 1px solid #444;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 8px;
}

.mock-dropdown:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mock-dropdown i:first-child {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.mock-dropdown-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mock-dropdown-text strong {
    font-size: 13px;
    font-weight: 500;
}

.mock-dropdown-text span {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

.chevron-icon {
    font-size: 12px;
    color: #888;
}

.text-green {
    color: #4caf50;
}

.printer-props-link {
    font-size: 12px;
    color: #4da6ff;
    text-decoration: none;
    margin-left: 32px;
    display: inline-block;
}

.printer-props-link:hover {
    text-decoration: underline;
}

/* Right Preview Area */
.word-print-preview-area {
    flex: 1;
    background: #2a2a2a;
    display: flex;
    flex-direction: column;
}

.preview-scroll-container {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.word-pdf-canvas-container {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 600px;
    min-height: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.word-pdf-canvas-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.preview-footer {
    height: 48px;
    background: #1c1c1c;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    color: #e0e0e0;
    font-size: 13px;
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-box {
    border: 1px solid #444;
    padding: 2px 8px;
    border-radius: 2px;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.word-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.word-print-title {
    font-size: 24px;
    font-weight: 300;
    margin: 0;
}

.print-action-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.big-print-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: background 0.2s;
}

.big-print-btn i {
    font-size: 24px;
    margin-bottom: 8px;
}

.big-print-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #666;
}

.copies-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.copies-input {
    width: 60px;
    background: #2d2d2d;
    border: 1px solid #444;
    color: #fff;
    padding: 6px;
    border-radius: 4px;
    outline: none;
}

.print-settings-group {
    margin-bottom: 24px;
}

.print-settings-group > label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #e0e0e0;
}

.mock-dropdown {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: 1px solid #444;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 8px;
}

.mock-dropdown:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mock-dropdown i:first-child {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.mock-dropdown-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mock-dropdown-text strong {
    font-size: 13px;
    font-weight: 500;
}

.mock-dropdown-text span {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

.chevron-icon {
    font-size: 12px;
    color: #888;
}

.text-green {
    color: #4caf50;
}

.printer-props-link {
    font-size: 12px;
    color: #4da6ff;
    text-decoration: none;
    margin-left: 32px;
    display: inline-block;
}

.printer-props-link:hover {
    text-decoration: underline;
}

/* Right Preview Area */
.word-print-preview-area {
    flex: 1;
    background: #2a2a2a;
    display: flex;
    flex-direction: column;
}

.preview-scroll-container {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.word-pdf-canvas-container {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 600px;
    min-height: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.word-pdf-canvas-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.preview-footer {
    height: 48px;
    background: #1c1c1c;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    color: #e0e0e0;
    font-size: 13px;
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-box {
    border: 1px solid #444;
    padding: 2px 8px;
    border-radius: 2px;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zoom-controls input[type="range"] {
    width: 100px;
    accent-color: #666;
}

/* Flexscreen Utility */
.flex-screen {
    display: flex;
    width: 100vw;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Jadwal Penugasan Widget (Dashboard) */
.jadwal-widget-card {
    background-color: #ffffff;
    border: 3px solid #0f3057; /* Dark blue border */
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: #333333;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
}
.jadwal-widget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.jadwal-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 2px solid #0f3057;
    padding-bottom: 10px;
}
.jadwal-widget-header h3 {
    margin: 0;
    color: #0f3057;
    font-size: 1.25rem;
    font-weight: 700;
}
.jadwal-widget-badge {
    background-color: #bbf7d0;
    color: #166534;
    border: 1px solid #22c55e;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}
.jadwal-widget-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.jadwal-widget-table th {
    text-align: left;
    padding: 10px 0;
    border-bottom: 2px solid #94a3b8;
    color: #475569;
    font-weight: 700;
}
.jadwal-widget-table td {
    padding: 12px 0;
    color: #334155;
    vertical-align: top;
    border-bottom: 1px solid #e2e8f0;
}
.jadwal-widget-table tr:last-child td {
    border-bottom: none;
}
.jadwal-badge-menunggu {
    background-color: #f59e0b;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}
.jadwal-badge-selesai {
    background-color: #16a34a;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

/* ==========================================================================
   AUTH FULL SCREEN SPLIT (LOGIN / REGISTER)
   ========================================================================== */
.auth-full-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff; /* fallback */
    background-image: 
        url('images/Desain_Login.png'),
        linear-gradient(to bottom, #7b9ec3 0%, #e0b484 100%);
    background-position: 
        center bottom,
        center top;
    background-repeat: 
        no-repeat,
        no-repeat;
    background-size: 
        100% 100%,
        cover; /* Gradient covers the entire screen */
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-content-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 550px;
    padding: 20px;
    text-align: center;
}

.auth-text {
    margin-bottom: 24px;
}

.auth-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: #f48c27; /* Swapped to Orange */
    line-height: 1.2;
    margin-bottom: 12px;
    font-family: 'Outfit', sans-serif;
    text-shadow: 2px 2px 0px #ffffff, -1px -1px 0px #ffffff, 1px -1px 0px #ffffff, -1px 1px 0px #ffffff, 1px 1px 0px #ffffff; /* White stroke effect */
}

.auth-subtitle {
    font-size: 1.1rem;
    color: #ffffff; /* Swapped to White */
    font-weight: 600;
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3); /* Soft dark shadow for better readability on blue background */
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.4);
}

.auth-empty-right {
    display: none;
}

.auth-logo-header {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.auth-logo-img {
    height: 60px;
    object-fit: contain;
}

.auth-tabs-custom {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.auth-tab-btn-custom {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s ease;
}

.form-group-custom {
    margin-bottom: 16px;
    text-align: left;
}

.form-group-custom label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #637c95; /* Label color matches title color */
    margin-bottom: 8px;
}

.form-control-custom {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: #f1f5f9;
    color: #1e293b;
    transition: all 0.3s ease;
}

.form-control-custom:focus {
    outline: none;
    border-color: #0e52b2;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(14, 82, 178, 0.1);
}

.auth-forgot-password {
    text-align: right;
    margin-bottom: 20px;
}

.auth-forgot-password a {
    color: #0e52b2;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-forgot-password a:hover {
    text-decoration: underline;
}

.btn-login-custom {
    width: 100%;
    padding: 14px;
    background-color: #0e52b2; /* KAI deep blue */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login-custom:hover {
    background-color: #0b3d87;
}

.btn-register-custom {
    width: 100%;
    padding: 14px;
    background-color: #28a745; /* Bright green */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-register-custom:hover {
    background-color: #218838;
}

/* ==========================================================================
   DATABASE MANAGEMENT REDESIGN
   ========================================================================== */

.db-stats-header {
    background: linear-gradient(145deg, rgba(15, 48, 87, 0.4) 0%, rgba(2, 132, 199, 0.1) 100%);
    border: 1px solid rgba(56, 189, 248, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.db-table-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.db-table-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-main);
    font-weight: 600;
}

.db-table-item i {
    color: var(--brand-sky);
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.db-table-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.db-table-item.active {
    background: rgba(2, 132, 199, 0.2);
    border-color: var(--brand-sky);
    box-shadow: inset 4px 0 0 var(--brand-sky);
}

.db-table-item .row-count {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

.db-table-item.active .row-count {
    color: var(--brand-sky);
    background: rgba(2, 132, 199, 0.1);
}

.inline-edit-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--brand-sky);
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
}

.inline-edit-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3);
}

.btn-inline-save {
    background: #16a34a;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-inline-cancel {
    background: #dc2626;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

/* ==========================================================================
   Responsive Design & Mobile Layout
   ========================================================================== */

/* ==========================================================================
   Dashboard Grids (Desktop Base)
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-widgets-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
}

.profil-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    margin-top: 24px;
}

.db-manager-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

/* ===== MOBILE OVERRIDE ===== */

/* Overlay Styling */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Base Mobile Overrides */
@media (min-width: 1025px) {
    #mobileMenuBtn {
        display: none !important;
    }
    .sidebar-overlay {
        display: none !important;
    }
}

/* Tablet & Mobile (up to 1024px) */
@media (max-width: 1024px) {
    .app-layout {
        position: relative;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        width: 280px;
        max-width: 80%;
        z-index: 1001;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }

    #mobileMenuBtn {
        display: block !important;
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
        z-index: 1002;
        position: relative;
    }

    .dashboard-grid, .dashboard-widgets-grid {
        display: flex !important;
        flex-direction: column !important;
    }

    .dashboard-grid > div, .dashboard-widgets-grid > div {
        width: 100%;
    }

    .top-header {
        background-size: cover !important;
        padding: 16px 20px !important;
        min-height: auto !important;
    }

    .top-header h1 {
        font-size: 2.5rem !important;
        text-shadow: 2px 2px 4px rgba(255,255,255,0.8);
    }

    .modal-content {
        width: 94% !important;
        margin: 20px auto;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
        margin-bottom: 8px;
    }

    .header-btns {
        flex-wrap: wrap;
        gap: 8px;
    }

    .db-manager-layout {
        grid-template-columns: 1fr !important;
    }
    
    .db-sidebar {
        width: 100% !important;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
    }

    .profil-container {
        grid-template-columns: 1fr !important;
    }

    /* PDF Viewer - fit to mobile screen */
    .pdf-modal-wide {
        width: 96% !important;
        max-width: 100% !important;
        margin: 10px auto !important;
    }

    .pdf-canvas-container {
        max-height: 60vh;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pdf-canvas-container canvas {
        width: 100% !important;
        height: auto !important;
    }

    .word-pdf-canvas-container {
        min-width: unset !important;
        width: 100% !important;
    }

    .word-pdf-canvas-container canvas {
        width: 100% !important;
        height: auto !important;
    }

    /* Word Print modal sidebar stack */
    .word-print-body {
        flex-direction: column !important;
    }

    .word-print-sidebar {
        width: 100% !important;
        max-height: 200px;
        overflow-y: auto;
    }
}

/* Mobile Portrait (up to 768px) */
@media (max-width: 768px) {
    .top-header h1 {
        font-size: 1.8rem !important;
    }

    .hasil-cards-grid {
        display: flex;
        flex-direction: column;
    }

    .hasil-card {
        width: 100%;
    }

    .table-container, .table-responsive, .table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table.custom-table, table.data-table, table.jadwal-widget-table {
        min-width: 650px;
    }

    .auth-title {
        font-size: 2.2rem !important;
        white-space: normal !important;
    }
    
    .auth-card {
        width: 100% !important;
        padding: 24px !important;
        margin: 0 !important;
        box-sizing: border-box;
    }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: auto;
        align-items: stretch;
    }
}

.jadwal-badge-telat { background-color: #fee2e2; color: #b91c1c; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; display: inline-block; white-space: nowrap; border: 1px solid #fca5a5; }
