/* HostPanel Pro - Client Portal CSS */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #4f46e5;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }
a { text-decoration: none; color: var(--primary); }

/* ── SIDEBAR ── */
.hp-sidebar {
  position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar-bg); display: flex; flex-direction: column;
  z-index: 1000; transition: transform .3s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px; height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-icon { font-size: 22px; }
.brand-name { font-weight: 700; font-size: 16px; color: #fff; letter-spacing: -.3px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent; }
.nav-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.25); padding: 16px 8px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 500; margin-bottom: 2px;
  transition: all .2s; position: relative; cursor: pointer; border: none; background: none; width: 100%;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item.active i { color: #fff; }
.nav-item i { width: 16px; height: 16px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 700; }
.nav-item-danger:hover { background: rgba(239,68,68,.15); color: var(--danger); }

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; }
.sidebar-overlay.show { display: block; }

/* ── MAIN ── */
.hp-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.hp-topbar {
  position: sticky; top: 0; z-index: 100; height: var(--topbar-h);
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.btn-menu { background: none; border: none; cursor: pointer; color: var(--text-muted); display: none; padding: 6px; border-radius: 8px; }
.btn-menu:hover { background: var(--bg); }
.topbar-title h5 { font-weight: 700; font-size: 16px; color: var(--text); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 8px; border-radius: 8px; position: relative; }
.topbar-btn:hover { background: var(--bg); }
.notif-dot { position: absolute; top: 4px; right: 4px; background: var(--danger); color: #fff; font-size: 9px; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.topbar-user { background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--text); }
.topbar-user:hover { background: var(--bg); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ── NOTIFICATIONS DROPDOWN ── */
.notif-dropdown { min-width: 320px; padding: 0; border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 12px; overflow: hidden; }
.notif-header { padding: 12px 16px; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
.notif-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); transition: background .2s; }
.notif-item:hover { background: var(--bg); }
.notif-type { width: 3px; border-radius: 2px; flex-shrink: 0; }
.notif-info { background: var(--info); } .notif-success { background: var(--success); }
.notif-warning { background: var(--warning); } .notif-danger { background: var(--danger); }
.notif-title { font-size: 13px; font-weight: 600; }
.notif-msg { font-size: 12px; color: var(--text-muted); }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── CONTENT ── */
.hp-content { flex: 1; padding: 0; }
.hp-footer { padding: 16px 24px; display: flex; align-items: center; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--bg-card); }

/* ── WELCOME CARD ── */
.hp-welcome-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; border-radius: var(--radius); padding: 24px 28px;
  position: relative; overflow: hidden;
}
.hp-welcome-card::after {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px; background: rgba(255,255,255,.06); border-radius: 50%;
}
.hp-welcome-card h4 { font-weight: 700; font-size: 20px; margin-bottom: 4px; }

/* ── STAT CARDS ── */
.stat-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  border-left: 3px solid transparent; transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-primary { border-left-color: var(--primary); }
.stat-success { border-left-color: var(--success); }
.stat-warning { border-left-color: var(--warning); }
.stat-danger { border-left-color: var(--danger); }
.stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.stat-primary .stat-icon { background: rgba(79,70,229,.1); color: var(--primary); }
.stat-success .stat-icon { background: rgba(16,185,129,.1); color: var(--success); }
.stat-warning .stat-icon { background: rgba(245,158,11,.1); color: var(--warning); }
.stat-danger .stat-icon { background: rgba(239,68,68,.1); color: var(--danger); }
.stat-icon i { width: 18px; height: 18px; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ── HP CARDS ── */
.hp-card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.hp-card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.hp-card-header h6 { font-weight: 700; margin: 0; display: flex; align-items: center; font-size: 14px; }
.hp-card-header h6 i { width: 16px; height: 16px; }
.hp-card-body { padding: 16px 20px; }

/* ── SERVICE ROWS ── */
.service-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); transition: background .2s; }
.service-row:last-child { border-bottom: none; }
.service-row:hover { background: var(--bg); }
.service-icon { font-size: 22px; flex-shrink: 0; }
.service-info { flex: 1; min-width: 0; }
.service-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.service-domain { font-size: 12px; color: var(--text-muted); }
.service-due { text-align: right; flex-shrink: 0; }
.due-date { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }

