/* ============================================================
   ISP IRP System - Custom Stylesheet
   ============================================================ */

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --bg-page: #f5f7fb;
    --bg-card: #ffffff;
    --text-primary: #2c3e50;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg-page);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    font-size: 14px;
}

/* ===================== LAYOUT ===================== */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #2c3e50 0%, #1e2b3a 100%);
    color: #cbd5e0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: #fff;
}

.sidebar-brand i {
    font-size: 28px;
    color: var(--primary);
}

.brand-title { font-size: 18px; font-weight: 700; line-height: 1; }
.brand-sub  { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.sidebar-nav {
    flex: 1;
    padding: 14px 0;
    overflow-y: auto;
}

.nav-section {
    padding: 12px 20px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c7d92;
    font-weight: 600;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #cbd5e0;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all .15s ease;
}

.sidebar .nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar .nav-link:hover {
    background: rgba(102, 126, 234, .15);
    color: #fff;
    border-left-color: var(--primary);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(102,126,234,.2) 0%, transparent 100%);
    color: #fff;
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    color: #6c7d92;
    font-size: 11px;
    text-align: center;
}

.main-area {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.sidebar-toggle { color: inherit; padding: 4px 8px; }

.page-heading h1 { font-size: 18px; font-weight: 600; margin: 0; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
}

.content {
    padding: 24px;
    flex: 1;
}

/* ===================== STAT CARDS ===================== */
.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.stat-body { flex: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--text-primary); margin: 2px 0; }
.stat-sub   { font-size: 12px; color: var(--text-muted); }

.bg-primary-soft   { background-color: rgba(102,126,234,.12); }
.bg-success-soft    { background-color: rgba(25,135,84,.12); }
.bg-warning-soft    { background-color: rgba(255,193,7,.12); }
.bg-danger-soft     { background-color: rgba(220,53,69,.12); }
.bg-info-soft       { background-color: rgba(13,202,240,.12); }
.bg-secondary-soft  { background-color: rgba(108,117,125,.12); }

.stat-mini {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.stat-mini .stat-label { font-size: 11px; }
.stat-mini .stat-value { font-size: 18px; margin: 2px 0; }
.stat-mini .stat-sub   { font-size: 11px; }

/* ===================== CARDS & TABLES ===================== */
.card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 18px;
    font-weight: 600;
}

.table > :not(caption) > * > * { padding: 10px 14px; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); font-weight: 600; }
.table tbody td { font-size: 14px; }

/* ===================== LOGIN PAGE ===================== */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-wrapper {
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.auth-card {
    background: #fff;
    padding: 40px 32px;
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(0,0,0,.25);
    text-align: left;
}

.auth-brand {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    margin: 0 auto 16px;
}

.auth-card h2 { text-align: center; margin-bottom: 4px; font-weight: 700; color: var(--text-primary); }
.auth-card .text-muted { text-align: center; margin-bottom: 24px; }

.btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--text-muted);
    padding: 6px;
}

.auth-demo-credentials {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed #e9ecef;
}

.auth-footer { color: rgba(255,255,255,.85); margin-top: 20px; font-size: 12px; }

/* ===================== FORMS ===================== */
.form-control, .form-select {
    border: 1px solid #d8dee4;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 4px; color: var(--text-primary); }
.btn { font-weight: 500; border-radius: 8px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ===================== PACKAGE CARDS ===================== */
.package-card {
    transition: transform .15s ease, box-shadow .15s ease;
}
.package-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.package-inactive { opacity: 0.6; }
.package-name { font-weight: 700; font-size: 18px; color: var(--text-primary); }
.package-speed { font-size: 14px; }
.package-price { font-size: 28px; font-weight: 800; color: var(--primary); }
.package-price small { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ===================== REPORT CARDS ===================== */
.report-card { transition: transform .15s ease, box-shadow .15s ease; }
.report-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.report-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* ===================== ACTIVITY TIMELINE ===================== */
.activity-timeline { list-style: none; padding: 0; margin: 0; }
.activity-item {
    display: flex;
    gap: 14px;
    padding-bottom: 18px;
    position: relative;
}
.activity-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 18px;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}
.activity-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    z-index: 1;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px var(--border-color);
}
.activity-content { flex: 1; }

/* ===================== CUSTOMER AVATAR ===================== */
.customer-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

/* ===================== INVOICE / RECEIPT ===================== */
.invoice-page { background: #fff; padding: 32px; border-radius: 8px; border: 1px solid #e9ecef; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-area { margin-left: 0; }
}

@media (max-width: 575.98px) {
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .stat-value { font-size: 18px; }
    .stat-icon { width: 44px; height: 44px; font-size: 20px; }
}

/* ===================== SCROLLBAR ===================== */
.sidebar::-webkit-scrollbar, .table-responsive::-webkit-scrollbar { width: 6px; height: 6px; }
.sidebar::-webkit-scrollbar-track, .table-responsive::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb, .table-responsive::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 3px; }
