/* ============================================
 * NDS Management - Global Font System
 * ============================================
 * 
 * Font utama: Inter (Google Fonts)
 * Font untuk PDF/Excel: Arial
 * 
 * Font ini diterapkan secara konsisten ke seluruh komponen aplikasi
 * untuk mencapai tampilan rapi dan konsisten.
 * 
 * ============================================ */

/* ============================================
 * Font Import dan Variabel
 * ============================================ */

/* 
 * Google Fonts - Inter
 * Di-import di <head> header.php dan login.php
 * https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap
 * 
 * CATATAN: Jika font tidak tersedia, aplikasi akan otomatis fallback ke system fonts
 */

/* ============================================
 * Font Size Scale (sistem 8px base)
 * ============================================ */

/* Base / Body */
:root {
    /* Font sizes (8-point scale) */
    --font-size-tiny: 0.625rem;      /* 10px */
    --font-size-small: 0.6875rem;    /* 11px */
    --font-size-sm-regular: 0.75rem; /* 12px */
    --font-size-regular: 0.8125rem;  /* 13px */
    --font-size-base: 0.875rem;      /* 14px */
    --font-size-medium: 0.9375rem;   /* 15px */
    --font-size-lg: 1rem;            /* 16px */
    --font-size-large: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;         /* 20px */
    --font-size-2xl: 1.375rem;       /* 22px */
    --font-size-3xl: 1.5rem;         /* 24px */
    --font-size-4xl: 1.75rem;        /* 28px */
    --font-size-5xl: 2.125rem;       /* 34px */
    --font-size-6xl: 2.5rem;         /* 40px */
    --font-size-7xl: 3rem;           /* 48px */
    --font-size-8xl: 3.75rem;        /* 60px */
    --font-size-9xl: 5rem;           /* 80px */
    
    /* Font weights */
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-loose: 1.75;
}

/* ============================================
 * Global Font Definitions
 * ============================================ */

/* Body - Global font family dan size */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.875rem;  /* 14px */
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
 * Typography Reset
 * ============================================ */

/* Reset default heading fonts */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    line-height: 1.25;
}

h1 { font-size: 1.75rem; }  /* 28px */
h2 { font-size: 1.5rem; }   /* 24px */
h3 { font-size: 1.375rem; } /* 22px */
h4 { font-size: 1.25rem; }  /* 20px */
h5 { font-size: 1rem; }    /* 16px */
h6 { font-size: 0.875rem; } /* 14px */

/* Paragraph */
p {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;   /* 14px */
    font-weight: 400;
    line-height: 1.5;
}

/* Links */
a {
    font-family: inherit;
    font-weight: 500;
}

/* ============================================
 * Component-Specific Font Definitions
 * ============================================ */

/* --- Sidebar --- */
#sidebar .nav-link {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;  /* 14px */
    font-weight: 500;
}

#sidebar .nav-link.submenu {
    font-size: 0.8125rem; /* 13px */
    font-weight: 400;
}

#sidebar .menu-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.625rem;   /* 10px */
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#sidebar .badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.625rem;   /* 10px */
    font-weight: 600;
}

#sidebar .sidebar-brand {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.25rem;    /* 20px desktop */
    font-weight: 700;
}

#sidebar .sidebar-brand .subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem; /* 11px */
    font-weight: 400;
}

#sidebar .sidebar-footer {
    font-family: 'Inter', sans-serif;
    font-size: 0.625rem;   /* 10px */
    font-weight: 400;
}

/* Desktop sidebar (min-width: 768px) */
@media (min-width: 768px) {
    #sidebar .sidebar-brand {
        font-size: 1.25rem; /* 20px */
    }
    #sidebar .sidebar-brand .subtitle {
        font-size: 0.6875rem; /* 11px */
    }
}

/* Mobile sidebar (< 576px) */
@media (max-width: 576px) {
    #sidebar .sidebar-brand {
        font-size: 1.0625rem; /* 17px */
    }
    #sidebar .sidebar-brand .subtitle {
        font-size: 0.5625rem; /* 9px */
    }
}