/* ── INVOICE ROWS ── */
.invoice-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--border); transition: background .2s; }
.invoice-row:last-child { border-bottom: none; }
.invoice-row:hover { background: var(--bg); }
.inv-number { font-size: 13px; font-weight: 600; }
.inv-due { font-size: 12px; color: var(--text-muted); }
.inv-amount { text-align: right; display: flex; align-items: center; gap: 12px; }
.inv-total { font-weight: 700; font-size: 15px; color: var(--text); }

/* ── TICKET ROWS ── */
.ticket-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); transition: background .2s; }
.ticket-row:last-child { border-bottom: none; }
.ticket-row:hover { background: var(--bg); }
.ticket-priority { width: 3px; height: 32px; border-radius: 2px; flex-shrink: 0; }
.priority-low { background: var(--text-muted); }
.priority-medium { background: var(--primary); }
.priority-high { background: var(--warning); }
.priority-urgent { background: var(--danger); }
.ticket-info { flex: 1; min-width: 0; }
.ticket-subject { font-size: 13px; font-weight: 600; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-subject:hover { color: var(--primary); }
.ticket-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── BILLING PAGE ── */
.billing-summary-card { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); color: #fff; border-radius: var(--radius); padding: 24px; }
.billing-amount { font-size: 32px; font-weight: 800; }
.billing-period-bar { display: flex; gap: 2px; margin: 12px 0; }
.period-segment { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.15); }
.period-segment.filled { background: var(--primary-light); }
.service-table th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); border-bottom: 2px solid var(--border) !important; }
.service-table td { font-size: 13px; vertical-align: middle; }
.service-type-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }

/* ── AUTH PAGES ── */
.auth-page { min-height: 100vh; background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #312e81 100%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: var(--bg-card); border-radius: 20px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 24px 64px rgba(0,0,0,.3); }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .brand-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.auth-logo h3 { font-weight: 800; color: var(--text); }
.auth-logo p { color: var(--text-muted); font-size: 14px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-control { border-radius: 10px; border: 1.5px solid var(--border); font-size: 14px; padding: 10px 14px; transition: border .2s, box-shadow .2s; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); outline: none; }
.btn-primary { background: var(--primary); border: none; border-radius: 10px; font-weight: 600; padding: 11px 20px; font-size: 14px; transition: all .2s; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); border-radius: 8px; font-weight: 600; font-size: 13px; }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

/* ── ADMIN BADGE ── */
.badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }

/* ── TABLES ── */
.table { --bs-table-hover-bg: var(--bg); }
.table > :not(caption) > * > * { padding: 12px 14px; }
.table-card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-card .table { margin-bottom: 0; }

/* ── PAGE HEADER ── */
.page-header { padding: 24px 24px 0; display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h4 { font-weight: 800; margin: 0; font-size: 22px; }
.breadcrumb { margin-bottom: 4px; }
.breadcrumb-item { font-size: 12px; color: var(--text-muted); }
.breadcrumb-item.active { color: var(--text); font-weight: 600; }

/* ── INVOICE DETAIL ── */
.invoice-header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; border-radius: var(--radius) var(--radius) 0 0; padding: 32px; }
.invoice-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.inv-meta-item label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; opacity: .7; }
.inv-meta-item span { display: block; font-weight: 700; font-size: 15px; }
.invoice-totals td { font-size: 13px; }
.invoice-total-row td { font-size: 15px; font-weight: 800; background: var(--bg); }

/* ── PROFILE ── */
.profile-avatar-lg { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; font-size: 28px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* ── INSTALL PAGE ── */
.install-stepper { display: flex; gap: 0; margin-bottom: 32px; }
.install-step { flex: 1; text-align: center; padding: 12px; position: relative; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.install-step.active { color: var(--primary); }
.install-step.done { color: var(--success); }
.install-step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--border); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; margin-bottom: 6px; }
.install-step.active .install-step-num { background: var(--primary); color: #fff; }
.install-step.done .install-step-num { background: var(--success); color: #fff; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hp-sidebar { transform: translateX(-100%); }
  .hp-sidebar.open { transform: translateX(0); }
  .hp-main { margin-left: 0; }
  .btn-menu { display: flex; }
  .container-fluid { padding: 12px; }
  .page-header { padding: 16px 12px 0; }
  .stat-value { font-size: 20px; }
}
