/**
 * Digvara Admin CMS — Complete Design System & Modern SaaS Layout
 * Color Palette: Deep Teal (#072a25), Mint Accent (#2ec4b6), White (#ffffff), Slate Slate (#f8fafc)
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400..700;1,9..40,400..700&family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --teal-900: #05211c;
  --teal-800: #072a25;
  --teal-700: #0a3630;
  --teal-600: #0e4c43;
  --mint-500: #2ec4b6;
  --mint-400: #5eead4;
  --mint-100: #ccfbf1;
  --mint-50:  #f0fdf9;
  
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --sidebar-w: 260px;
  --sidebar-collapsed-w: 80px;
  --topbar-h: 70px;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(10, 45, 40, 0.05);
  --shadow-md: 0 10px 25px rgba(10, 45, 40, 0.04);
  --shadow-lg: 0 20px 40px rgba(10, 45, 40, 0.08);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Base Layout Wrapper */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--teal-800);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: width 0.25s ease, transform 0.25s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--teal-600) transparent;
}

.sidebar-brand {
  height: var(--topbar-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: #ffffff;
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name span.sub {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--mint-400);
  letter-spacing: 0.1em;
}

.sidebar-nav-container {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

.nav-section-title {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6ee7b7;
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.sidebar-nav-item a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  transform: translateX(2px);
}

.sidebar-nav-item.active a {
  background: var(--mint-500);
  color: var(--teal-900);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(46, 196, 182, 0.35);
}

.sidebar-nav-item a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 2.1;
}

.nav-badge-pill {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  background: #f43f5e;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 999px;
}

.sidebar-footer-user {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--mint-400);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name-label {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role-label {
  font-size: 11px;
  color: var(--mint-400);
  font-weight: 600;
}

/* Main Content Area */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}

/* Topbar */
.admin-topbar {
  height: var(--topbar-h);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
}

.sidebar-toggle-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.global-search-wrap {
  position: relative;
  width: 320px;
}

.global-search-input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 38px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: #f8fafc;
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.global-search-input:focus {
  border-color: var(--mint-500);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.15);
}

.global-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

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

.btn-view-live {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  background: var(--mint-50);
  border: 1px solid var(--mint-100);
  color: var(--teal-800);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-view-live:hover {
  background: var(--mint-100);
  border-color: var(--mint-500);
  transform: translateY(-1px);
}

.topbar-notifications-wrap {
  position: relative;
}

.topbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.topbar-icon-btn:hover {
  background: #f8fafc;
  color: var(--text-main);
}

.notif-badge-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

/* Main Container Content */
.admin-content-body {
  padding: 32px;
  flex: 1;
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title-box h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--teal-900);
  letter-spacing: -0.01em;
}

.page-title-box p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.page-actions-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.btn-admin-primary {
  background: var(--teal-800);
  color: #ffffff;
}

.btn-admin-primary:hover {
  background: var(--teal-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(7, 42, 37, 0.25);
}

.btn-admin-mint {
  background: var(--mint-500);
  color: var(--teal-900);
}

.btn-admin-mint:hover {
  background: var(--mint-400);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(46, 196, 182, 0.35);
}

.btn-admin-ghost {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-admin-ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-admin-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.btn-admin-danger:hover {
  background: #fee2e2;
}

.btn-admin-sm {
  padding: 6px 14px;
  font-size: 12px;
}

/* Stat Cards Grid */
.stats-grid-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-icon-pill {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-badge-trend {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-metric-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--teal-900);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-metric-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Card Container */
.admin-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  overflow: hidden;
}

.admin-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--teal-900);
}

.admin-card-body {
  padding: 24px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  padding: 12px 18px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--border-color);
}

.admin-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13.5px;
  color: var(--text-main);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #fcfdfd;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}

.badge-status.new { background: #e0f2fe; color: #0369a1; }
.badge-status.contacted { background: #fef3c7; color: #b45309; }
.badge-status.qualified { background: #ede9fe; color: #6d28d9; }
.badge-status.converted { background: #dcfce7; color: #15803d; }
.badge-status.closed { background: #f1f5f9; color: #64748b; }
.badge-status.published { background: #ecfdf5; color: #047857; }
.badge-status.draft { background: #fef2f2; color: #b91c1c; }
.badge-status.active { background: #e6f9f6; color: #086a5f; }
.badge-status.inactive { background: #f1f5f9; color: #475569; }

/* Forms */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.form-group-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-group-field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--mint-500);
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.15);
}

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

.form-help-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Modals */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 33, 28, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.admin-modal-backdrop.active {
  display: flex;
}

.admin-modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.admin-modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--teal-900);
}

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

.admin-modal-body {
  padding: 24px;
  flex: 1;
}

.admin-modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Alerts */
.toast-banner {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 600;
}

.toast-banner.success {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #15803d;
}

.toast-banner.error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

/* Responsive Styles */
@media (max-width: 991px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.mobile-open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .global-search-wrap {
    width: 200px;
  }
}

@media (max-width: 640px) {
  .admin-content-body {
    padding: 18px;
  }
  .admin-topbar {
    padding: 0 16px;
  }
  .global-search-wrap {
    display: none;
  }
}
