/* ============================================================
   NexaHost Theme — Main Stylesheet
   FossBilling Client Area Theme
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-50: #EFF6FF;
  --blue-100: #DBEAFE;
  --blue-200: #BFDBFE;
  --blue-400: #60A5FA;
  --blue-500: #3B82F6;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-800: #1E40AF;
  --blue-900: #1E3A8A;
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;
  --white: #FFFFFF;
  --font: 'Sora', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.08), 0 2px 6px rgba(15,23,42,0.05);
  --shadow-blue: 0 4px 20px rgba(37,99,235,0.18);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--slate-50);
  color: var(--slate-800);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── TOPBAR ─── */
.nh-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--slate-100);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nh-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nh-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nh-logo-icon {
  width: 34px;
  height: 34px;
  background: var(--blue-600);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nh-logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.3px;
}

.nh-logo-text span { color: var(--blue-600); }

.nh-topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nh-topbar-nav a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--slate-600);
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nh-topbar-nav a:hover { background: var(--slate-100); color: var(--slate-900); text-decoration: none; }
.nh-topbar-nav a.active { background: var(--blue-50); color: var(--blue-700); }

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

/* ─── BUTTONS ─── */
.nh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  border: none;
  line-height: 1;
}

.nh-btn:hover { text-decoration: none; }

.nh-btn-primary {
  background: var(--blue-600);
  color: white;
  box-shadow: var(--shadow-blue);
}
.nh-btn-primary:hover { background: var(--blue-700); color: white; }

.nh-btn-ghost {
  background: none;
  border: 1px solid var(--slate-200);
  color: var(--slate-600);
}
.nh-btn-ghost:hover { background: var(--slate-100); border-color: var(--slate-300); color: var(--slate-800); }

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

.nh-btn-danger { background: #FEE2E2; color: #991B1B; }
.nh-btn-danger:hover { background: #FECACA; color: #7F1D1D; }

/* ─── AVATAR ─── */
.nh-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
}

/* ─── PAGE LAYOUT ─── */
.nh-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  min-height: calc(100vh - 64px - 60px);
}

.nh-layout-full {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px;
}

/* ─── SIDEBAR ─── */
.nh-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 96px;
  height: fit-content;
}

.nh-sidebar-section {
  margin: 14px 0 4px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-400);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nh-sidebar-section:first-child { margin-top: 0; }

.nh-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--slate-600);
  text-decoration: none;
  transition: all 0.15s ease;
}
.nh-sidebar-link:hover { background: var(--white); color: var(--slate-900); text-decoration: none; }
.nh-sidebar-link.active { background: var(--blue-50); color: var(--blue-700); }
.nh-sidebar-link .nh-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.65; }
.nh-sidebar-link.active .nh-icon { opacity: 1; }

.nh-sidebar-badge {
  margin-left: auto;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}

.nh-sidebar-badge-red {
  background: #FEE2E2;
  color: #991B1B;
}

/* ─── MAIN ─── */
.nh-main { min-width: 0; }

/* ─── PAGE HEADER ─── */
.nh-page-header { margin-bottom: 24px; }

.nh-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--slate-400);
  margin-bottom: 6px;
  font-family: var(--mono);
}
.nh-breadcrumb a { color: var(--slate-400); text-decoration: none; }
.nh-breadcrumb a:hover { color: var(--blue-600); }

.nh-page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.4px;
}

.nh-page-subtitle {
  font-size: 14px;
  color: var(--slate-500);
  margin-top: 4px;
}

/* ─── CARDS ─── */
.nh-card {
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
  transition: box-shadow 0.2s;
}
.nh-card:hover { box-shadow: var(--shadow-md); }
.nh-card:last-child { margin-bottom: 0; }

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

.nh-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--slate-800);
  letter-spacing: -0.2px;
}

.nh-card-body { padding: 22px; }

/* ─── STAT CARDS ─── */
.nh-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.nh-stat-card {
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.nh-stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--blue-200); }

