/* ============================================================
   ISPro — Custom Stylesheet v1.0
   Author: Kapil Kumar Sharma
   ============================================================ */

:root {
  --primary:      #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light:#dbeafe;
  --sidebar-bg:   #0f172a;
  --sidebar-w:    260px;
  --topbar-h:     64px;
  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --info:         #0ea5e9;
  --text:         #0f172a;
  --subtext:      #64748b;
  --border:       #e2e8f0;
  --bg:           #f1f5f9;
  --card-bg:      #ffffff;
  --radius:       12px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
  --shadow-lg:    0 8px 30px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; margin: 0; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .3s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-icon { font-size: 24px; color: var(--primary); }
.brand-text { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -.5px; }

.sidebar-toggle-btn {
  background: none; border: none; color: rgba(255,255,255,.5);
  font-size: 18px; cursor: pointer; display: none;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.menu-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(255,255,255,.3);
  padding: 16px 10px 6px;
  text-transform: uppercase;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all .2s;
  margin-bottom: 2px;
}
.menu-item i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.menu-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu-item.active { background: var(--primary); color: #fff; }
.menu-item .badge { font-size: 10px; padding: 3px 7px; margin-left: auto; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .3s ease;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 0 var(--border);
}

.sidebar-toggle-main {
  background: none; border: 1px solid var(--border); color: var(--subtext);
  border-radius: 8px; padding: 6px 10px; cursor: pointer;
}
.sidebar-toggle-main:hover { background: var(--bg); }

.topbar-search .input-group {
  background: var(--bg);
  border-radius: 10px;
  border: 1.5px solid var(--border);
  width: 320px;
  overflow: hidden;
}
.topbar-search .input-group-text, .topbar-search .form-control {
  background: var(--bg); border: none; padding: 8px 12px;
}
.topbar-search .form-control:focus { box-shadow: none; }

.btn-icon {
  background: none; border: 1px solid var(--border); color: var(--subtext);
  border-radius: 10px; padding: 8px 12px; position: relative;
  transition: all .2s;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }

.notification-dot {
  position: absolute; top: 4px; right: 4px;
  font-size: 9px; padding: 2px 5px; border-radius: 10px;
}

.user-menu-btn {
  background: none; border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px;
  transition: all .2s;
}
.user-menu-btn:hover { background: var(--bg); }

.user-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.user-role { font-size: 11px; color: var(--subtext); }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content { padding: 24px; flex: 1; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 12px; flex-wrap: wrap;
}
.page-title { font-size: 22px; font-weight: 700; margin: 0; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--subtext); margin: 2px 0 0; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--border);
  padding: 16px 20px; font-weight: 600; font-size: 15px;
}
.card-body { padding: 20px; }

/* ============================================================
   STAT TILES
   ============================================================ */
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; display: flex;
  align-items: flex-start; gap: 16px; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; color: #2563eb; }