/* --- Navbar --- */
.navbar-page-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.125rem;   /* 18px */
    font-weight: 600;
}

@media (max-width: 576px) {
    .navbar-page-title {
        font-size: 0.9375rem; /* 15px */
    }
}

.navbar-user-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;   /* 13px */
    font-weight: 600;
}

@media (max-width: 576px) {
    .navbar-user-name {
        font-size: 0.75rem; /* 12px */
    }
}

@media (max-width: 400px) {
    .navbar-user-name {
        font-size: 0.6875rem; /* 11px */
    }
}

.navbar-user-role {
    font-family: 'Inter', sans-serif;
    font-size: 0.625rem;    /* 10px */
    font-weight: 600;
}

.navbar-user-avatar {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;    /* 14px */
    font-weight: 600;
}

@media (max-width: 400px) {
    .navbar-user-avatar {
        font-size: 0.75rem; /* 12px */
    }
}

/* --- Buttons --- */
.btn {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;   /* 14px */
    font-weight: 500;
}

.btn-primary {
    font-weight: 500;
}

.btn-lg {
    font-size: 1rem;       /* 16px */
    font-weight: 600;
}

.btn-sm {
    font-size: 0.75rem;    /* 12px */
    font-weight: 500;
}

/* --- Forms --- */
.form-control,
.form-select,
.form-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;   /* 14px */
}

.form-label {
    font-weight: 500;
}

.form-control:focus,
.form-select:focus {
    font-weight: 400;
}

/* --- Tables --- */
.table {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.8125rem;  /* 13px */
}

.table th {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;    /* 12px */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;  /* 13px */
    font-weight: 400;
}

/* --- Cards --- */
.card {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.card-title {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;       /* 16px */
    font-weight: 600;
}

.card-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;   /* 14px */
    font-weight: 400;
}

.card-body h1,
.card-body h2,
.card-body h3,
.card-body h4,
.card-body h5,
.card-body h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

/* --- Alerts --- */
.alert {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;   /* 14px */
    font-weight: 400;
}

.alert-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

/* --- Badges --- */
.badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;  /* 11px */
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* --- Modals --- */
.modal-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;    /* 20px */
    font-weight: 600;
}

.modal-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;   /* 14px */
    font-weight: 400;
}

.modal-footer {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;  /* 13px */
    font-weight: 400;
}

/* --- Stat Cards (Dashboard) --- */
.stat-card {
    font-family: 'Inter', sans-serif;
}

.stat-card .stat-number {
    font-family: 'Inter', sans-serif;
    font-size: 1.75rem;    /* 28px */
    font-weight: 700;
}

.stat-card .stat-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;   /* 14px */
    font-weight: 600;
}

.stat-card .stat-change {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;  /* 13px */
    font-weight: 500;
}

/* --- ID Badges --- */
.id-badge {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;    /* 12px */
    font-weight: 600;
    letter-spacing: 0.05em;
}

.id-badge-billing {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8125rem;  /* 13px */
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* --- Server Time (Absensi) --- */
.server-time {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.125rem;   /* 18px */
    font-weight: 600;
}

/* --- Welcome Section --- */
.welcome-section .welcome-name {
    font-family: 'Inter', sans-serif;
    font-size: 1.625rem;   /* 26px */
    font-weight: 700;
}

@media (max-width: 576px) {
    .welcome-section .welcome-name {
        font-size: 1.25rem; /* 20px */
    }
}

.welcome-section .welcome-role {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;   /* 14px */
    font-weight: 400;
}

/* --- Small text --- */
.text-small {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;    /* 12px */
    font-weight: 400;
}

.text-tiny {
    font-family: 'Inter', sans-serif;
    font-size: 0.625rem;    /* 10px */
    font-weight: 400;
}

.text-muted {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

/* ============================================
 * Footer
 * ============================================ */
footer,
.main-footer {
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;  /* 11px */
    font-weight: 400;
    text-align: center;
}

/* ============================================
 * Login Page Overrides
 * ============================================ */
.login-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-page h1 {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;     /* 24px */
    font-weight: 700;
}

@media (max-width: 480px) {
    .login-page h1 {
        font-size: 1.25rem; /* 20px */
    }
}

.login-page .form-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;   /* 14px */
    font-weight: 500;
}

.login-page .form-control {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;  /* 15px */
    font-weight: 400;
}

.login-page .btn-login {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;       /* 16px */
    font-weight: 600;
}

.login-page .login-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;   /* 14px */
    font-weight: 400;
}