.nh-stat-icon {
  width: 40px;
  height: 40px;
  background: var(--blue-50);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  float: right;
  margin-top: -4px;
  color: var(--blue-500);
}
.nh-stat-icon svg { width: 20px; height: 20px; }

.nh-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nh-stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-400);
}

.nh-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.8px;
  font-family: var(--mono);
  line-height: 1;
  margin-bottom: 6px;
}

.nh-stat-meta { font-size: 12px; color: var(--slate-400); }
.nh-stat-meta .up { color: #10B981; font-weight: 600; }
.nh-stat-meta .warn { color: #F59E0B; font-weight: 600; }
.nh-stat-meta .danger { color: #EF4444; font-weight: 600; }

/* ─── SECTION HEADER ─── */
.nh-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.nh-section-title { font-size: 16px; font-weight: 600; color: var(--slate-800); letter-spacing: -0.2px; }

/* ─── ALERT BANNER ─── */
.nh-alert {
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.nh-alert-blue {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: white;
  position: relative;
  overflow: hidden;
}

.nh-alert-blue::after {
  content: '';
  position: absolute;
  top: -40px; right: -20px;
  width: 140px; height: 140px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}

.nh-alert-warning {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}

.nh-alert-danger {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

.nh-alert-success {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

.nh-alert-icon {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nh-alert-content { flex: 1; }
.nh-alert-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.nh-alert-text { font-size: 13px; opacity: 0.88; }

/* ─── STATUS BADGES ─── */
.nh-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.nh-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.nh-badge-active { background: #D1FAE5; color: #065F46; }
.nh-badge-pending { background: #FEF3C7; color: #92400E; }
.nh-badge-suspended { background: #FEE2E2; color: #991B1B; }
.nh-badge-cancelled { background: var(--slate-100); color: var(--slate-500); }
.nh-badge-unpaid { background: #FEF3C7; color: #92400E; }
.nh-badge-paid { background: #D1FAE5; color: #065F46; }
.nh-badge-open { background: var(--blue-100); color: var(--blue-700); }
.nh-badge-closed { background: var(--slate-100); color: var(--slate-500); }

/* ─── TABLE ─── */
.nh-table { width: 100%; border-collapse: collapse; }

.nh-table thead th {
  padding: 10px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-100);
  white-space: nowrap;
}

.nh-table tbody tr {
  border-bottom: 1px solid var(--slate-50);
  transition: background 0.1s;
}
.nh-table tbody tr:last-child { border-bottom: none; }
.nh-table tbody tr:hover { background: var(--slate-50); }

.nh-table tbody td {
  padding: 12px 20px;
  font-size: 13.5px;
  color: var(--slate-700);
  vertical-align: middle;
}

.nh-mono { font-family: var(--mono); font-size: 12px; color: var(--blue-600); font-weight: 500; }
.nh-bold { font-weight: 600; color: var(--slate-800); }
.nh-amount { font-family: var(--mono); font-weight: 600; color: var(--slate-800); }

/* ─── SERVICE CARDS ─── */
.nh-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.nh-service-card {
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}
.nh-service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--blue-500);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.nh-service-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.nh-service-card:hover::before { opacity: 1; }
.nh-service-card.nh-service-active::before { opacity: 1; }

.nh-service-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }

.nh-service-icon {
  width: 44px; height: 44px;
  background: var(--blue-50);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-600);
}
.nh-service-icon svg { width: 22px; height: 22px; }

.nh-service-name { font-size: 15px; font-weight: 600; color: var(--slate-800); margin-bottom: 2px; letter-spacing: -0.2px; }
.nh-service-domain { font-size: 12px; color: var(--blue-600); font-family: var(--mono); font-weight: 500; }

.nh-service-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--slate-100);
}

.nh-service-meta-item label {
  display: block;
  font-size: 10px;
  color: var(--slate-400);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.nh-service-meta-item span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--slate-700);
  font-family: var(--mono);
}

/* ─── PROGRESS BAR ─── */
.nh-progress-wrap { margin-top: 12px; }
.nh-progress-info { display: flex; justify-content: space-between; font-size: 11px; color: var(--slate-500); margin-bottom: 4px; }
.nh-progress-bar { height: 4px; background: var(--slate-100); border-radius: 10px; overflow: hidden; }
.nh-progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--blue-400)); border-radius: 10px; }

/* ─── TICKET ITEMS ─── */
.nh-ticket-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--slate-50);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background 0.1s;
  cursor: pointer;
}
.nh-ticket-item:last-child { border-bottom: none; }
.nh-ticket-item:hover { background: var(--slate-50); }