.stat-icon.green  { background: #d1fae5; color: #10b981; }
.stat-icon.orange { background: #fef3c7; color: #f59e0b; }
.stat-icon.red    { background: #fee2e2; color: #ef4444; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.cyan   { background: #e0f2fe; color: #0ea5e9; }

.stat-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--subtext); margin-top: 2px; }
.stat-change { font-size: 12px; margin-top: 6px; font-weight: 500; }
.stat-change.up   { color: #10b981; }
.stat-change.down { color: #ef4444; }

/* ============================================================
   TABLE
   ============================================================ */
.table { font-size: 13.5px; }
.table th { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--subtext); border-bottom: 2px solid var(--border); }
.table td { vertical-align: middle; border-color: var(--border); }
.table-hover > tbody > tr:hover { background: #f8faff; }

/* ============================================================
   BADGES
   ============================================================ */
.badge { font-weight: 500; font-size: 11px; padding: 4px 8px; border-radius: 6px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); outline: none;
}
.form-label { font-weight: 500; font-size: 13px; color: var(--text); margin-bottom: 6px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { border-radius: 8px; font-weight: 500; font-size: 13.5px; padding: 8px 16px; transition: all .2s; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 6px; }

/* ============================================================
   NOTIFICATIONS DROPDOWN
   ============================================================ */
.notification-dropdown {
  width: 300px; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 0; overflow: hidden;
}
.notification-dropdown .dropdown-header {
  padding: 14px 16px; font-weight: 600; border-bottom: 1px solid var(--border);
}

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.search-results-dropdown {
  position: fixed; top: 64px; left: calc(var(--sidebar-w) + 70px);
  width: 320px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 1050;
  max-height: 400px; overflow-y: auto;
}
.search-result-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.search-result-item:hover { background: var(--bg); }
.search-result-item:last-child { border-bottom: none; }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-container { position: relative; }

/* ============================================================
   CUSTOMER STATUS INDICATOR
   ============================================================ */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px;
}
.status-dot.active   { background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.25); }
.status-dot.inactive { background: #94a3b8; }
.status-dot.expired  { background: #f59e0b; }
.status-dot.suspended { background: #ef4444; }

/* ============================================================
   EXPIRY WARNING
   ============================================================ */
.expiry-critical { background: #fef2f2 !important; }
.expiry-warning  { background: #fffbeb !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle-btn { display: flex; }
  .search-results-dropdown { left: 16px; width: calc(100vw - 32px); }
}

@media (max-width: 576px) {
  .page-content { padding: 16px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }
}

/* ============================================================
   TOPBAR STATS PILLS
   ============================================================ */
.topbar-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  transition: border-color .2s;
}
.topbar-stat-pill:hover { border-color: #94a3b8; }
.stat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.6);
}
.stat-online .stat-dot { animation: pulseDot 2s ease-in-out infinite; }
@keyframes pulseDot {
  0%,100% { box-shadow: 0 0 0 2px rgba(16,185,129,.2); }
  50%      { box-shadow: 0 0 0 4px rgba(16,185,129,.35); }
}

/* ============================================================
   CUSTOMER VIEW — PROFILE BANNER
   ============================================================ */
.cust-banner {
  background: linear-gradient(135deg, #1a3a8f 0%, #2563eb 40%, #7c3aed 100%);
  border-radius: 14px;
  padding: 24px;
  color: #fff;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.cust-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}
.cust-photo {
  width: 70px; height: 70px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff;
  flex-shrink: 0; position: relative;
}
.cust-online-dot {
  position: absolute; bottom: 4px; right: 4px;
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff;
}
.cust-meta-label { font-size: 10px; opacity: .65; text-transform: uppercase; letter-spacing: .08em; }
.cust-meta-val   { font-size: 14px; font-weight: 600; }
.onu-card {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 12px 14px;
  backdrop-filter: blur(4px);
}
.onu-label { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.onu-val { font-size: 13px; font-weight: 600; }
.plan-ring-wrap {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}

/* ============================================================
   CUSTOMER TOOL BUTTONS
   ============================================================ */
.tool-section { margin-bottom: 16px; }
.tool-section-title {
  font-size: 13px; font-weight: 700; color: var(--primary);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.tool-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 500;
  border: 1.5px solid; cursor: pointer; text-decoration: none;
  transition: all .15s; white-space: nowrap;
}
.tool-btn-green  { color: #16a34a; border-color: #86efac; background: #f0fdf4; }
.tool-btn-green:hover  { background: #16a34a; color: #fff; }
.tool-btn-blue   { color: #2563eb; border-color: #93c5fd; background: #eff6ff; }
.tool-btn-blue:hover   { background: #2563eb; color: #fff; }
.tool-btn-orange { color: #d97706; border-color: #fcd34d; background: #fffbeb; }
.tool-btn-orange:hover { background: #d97706; color: #fff; }
.tool-btn-purple { color: #7c3aed; border-color: #c4b5fd; background: #f5f3ff; }
.tool-btn-purple:hover { background: #7c3aed; color: #fff; }
.tool-btn-red    { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }
.tool-btn-red:hover    { background: #dc2626; color: #fff; }
.tool-btn-cyan   { color: #0891b2; border-color: #a5f3fc; background: #ecfeff; }
.tool-btn-cyan:hover   { background: #0891b2; color: #fff; }
.tool-btn-gray   { color: #64748b; border-color: #cbd5e1; background: #f8fafc; }
.tool-btn-gray:hover   { background: #64748b; color: #fff; }

/* circular progress for plan days */
.ring-progress { transform: rotate(-90deg); }
.ring-track    { fill: none; stroke: rgba(255,255,255,.25); }
.ring-fill     { fill: none; stroke: #4ade80; stroke-linecap: round; transition: stroke-dashoffset .5s; }
.ring-text     { fill: #fff; font-weight: 800; font-size: 13px; dominant-baseline: middle; text-anchor: middle; }
.ring-sub      { fill: rgba(255,255,255,.7); font-size: 8px; text-anchor: middle; dominant-baseline: middle; }

/* ============================================================
   UTILITY
   ============================================================ */
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.text-xxs { font-size: 11px; }
.text-xs  { font-size: 12px; }
.text-sm  { font-size: 13px; }
.rounded-10 { border-radius: 10px !important; }
.rounded-12 { border-radius: 12px !important; }
.gap-6 { gap: 6px !important; }
.cursor-pointer { cursor: pointer; }

/* DataTables override */
div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_length select {
  border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px;
}
div.dataTables_wrapper div.dataTables_paginate .paginate_button {
  border-radius: 6px !important;
}
div.dataTables_wrapper div.dataTables_paginate .paginate_button.current {
  background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important;
}
