/* ============================================
   ANKT MONITORING SYSTEM - GLOBAL STYLES
   ============================================ */

:root {
    --primary: #0f766e;
    --primary-light: #14b8a6;
    --primary-dark: #064e3b;
    --secondary: #065f46;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --sidebar-width: 260px;
}

* {
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-main);
    color: var(--text-dark);
    margin: 0;
    min-height: 100vh;
}

/* ============================================
   APP WRAPPER
   ============================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--secondary) 100%);
    color: white;
    padding: 0;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.sidebar .brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar .brand-icon {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.sidebar .brand-text h5 {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
}

.sidebar .brand-text small {
    opacity: 0.7;
    font-size: 0.75rem;
}

.sidebar .nav-menu {
    padding: 1rem 0;
}

.sidebar .nav-section {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
}

.sidebar .nav-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.sidebar .nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
    border-left-color: var(--primary-light);
}

.sidebar .nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--primary-light);
    font-weight: 600;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 1.5rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.topbar h4 {
    margin: 0;
    font-weight: 700;
    color: var(--text-dark);
}

.topbar .breadcrumb {
    margin: 0;
    font-size: 0.85rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ============================================
   CARDS & KPI
   ============================================ */
.kpi-card {
    background: white;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.3s;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent, var(--primary));
}

.kpi-card .kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
}

.kpi-card .kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.kpi-card .kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.25rem 0;
    color: var(--text-dark);
}

/* ============================================
   DATA TABLE
   ============================================ */
.data-table {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}

.data-table .table-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.data-table table {
    margin: 0;
}

.data-table thead th {
    background: #f8fafc;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
}

.data-table tbody td {
    padding: 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-ada { background: #d1fae5; color: #065f46; }
.status-tidak { background: #fee2e2; color: #991b1b; }
.status-proses, .status-dalam_proses { background: #fef3c7; color: #92400e; }
.status-terlampir { background: #dbeafe; color: #1e40af; }

/* ============================================
   NKT BADGES
   ============================================ */
.nkt-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 0.25rem;
}

.nkt-1 { background: #dbeafe; color: #1e40af; }
.nkt-2 { background: #fef3c7; color: #92400e; }
.nkt-3 { background: #fee2e2; color: #991b1b; }
.nkt-4 { background: #d1fae5; color: #065f46; }
.nkt-5 { background: #e9d5ff; color: #6b21a8; }
.nkt-6 { background: #fed7aa; color: #9a3412; }

/* ============================================
   ACTION BUTTONS
   ============================================ */
.action-btn {
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f1f5f9;
}

.action-btn.view { color: #3b82f6; }
.action-btn.edit { color: #f59e0b; }
.action-btn.delete { color: #ef4444; }

/* ============================================
   MODAL CUSTOM
   ============================================ */
.modal-header-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
}

.modal-header-custom .btn-close {
    filter: invert(1);
}

/* ============================================
   FILTER CARD
   ============================================ */
.filter-card {
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ============================================
   NKT CHECKBOX GRID
   ============================================ */
.nkt-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.nkt-checkbox-item {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.nkt-checkbox-item:hover {
    border-color: var(--primary);
}

.nkt-checkbox-item.active {
    border-color: var(--primary);
    background: #f0fdfa;
}

.nkt-checkbox-item .nkt-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nkt-checkbox-item .nkt-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -200px;
    right: -200px;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    bottom: -150px;
    left: -150px;
}

.login-container {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.brand-header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-header .brand-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 10px 25px rgba(15, 118, 110, 0.3);
}

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-card {
    background: white;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
    height: 100%;
}

.chart-card .card-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.chart-container {
    position: relative;
    height: 320px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.85);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 15px;
}

.loading-overlay.show {
    display: flex;
}