.nh-ticket-prio { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.nh-prio-high { background: #EF4444; }
.nh-prio-medium { background: #F59E0B; }
.nh-prio-low { background: #10B981; }

.nh-ticket-content { flex: 1; min-width: 0; }
.nh-ticket-subject { font-size: 14px; font-weight: 500; color: var(--slate-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nh-ticket-meta { font-size: 11.5px; color: var(--slate-400); margin-top: 1px; font-family: var(--mono); }

/* ─── FORMS ─── */
.nh-form-group { margin-bottom: 20px; }

.nh-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 6px;
}

.nh-input, .nh-select, .nh-textarea {
  width: 100%;
  padding: 9px 14px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--slate-800);
  outline: none;
  transition: all 0.15s ease;
  -webkit-appearance: none;
}

.nh-input:focus, .nh-select:focus, .nh-textarea:focus {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.nh-textarea { resize: vertical; min-height: 100px; }

.nh-input-error {
  border-color: #EF4444 !important;
}

.nh-field-error {
  font-size: 12px;
  color: #EF4444;
  margin-top: 4px;
}

.nh-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── PAGINATION ─── */
.nh-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-100);
}
.nh-pagination-info { font-size: 12px; color: var(--slate-400); }
.nh-pagination-btns { display: flex; gap: 6px; }

/* ─── EMPTY STATE ─── */
.nh-empty {
  padding: 48px 20px;
  text-align: center;
}
.nh-empty-icon {
  width: 56px; height: 56px;
  background: var(--slate-100);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--slate-400);
}
.nh-empty-icon svg { width: 28px; height: 28px; }
.nh-empty-title { font-size: 15px; font-weight: 600; color: var(--slate-700); margin-bottom: 6px; }
.nh-empty-text { font-size: 13px; color: var(--slate-400); margin-bottom: 20px; }

/* ─── FOOTER ─── */
.nh-footer {
  background: var(--white);
  border-top: 1px solid var(--slate-100);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--slate-400);
}
.nh-footer a { color: var(--blue-500); text-decoration: none; }
.nh-footer a:hover { text-decoration: underline; }

/* ─── LOGIN PAGE ─── */
.nh-auth-page {
  min-height: 100vh;
  background: var(--slate-50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.nh-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.nh-auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  text-decoration: none;
}

.nh-auth-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--slate-900);
  text-align: center;
  margin-bottom: 6px;
}

.nh-auth-sub {
  font-size: 14px;
  color: var(--slate-500);
  text-align: center;
  margin-bottom: 28px;
}

/* ─── FLASH MESSAGES ─── */
.nh-flash-success {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 16px;
}

.nh-flash-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 16px;
}

/* ─── INVOICE DETAIL ─── */
.nh-invoice-header {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: white;
  padding: 28px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.nh-invoice-number {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.5px;
}

.nh-invoice-total {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--mono);
  margin-top: 6px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .nh-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nh-layout { grid-template-columns: 1fr; padding: 16px; }
  .nh-sidebar { display: none; }
  .nh-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .nh-topbar-nav { display: none; }
  .nh-topbar-inner { padding: 0 16px; }
  .nh-services-grid { grid-template-columns: 1fr; }
  .nh-form-row { grid-template-columns: 1fr; }
  .nh-footer { flex-direction: column; gap: 8px; text-align: center; }
  .nh-layout-full { padding: 16px; }
}
