/* ============================================
   biz_indoline - ISP Billing System
   Dark Theme Stylesheet (RadBoox Style)
   ============================================ */

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

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --bg-primary: #0a1929;
    --bg-secondary: #0d2137;
    --bg-card: #132f4c;
    --bg-card-hover: #173a5e;
    --bg-input: #0d2137;
    --bg-sidebar: #071318;
    --bg-header: #0a1929;

    --text-primary: #e3e8ef;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-white: #ffffff;

    --accent-blue: #1976d2;
    --accent-blue-light: #42a5f5;
    --accent-blue-dark: #1565c0;
    --accent-green: #2e7d32;
    --accent-green-light: #4caf50;
    --accent-red: #c62828;
    --accent-red-light: #ef5350;
    --accent-orange: #e65100;
    --accent-orange-light: #ff9800;
    --accent-purple: #7b1fa2;
    --accent-yellow: #f9a825;
    --accent-cyan: #00acc1;

    --border-color: #1e3a5f;
    --border-light: #253d57;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);

    --sidebar-width: 250px;
    --header-height: 60px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 12px;
    --radius-sm: 8px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--text-white);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* ============================================
   Header / Top Bar
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    backdrop-filter: blur(20px);
    transition: var(--transition);
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--bg-card);
}

.search-box {
    position: relative;
    min-width: 280px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

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

.header-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.header-btn:hover {
    background: var(--bg-card);
    color: var(--text-white);
}

.header-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--accent-red-light);
    border-radius: 50%;
}

.profile-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.profile-menu:hover {
    background: var(--bg-card);
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 200;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    transition: var(--transition);
}

.profile-dropdown a:hover {
    background: var(--bg-card-hover);
    color: var(--text-white);
}

.profile-dropdown a i {
    width: 20px;
    text-align: center;
}

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

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

.sidebar-brand .logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
}

.sidebar-brand .brand-text span {
    color: var(--accent-blue-light);
}

.sidebar-section {
    padding: 16px 0 4px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0 20px 8px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    position: relative;
}

.sidebar-menu > li > a,
.sidebar-menu > li > .menu-parent {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    user-select: none;
}

.sidebar-menu > li > a:hover,
.sidebar-menu > li > .menu-parent:hover {
    color: var(--text-white);
    background: rgba(25, 118, 210, 0.08);
}

.sidebar-menu > li > a.active,
.sidebar-menu > li.active > a,
.sidebar-menu > li.active > .menu-parent {
    color: var(--accent-blue-light);
    background: rgba(25, 118, 210, 0.12);
    border-left-color: var(--accent-blue);
}

.sidebar-menu > li > a i,
.sidebar-menu > li > .menu-parent i {
    width: 22px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.menu-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.menu-parent.open .menu-arrow {
    transform: rotate(90deg);
}

/* Sub-menu */
.sidebar-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.sidebar-submenu.show {
    max-height: 500px;
}

.sidebar-submenu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 8px 56px;
    color: var(--text-muted);
    font-size: 13px;
    transition: var(--transition);
    position: relative;
}

.sidebar-submenu li a::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar-submenu li a:hover {
    color: var(--accent-blue-light);
}

.sidebar-submenu li a:hover::before {
    background: var(--accent-blue-light);
}

.sidebar-submenu li a.active {
    color: var(--accent-blue-light);
}

.sidebar-submenu li a.active::before {
    background: var(--accent-blue-light);
    box-shadow: 0 0 8px rgba(66, 165, 245, 0.5);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 24px;
    min-height: calc(100vh - var(--header-height));
    transition: var(--transition);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--accent-blue-light);
}

/* Stat Cards (Dashboard Widgets) */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    opacity: 0.15;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.stat-card.blue::before { background: linear-gradient(135deg, transparent, var(--accent-blue)); }
.stat-card.green::before { background: linear-gradient(135deg, transparent, var(--accent-green-light)); }
.stat-card.red::before { background: linear-gradient(135deg, transparent, var(--accent-red-light)); }
.stat-card.orange::before { background: linear-gradient(135deg, transparent, var(--accent-orange-light)); }
.stat-card.purple::before { background: linear-gradient(135deg, transparent, var(--accent-purple)); }
.stat-card.cyan::before { background: linear-gradient(135deg, transparent, var(--accent-cyan)); }

