/* assets/css/style.css */
:root {
    --sidebar-width: 245px;
    --sidebar-collapsed-width: 70px;
    --blue-primary: #1d4ed8;
    --blue-mid: #2563eb;
    --blue-dark: #1e3a8a;
    --blue-light: #3b82f6;
    --blue-soft: #eff6ff;
    --body-bg: #f8fafc;
}

/* Skala font global yang proporsional & nyaman dibaca di PC */
html {
    font-size: 14px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--body-bg);
    color: #334155;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ==========================================
   HALAMAN LOGIN PROFESIONAL (BIRU & PUTIH)
   ========================================== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.login-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
    width: 100%;
    max-width: 390px;
    padding: 2rem;
}

.login-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    margin: 0 auto 1rem;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

.password-toggle {
    cursor: pointer;
    background-color: #f8fafc;
    border-left: 0;
    color: #64748b;
}

.password-toggle:hover {
    color: var(--blue-mid);
}

/* ==========================================
   SIDEBAR KIRI DOMINAN BIRU & PUTIH (COLLAPSIBLE)
   ========================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e40af 0%, #1d4ed8 50%, #1e3a8a 100%);
    color: #ffffff;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 3px 0 16px rgba(30, 58, 138, 0.16);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-header {
    padding: 1.1rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 66px;
    white-space: nowrap;
}

.brand-icon {
    min-width: 36px;
    height: 36px;
    background: #ffffff;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--blue-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.brand-title {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    font-size: 0.68rem;
}

.sidebar-menu {
    padding: 0.95rem 0.7rem;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.menu-category {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 700;
    padding: 0.65rem 0.75rem 0.35rem;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.62rem 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 9px;
    font-weight: 500;
    font-size: 0.84rem;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.sidebar-link i {
    font-size: 1.05rem;
    min-width: 22px;
    text-align: center;
    transition: transform 0.2s;
}

.sidebar-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.14);
}

.sidebar-link.active {
    color: var(--blue-primary);
    background: #ffffff;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.15);
}

.sidebar-link.active i {
    color: var(--blue-mid);
}

.sidebar-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.15);
    white-space: nowrap;
}

.user-name {
    font-size: 0.8rem;
}

.user-status {
    font-size: 0.66rem;
}

/* ==========================================
   STATE SIDEBAR COLLAPSED (TERTUTUP)
   ========================================== */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .link-text,
body.sidebar-collapsed .user-details {
    display: none;
}

body.sidebar-collapsed .menu-category {
    opacity: 0;
    height: 8px;
    padding: 0;
    overflow: hidden;
}

body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 1.1rem 0.4rem;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0.68rem 0;
}

body.sidebar-collapsed .user-footer-wrap {
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

body.sidebar-collapsed .main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

/* Tombol Toggle Sidebar di Header */
.btn-toggle-sidebar {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    background-color: var(--blue-soft);
    color: var(--blue-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-toggle-sidebar:hover {
    background-color: var(--blue-mid);
    color: #ffffff;
    border-color: var(--blue-mid);
}

/* ==========================================
   KONTEN UTAMA & KARTU STATISTIK (PROPORSIONAL)
   ========================================== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 1.75rem;
    min-height: 100vh;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-navbar {
    background: #ffffff;
    padding: 0.8rem 1.75rem;
    margin: -1.5rem -1.75rem 1.5rem -1.75rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

#pageHeaderTitle {
    font-size: 0.98rem;
}

.header-subtitle {
    font-size: 0.74rem;
}

.section-title {
    color: var(--blue-primary);
    font-weight: 700;
    font-size: 0.96rem;
    border-bottom: 2px solid #dbeafe;
    padding-bottom: 0.45rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 5px 12px rgba(37, 99, 235, 0.08);
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-value-box {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 0.4rem 0.75rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.content-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.card-heading {
    font-size: 0.9rem;
}

/* Penyesuaian Ukuran Font Tabel & DataTables */
table.dataTable thead th,
.table-sm-custom thead th {
    background-color: var(--blue-soft);
    color: var(--blue-dark);
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.55rem 0.65rem;
    border-bottom: 2px solid #bfdbfe;
    white-space: nowrap;
}

table.dataTable tbody td,
.table-sm-custom tbody td {
    vertical-align: middle;
    font-size: 0.8rem;
    padding: 0.45rem 0.65rem;
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 0.78rem;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    font-size: 0.78rem;
    padding: 0.25rem 0.5rem;
}

.url-card-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    transition: all 0.2s ease;
}

.url-card-item:hover {
    border-color: #60a5fa;
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.08);
}

/* ==========================================
   STYLE DRAGGABLE MODAL POPUP
   ========================================== */
.modal .modal-header {
    cursor: move;
    user-select: none;
    background-color: var(--blue-soft);
    border-bottom: 1px solid #dbeafe;
}

.modal .modal-header:active {
    cursor: grabbing;
}

.modal .modal-content {
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
}

.modal-dragging .modal-dialog {
    transition: none !important;
}