.login-page .login-footer {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;  /* 13px */
    font-weight: 400;
}

/* ============================================
 * Chart.js (Dashboard Analytics)
 * ============================================ */
.chartjs-text {
    font-family: 'Inter', sans-serif !important;
}

.chartjs-text .chart-title {
    font-size: 1rem;       /* 16px */
    font-weight: 600;
}

.chartjs-text .chart-label {
    font-size: 0.6875rem;  /* 11px */
    font-weight: 400;
}

/* ============================================
 * Print Styles
 * ============================================ */
@media print {
    body {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
        font-size: 0.8125rem; /* 13px - lebih kecil untuk print */
    }
    
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
}

/* ============================================
 * Badge status pelanggan (6 status lifecycle)
 * ============================================ */
.status-badge-clean {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}

.status-badge-clean.open {
    background-color: #e3f2fd;
    color: #1565c0;
    border-color: #90caf9;
}

.status-badge-clean.onproses {
    background-color: #fff8e1;
    color: #b28704;
    border-color: #ffe082;
}

.status-badge-clean.aktif {
    background-color: #e6f7ed;
    color: #1e7e34;
    border-color: #a5d6a7;
}

.status-badge-clean.suspen {
    background-color: #fff3e0;
    color: #d84315;
    border-color: #ffcc80;
}

.status-badge-clean.dismantle {
    background-color: #eceff1;
    color: #455a64;
    border-color: #b0bec5;
}

.status-badge-clean.reaktivasi {
    background-color: #e8eaf6;
    color: #3f51b5;
    border-color: #9fa8da;
}

.status-badge-clean.close {
    background-color: #fde8e8;
    color: #c62828;
    border-color: #ef9a9a;
}

/* ============================================
 * Status bertingkat ("On Proses" + "Perlu Konfirmasi"/"Perlu Aktivasi")
 * Wrapper dari getStatusBadgeTampilan(): flex kolom memberi jarak vertikal
 * konsisten antar label tanpa memakai <br>, rapi di desktop maupun mobile.
 * ============================================ */
.status-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

/* ============================================
 * Label "Perlu Konfirmasi" — background #2185D5
 * Sumber bersama (getStatusBadgeTampilan() & getLabelTiketMenungguKonfirmasi()).
 * Bentuk, ukuran, padding, border-radius, font tetap mengikuti .badge existing;
 * hanya background dan warna teks yang didefinisikan di sini.
 * ============================================ */
.status-label-konfirmasi {
    background-color: #2185d5;
    color: #ffffff;
}

/* ============================================
 * Font Awesome 6 — sumber font LOKAL (self-host)
 * ============================================
 * Filenya ada di assets/webfonts/ (versi 6.4.0, sama dengan CSS CDN yang
 * dimuat header.php). Karena fonts.css dimuat SETELAH CSS Font Awesome
 * dari CDN, deklarasi terakhir di dokumen menang — browser selalu mengambil
 * file font dari project ini, bukan dari CDN. Ini mencegah ikon tampil
 * sebagai kotak (tofu) saat CSS CDN termuat tetapi file webfont CDN
 * gagal diambil oleh browser.
 */
@font-face {
    font-family: "Font Awesome 6 Free";
    font-style: normal;
    font-weight: 900;
    font-display: block;
    src: url("../webfonts/fa-solid-900.woff2") format("woff2");
}

@font-face {
    font-family: "Font Awesome 6 Free";
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url("../webfonts/fa-regular-400.woff2") format("woff2");
}

@font-face {
    font-family: "Font Awesome 6 Brands";
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url("../webfonts/fa-brands-400.woff2") format("woff2");
}