.stat-card .stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 4px;
}

.stat-card .stat-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Color stat cards with gradient backgrounds */
.gradient-card {
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    color: white;
    min-height: 100px;
}

.gradient-card.grad-blue { background: linear-gradient(135deg, #1565c0, #42a5f5); }
.gradient-card.grad-red { background: linear-gradient(135deg, #c62828, #ef5350); }
.gradient-card.grad-green { background: linear-gradient(135deg, #2e7d32, #66bb6a); }
.gradient-card.grad-orange { background: linear-gradient(135deg, #e65100, #ffa726); }
.gradient-card.grad-purple { background: linear-gradient(135deg, #6a1b9a, #ba68c8); }
.gradient-card.grad-cyan { background: linear-gradient(135deg, #00838f, #4dd0e1); }
.gradient-card.grad-teal { background: linear-gradient(135deg, #00695c, #4db6ac); }
.gradient-card.grad-indigo { background: linear-gradient(135deg, #283593, #7986cb); }

.gradient-card::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.gradient-card .stat-label {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
}

.gradient-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin: 4px 0;
}

.gradient-card .stat-sub {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}

.gradient-card .stat-dots {
    position: absolute;
    top: 12px;
    right: 12px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    z-index: 2;
}

/* Status Cards (Premium Design) */
.status-cards {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.status-card {
    display: flex;
    align-items: center;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 15px 20px;
    flex: 1;
    min-width: 150px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.status-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.status-card::before, .status-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    z-index: 1;
}
.status-card::before { width: 80px; height: 80px; top: -20px; right: -20px; }
.status-card::after { width: 60px; height: 60px; bottom: -15px; right: 30px; }

.status-card.card-blue::before, .status-card.card-blue::after { background: var(--accent-blue); }
.status-card.card-green::before, .status-card.card-green::after { background: var(--accent-green); }
.status-card.card-orange::before, .status-card.card-orange::after { background: var(--accent-orange); }
.status-card.card-red::before, .status-card.card-red::after { background: var(--accent-red); }
.status-card.card-cyan::before, .status-card.card-cyan::after { background: var(--accent-cyan); }

.status-card .status-icon {
    font-size: 24px;
    z-index: 2;
    margin-right: 15px;
    width: auto;
    height: auto;
    background: transparent !important;
}

.status-card.card-blue .status-icon { color: var(--accent-blue-light); }
.status-card.card-green .status-icon { color: var(--accent-green-light); }
.status-card.card-orange .status-icon { color: var(--accent-orange-light); }
.status-card.card-red .status-icon { color: var(--accent-red-light); }
.status-card.card-cyan .status-icon { color: var(--accent-cyan); }

.status-card .status-content {
    z-index: 2;
    flex: 1;
    text-align: center;
}

.status-card .status-count {
    font-size: 20px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}

.status-card .status-label {
    font-size: 12px;
    color: #94a3b8;
}

/* ============================================
   Tables
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.data-table thead th:first-child {
    padding-left: 20px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(25, 118, 210, 0.05);
}

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

.data-table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody td:first-child {
    padding-left: 20px;
}

.data-table .checkbox-col {
    width: 40px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.btn-primary:hover {
    background: var(--accent-blue-dark);
    color: white;
}

.btn-success {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

.btn-success:hover {
    background: #1b5e20;
    color: white;
}

.btn-danger {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.btn-danger:hover {
    background: #b71c1c;
    color: white;
}

.btn-warning {
    background: var(--accent-orange);
    color: white;
    border-color: var(--accent-orange);
}

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

.btn-outline:hover {
    background: var(--bg-card);
    color: var(--text-white);
    border-color: var(--accent-blue);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

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

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

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

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}

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

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 36px;
}

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

.form-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}

.filter-bar .form-control {
    max-width: 200px;
}

.filter-bar .search-input {
    position: relative;
}

.filter-bar .search-input input {
    padding-left: 36px;
}

.filter-bar .search-input i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ============================================
   Badges / Status labels
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-active, .badge-paid, .badge-success {
    background: rgba(46, 125, 50, 0.15);
    color: var(--accent-green-light);
}

.badge-suspend, .badge-overdue, .badge-warning {
    background: rgba(230, 81, 0, 0.15);
    color: var(--accent-orange-light);
}

.badge-terminate, .badge-cancelled, .badge-danger {
    background: rgba(198, 40, 40, 0.15);
    color: var(--accent-red-light);
}

.badge-unpaid, .badge-pending, .badge-info {
    background: rgba(25, 118, 210, 0.15);
    color: var(--accent-blue-light);
}

.badge-new {
    background: rgba(0, 172, 193, 0.15);
    color: var(--accent-cyan);
}

.badge-expired {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
}

/* ============================================
   Modals
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--accent-red-light);
    background: rgba(198, 40, 40, 0.1);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Alerts / Flash Messages
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: rgba(46, 125, 50, 0.15);
    border: 1px solid var(--accent-green);
    color: var(--accent-green-light);
}

.alert-error {
    background: rgba(198, 40, 40, 0.15);
    border: 1px solid var(--accent-red);
    color: var(--accent-red-light);
}

.alert-warning {
    background: rgba(230, 81, 0, 0.15);
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange-light);
}

.alert-info {
    background: rgba(25, 118, 210, 0.15);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue-light);
}

.alert .close-alert {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
}

.alert .close-alert:hover {
    opacity: 1;
}

/* ============================================
   Pagination
   ============================================ */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 16px;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    gap: 4px;
}

.pagination-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination-btn:hover {
    background: var(--bg-card);
    color: var(--text-white);
}

.pagination-wrapper select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    min-width: 55px;
    transition: var(--transition);
}

.pagination-wrapper select:hover,
.pagination-wrapper select:focus {
    border-color: var(--accent-blue);
}

.pagination-wrapper select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 6px 10px;
}

/* ============================================
   Checkbox Custom
   ============================================ */
.custom-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-checkbox input:checked ~ .checkmark {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: var(--transition);
}

.custom-checkbox input:checked ~ .checkmark::after {
    opacity: 1;
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(25, 118, 210, 0.1) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 172, 193, 0.08) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-white);
}

.login-logo h1 span {
    color: var(--accent-blue-light);
}

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

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-control {
    padding: 12px 16px;
    font-size: 14px;
}

.login-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    justify-content: center;
    margin-top: 8px;
}

/* ============================================
   Grid Utilities
   ============================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--text-white); }
.text-sm { font-size: 12px; }
.font-bold { font-weight: 700; }

.w-full { width: 100%; }

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

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-white);
}

/* Tab styles */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-blue-light);
    border-bottom-color: var(--accent-blue);
}

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

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

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

/* Session Online progress bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar .progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-fill.blue { background: var(--accent-blue); }
.progress-fill.green { background: var(--accent-green-light); }
.progress-fill.orange { background: var(--accent-orange-light); }

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.avatar.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.avatar-lg { width: 64px; height: 64px; font-size: 24px; }
.avatar.avatar-xl { width: 80px; height: 80px; font-size: 32px; }

/* ============================================
   Widget - WhatsApp Gateway, Router NAS
   ============================================ */
.widget-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
}

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

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

    .header {
        left: 0;
    }

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

    .menu-toggle {
        display: flex;
    }

    .search-box {
        min-width: auto;
        flex: 1;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .stat-cards {
        grid-template-columns: 1fr;
    }

    .status-cards {
        flex-direction: column;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .form-control {
        max-width: 100%;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================
   Sidebar mobile overlay
   ============================================ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* Two column layout (e.g., admin page) */
.two-col-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .two-col-layout {
        grid-template-columns: 1fr;
    }
}

/* Setting form card */
.setting-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
}

.setting-card .setting-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Disabled text */
.text-disabled {
    color: var(--accent-red-light);
    font-weight: 600;
}

.text-enabled {
    color: var(--accent-green-light);
    font-weight: 600;
}


/* ============================================================
   LIGHT MODE  –  colorful premium palette
   Applied when <body class="light-mode"> or
   <html data-theme="light">
   ============================================================ */
body.light-mode {
    --bg-primary:    #f0f4ff;
    --bg-secondary:  #e6edff;
    --bg-card:       #ffffff;
    --bg-card-hover: #eef2ff;
    --bg-input:      #f5f7ff;
    --bg-sidebar:    #1e2d6e;        /* deep indigo sidebar */
    --bg-header:     #ffffff;

    --text-primary:  #1a1f36;
    --text-secondary:#4a5568;
    --text-muted:    #718096;
    --text-white:    #ffffff;

    --accent-blue:        #4f46e5;   /* indigo-600 */
    --accent-blue-light:  #818cf8;   /* indigo-400 */
    --accent-blue-dark:   #3730a3;   /* indigo-700 */
    --accent-green:       #059669;   /* emerald-600 */
    --accent-green-light: #34d399;   /* emerald-400 */
    --accent-red:         #dc2626;
    --accent-red-light:   #f87171;
    --accent-orange:      #d97706;
    --accent-orange-light:#fbbf24;
    --accent-purple:      #7c3aed;
    --accent-yellow:      #f59e0b;
    --accent-cyan:        #0891b2;

    --border-color: #c7d2fe;
    --border-light: #e0e7ff;
    --shadow:       0 4px 24px rgba(79,70,229,0.10);
    --shadow-sm:    0 2px 8px  rgba(79,70,229,0.08);
}

/* ── SIDEBAR  (dark indigo stays, text white) ── */
body.light-mode .sidebar {
    background: linear-gradient(180deg, #1e2d6e 0%, #2d3f91 100%);
    border-right: none;
    box-shadow: 4px 0 20px rgba(79,70,229,0.15);
}
body.light-mode .sidebar-brand .brand-text { color: #fff; }
body.light-mode .sidebar-brand .brand-text span { opacity:.65; color:#c7d2fe; }
body.light-mode .sidebar-section-title {
    color: #a5b4fc;
    letter-spacing: .08em;
}
body.light-mode .sidebar-menu > li > a,
body.light-mode .sidebar-menu > li > .menu-parent {
    color: #c7d2fe;
}
body.light-mode .sidebar-menu > li > a:hover,
body.light-mode .sidebar-menu > li > .menu-parent:hover {
    background: rgba(255,255,255,.10);
    color: #fff;
}
body.light-mode .sidebar-menu > li > a.active,
body.light-mode .sidebar-menu > li.active > a,
body.light-mode .sidebar-menu > li.active > .menu-parent {
    background: linear-gradient(90deg,#6366f1,#818cf8);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,.4);
}
body.light-mode .sidebar-submenu { background: rgba(0,0,0,.15); }
body.light-mode .sidebar-submenu a { color: #c7d2fe; }
body.light-mode .sidebar-submenu a:hover { color: #fff; }
body.light-mode .sidebar-submenu a.active { color: #818cf8; font-weight:600; }

/* ── HEADER ── */
body.light-mode .header {
    background: #fff;
    border-bottom: 1px solid #e0e7ff;
    box-shadow: 0 2px 12px rgba(79,70,229,.07);
}
body.light-mode .header-btn {
    color: #4a5568;
    background: #f0f4ff;
}
body.light-mode .header-btn:hover { background: #e0e7ff; color: #4f46e5; }
body.light-mode .search-box input {
    background: #f0f4ff;
    border-color: #c7d2fe;
    color: #1a1f36;
}
body.light-mode .search-box input::placeholder { color: #94a3b8; }
body.light-mode .search-icon { color: #818cf8; }

/* ── BODY / CARDS ── */
body.light-mode .main-content { background: #f0f4ff; }
body.light-mode .card {
    background: #fff;
    border: 1px solid #e0e7ff;
    box-shadow: 0 2px 12px rgba(79,70,229,.06);
}
body.light-mode .card:hover { box-shadow: 0 8px 28px rgba(79,70,229,.13); }
body.light-mode .card-header { border-bottom-color: #e0e7ff; }
body.light-mode .card-title   { color: #1a1f36; }

/* ── STAT CARDS (keep colorful gradient) ── */
body.light-mode .stat-card.blue   { background: linear-gradient(135deg,#6366f1,#818cf8); }
body.light-mode .stat-card.green  { background: linear-gradient(135deg,#059669,#34d399); }
body.light-mode .stat-card.red    { background: linear-gradient(135deg,#dc2626,#f87171); }
body.light-mode .stat-card.orange { background: linear-gradient(135deg,#d97706,#fbbf24); }
body.light-mode .stat-card.purple { background: linear-gradient(135deg,#7c3aed,#a78bfa); }
body.light-mode .stat-card.cyan   { background: linear-gradient(135deg,#0891b2,#38bdf8); }

/* ── TABLE ── */
body.light-mode .table-container { background: #fff; border: 1px solid #e0e7ff; }
body.light-mode table thead th {
    background: linear-gradient(90deg,#f0f4ff,#e8edff);
    color: #4f46e5;
    border-bottom: 2px solid #c7d2fe;
}
body.light-mode table tbody tr:hover { background: #f5f7ff; }
body.light-mode table td, body.light-mode table th { border-bottom-color: #f0f4ff; color: #1a1f36; }
body.light-mode .badge { font-weight: 600; }

/* ── FORMS / INPUTS ── */
body.light-mode .form-control,
body.light-mode select,
body.light-mode input[type="text"],
body.light-mode input[type="email"],
body.light-mode input[type="password"],
body.light-mode input[type="number"],
body.light-mode textarea {
    background: #f5f7ff;
    border-color: #c7d2fe;
    color: #1a1f36;
}
body.light-mode .form-control:focus,
body.light-mode select:focus,
body.light-mode input:focus,
body.light-mode textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
body.light-mode label { color: #374151; }

/* ── BUTTONS ── */
body.light-mode .btn-primary {
    background: linear-gradient(135deg,#4f46e5,#6366f1);
    box-shadow: 0 4px 12px rgba(79,70,229,.30);
}
body.light-mode .btn-primary:hover { background: linear-gradient(135deg,#4338ca,#4f46e5); }
body.light-mode .btn-outline {
    border-color: #c7d2fe;
    color: #4f46e5;
    background: transparent;
}
body.light-mode .btn-outline:hover { background: #e0e7ff; }

/* ── MODAL ── */
body.light-mode .modal-backdrop { background: rgba(30,45,110,.45); }
body.light-mode .modal-content {
    background: #fff;
    border: 1px solid #c7d2fe;
    box-shadow: 0 20px 60px rgba(79,70,229,.18);
}
body.light-mode .modal-header { border-bottom-color: #e0e7ff; }
body.light-mode .modal-title { color: #1a1f36; }
body.light-mode .modal-close { color: #4a5568; }

/* ── PROFILE DROPDOWN ── */
body.light-mode .profile-dropdown {
    background: #fff;
    border: 1px solid #e0e7ff;
    box-shadow: 0 8px 28px rgba(79,70,229,.12);
}
body.light-mode .profile-dropdown a { color: #1a1f36; }
body.light-mode .profile-dropdown a:hover { background: #f0f4ff; }

/* ── SCROLLBAR ── */
body.light-mode ::-webkit-scrollbar-track { background: #f0f4ff; }
body.light-mode ::-webkit-scrollbar-thumb { background: #c7d2fe; }
body.light-mode ::-webkit-scrollbar-thumb:hover { background: #6366f1; }

/* ── THEME TOGGLE BUTTON ── */
#themeToggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 50px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}
#themeToggle:hover {
    border-color: var(--accent-blue-light);
    color: var(--accent-blue-light);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
#themeToggle .theme-icon { font-size: 15px; }
body.light-mode #themeToggle { border-color: #c7d2fe; background: #f0f4ff; color: #4f46e5; }
body.light-mode #themeToggle:hover { background: #e0e7ff; }
