/* ===== RESET & VARIABLES ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #d1fae5;
  --secondary: #1e293b;
  --secondary-light: #334155;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --bg: #f1f5f9;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --text: #334155;
  --text-light: #64748b;
  --text-dark: #0f172a;
  --border: #e2e8f0;
  --sidebar-bg: #ffffff;
  --sidebar-width: 260px;
  --header-height: 64px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s ease;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Inter", sans-serif;
  color: var(--text);
  line-height: 1.6;
  background: var(--bg);
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}
img {
  max-width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  position: relative;
}
.login-back-link {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
}
.login-back-link a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  transition: var(--transition);
}
.login-back-link a:hover {
  color: #fff;
}
.login-container {
  width: 100%;
  max-width: 480px;
  padding: 20px;
}
.login-card {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 40px 35px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 25px;
}
.login-logo-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 12px;
}
.login-logo h1 {
  font-size: 1.5rem;
  color: var(--secondary);
  font-weight: 800;
}
.login-logo p {
  color: var(--text-light);
  font-size: 0.9rem;
}
.demo-credentials {
  background: var(--primary-light);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 15px;
  margin-bottom: 20px;
}
.demo-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 10px;
}
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.demo-item {
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.6);
}
.demo-item:hover {
  background: rgba(255, 255, 255, 1);
}
.demo-role {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--secondary);
}
.demo-email {
  display: block;
  font-size: 0.72rem;
  color: var(--info);
}
.login-form .form-group {
  margin-bottom: 18px;
}
.login-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.input-icon {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  background: var(--bg);
}
.input-icon:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  background: #fff;
}
.input-icon .icon {
  padding: 0 12px;
  font-size: 1rem;
  opacity: 0.5;
}
.input-icon input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 12px 12px 0;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  color: var(--text-dark);
}
.toggle-pw {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 12px;
  font-size: 1rem;
  opacity: 0.5;
  transition: var(--transition);
}
.toggle-pw:hover {
  opacity: 1;
}
.btn-login {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}
.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 15px;
  font-size: 0.9rem;
  font-weight: 500;
}
.alert-error {
  background: var(--danger-light);
  color: #991b1b;
}
.alert-success {
  background: var(--primary-light);
  color: #065f46;
}
.alert-info {
  background: var(--info-light);
  color: #1e40af;
}

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

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.sidebar-logo-text h2 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.2;
}
.sidebar-logo-text span {
  font-size: 0.7rem;
  color: var(--text-light);
}
.sidebar-role {
  margin: 15px 20px 5px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}
.sidebar-nav {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
}
.nav-item:hover {
  background: var(--bg);
  color: var(--text-dark);
}
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}
.nav-item .nav-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}
.sidebar-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border);
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 0;
  transition: var(--transition);
}
.sidebar-footer a:hover {
  opacity: 0.8;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ===== TOP HEADER ===== */
.top-header {
  height: var(--header-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  padding: 5px;
  color: var(--text);
}
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 15px;
}
.header-search input {
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  width: 200px;
  color: var(--text);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-notif {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
}
.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  transition: var(--transition);
}
.header-user:hover {
  background: var(--bg);
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}
.user-info {
  text-align: right;
}
.user-info .name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
}
.user-info .status {
  font-size: 0.7rem;
  color: var(--primary);
}

/* ===== PAGE CONTENT ===== */
.page-content {
  padding: 25px 30px;
}
.page-greeting {
  margin-bottom: 25px;
}
.page-greeting h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
}
.page-greeting p {
  color: var(--text-light);
  font-size: 0.9rem;
}
.page-greeting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}
.page-actions {
  display: flex;
  gap: 10px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
}
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--border);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
}
.btn-info {
  background: var(--info);
  color: #fff;
}
.btn-info:hover {
  background: #2563eb;
}
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background: #d97706;
}
.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
}
.btn-xs {
  padding: 5px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
}
.btn-icon {
  padding: 8px;
  border-radius: 8px;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 25px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.stat-icon.blue {
  background: var(--info-light);
}
.stat-icon.green {
  background: var(--primary-light);
}
.stat-icon.orange {
  background: var(--accent-light);
}
.stat-icon.purple {
  background: var(--purple-light);
}
.stat-icon.red {
  background: var(--danger-light);
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-light);
}
.stat-change {
  font-size: 0.78rem;
  font-weight: 600;
}
.stat-change.up {
  color: var(--primary);
}
.stat-change.down {
  color: var(--danger);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
}
.card-header p {
  font-size: 0.8rem;
  color: var(--text-light);
}
.card-body {
  padding: 22px;
}
.card-body.no-pad {
  padding: 0;
}

/* ===== GRID LAYOUTS ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
}
.grid-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

/* ===== TABLES ===== */
.data-table {
  width: 100%;
}
.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.data-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table tr:hover {
  background: #f8fafc;
}
.data-table .actions {
  display: flex;
  gap: 6px;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.73rem;
  font-weight: 600;
}
.badge-new {
  background: var(--info-light);
  color: #1e40af;
}
.badge-contacted {
  background: var(--accent-light);
  color: #92400e;
}
.badge-site_visit {
  background: var(--purple-light);
  color: #6d28d9;
}
.badge-quoted {
  background: #fce7f3;
  color: #9d174d;
}
.badge-negotiation {
  background: #fff7ed;
  color: #c2410c;
}
.badge-converted,
.badge-paid,
.badge-completed,
.badge-received {
  background: var(--primary-light);
  color: #065f46;
}
.badge-lost,
.badge-cancelled,
.badge-overdue {
  background: var(--danger-light);
  color: #991b1b;
}
.badge-draft {
  background: #f3f4f6;
  color: #6b7280;
}
.badge-sent,
.badge-ordered {
  background: var(--info-light);
  color: #1e40af;
}
.badge-partial,
.badge-in_progress,
.badge-scheduled {
  background: var(--accent-light);
  color: #92400e;
}
.badge-on_hold {
  background: var(--purple-light);
  color: #6d28d9;
}

/* ===== FORMS ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--bg-white);
  color: var(--text-dark);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}
.form-group .form-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

/* ===== CHART PLACEHOLDER ===== */
.chart-container {
  position: relative;
  height: 280px;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 240px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
}
.chart-bar-group {
  flex: 1;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  justify-content: center;
}
.chart-bar {
  width: 20px;
  border-radius: 4px 4px 0 0;
  transition: var(--transition);
  cursor: pointer;
}
.chart-bar:hover {
  opacity: 0.8;
}
.chart-bar.expense {
  background: var(--danger);
}
.chart-bar.revenue {
  background: var(--primary);
}
.chart-labels {
  display: flex;
  justify-content: space-around;
  padding-top: 8px;
}
.chart-labels span {
  font-size: 0.75rem;
  color: var(--text-light);
}
.chart-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding-top: 12px;
}
.chart-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-light);
}
.chart-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* ===== LEAD SOURCES DONUT ===== */
.donut-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background: conic-gradient(
    var(--primary) 0% 35%,
    var(--info) 35% 60%,
    var(--accent) 60% 80%,
    var(--danger) 80% 92%,
    var(--purple) 92% 100%
  );
  position: relative;
}
.donut-chart::after {
  content: "";
  position: absolute;
  top: 35px;
  left: 35px;
  right: 35px;
  bottom: 35px;
  background: var(--bg-card);
  border-radius: 50%;
}
.source-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}
.source-item .source-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.source-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ===== RECENT LEADS TABLE ===== */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}
.table-header h3 {
  font-size: 1rem;
  font-weight: 700;
}
.table-header a {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
}

/* ===== LOW STOCK ALERTS ===== */
.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.alert-item:last-child {
  border-bottom: none;
}
.alert-item .item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
}
.alert-item .item-detail {
  font-size: 0.78rem;
  color: var(--text-light);
}
.alert-item .item-stock {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-light);
  padding: 3px 10px;
  border-radius: 50px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 15px 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filter-bar select,
.filter-bar input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--bg-white);
  color: var(--text);
}
.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: var(--primary);
}
.filter-bar .search-input {
  min-width: 220px;
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}
.modal {
  background: var(--bg-white);
  border-radius: var(--radius);
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 5px;
}
.modal-body {
  padding: 25px;
}
.modal-footer {
  padding: 15px 25px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  gap: 5px;
  justify-content: center;
  padding: 20px;
  align-items: center;
}
.pagination a,
.pagination span {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid var(--border);
}
.pagination a:hover {
  background: var(--bg);
}
.pagination .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.tab-btn {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab-btn:hover {
  color: var(--text-dark);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-light);
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}
.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* ===== SETTINGS ===== */
.settings-section {
  margin-bottom: 30px;
}
.settings-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-2,
  .grid-equal {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .menu-toggle {
    display: block;
  }
  .page-content {
    padding: 20px 15px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .filter-bar {
    flex-direction: column;
  }
  .page-greeting-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-search {
    display: none;
  }
  .top-header {
    padding: 0 15px;
  }
}
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .demo-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== TABLE RESPONSIVE ===== */
.table-responsive {
  overflow-x: auto;
}

/* ===== DETAIL VIEW ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.detail-item {
  margin-bottom: 12px;
}
.detail-item .detail-label {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.detail-item .detail-value {
  font-size: 0.95rem;
  color: var(--text-dark);
  font-weight: 500;
  margin-top: 2px;
}

/* ===== ACTIVITY TIMELINE ===== */
.timeline {
  padding: 10px 0;
}
.timeline-item {
  display: flex;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child {
  border-bottom: none;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 5px;
  flex-shrink: 0;
}
.timeline-content {
  flex: 1;
}
.timeline-content .timeline-text {
  font-size: 0.85rem;
  color: var(--text);
}
.timeline-content .timeline-date {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 3px;
}

/* ===== INVOICE PRINT ===== */
.invoice-preview {
  max-width: 800px;
  margin: 0 auto;
}
.invoice-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
}
.invoice-company h2 {
  font-size: 1.3rem;
  color: var(--primary-dark);
}
.invoice-company p {
  font-size: 0.85rem;
  color: var(--text-light);
}
.invoice-meta {
  text-align: right;
}
.invoice-meta h3 {
  font-size: 1.5rem;
  color: var(--text-dark);
}
.invoice-meta p {
  font-size: 0.85rem;
  color: var(--text-light);
}
.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
.invoice-party h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 8px;
}
.invoice-party p {
  font-size: 0.9rem;
  color: var(--text-dark);
}
.invoice-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.invoice-totals .total-row {
  display: flex;
  gap: 40px;
  font-size: 0.9rem;
}
.invoice-totals .total-row.grand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-dark);
  border-top: 2px solid var(--text-dark);
  padding-top: 8px;
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99;
}
@media (max-width: 768px) {
  .sidebar.open ~ .sidebar-overlay {
    display: block;
  }
}

/* ===== NOTIFICATION DROPDOWN ===== */
.notif-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 200;
  max-height: 420px;
  overflow-y: auto;
}
.notif-dropdown.active {
  display: block;
}
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.notif-list {
  max-height: 350px;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}
.notif-item:hover {
  background: var(--bg);
}
.notif-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.notif-content {
  flex: 1;
  min-width: 0;
}
.notif-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
}
.notif-msg {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-time {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* ===== BADGE ADDITIONS ===== */
.badge-accepted {
  background: var(--primary-light);
  color: #065f46;
}
.badge-rejected {
  background: var(--danger-light);
  color: #991b1b;
}
.badge-expired {
  background: #f3f4f6;
  color: #6b7280;
}

/* ===== PRINT STYLES ===== */
@media print {
  .sidebar,
  .top-header,
  .page-actions,
  .filter-bar,
  .form-actions,
  .btn,
  .sidebar-overlay {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
  }
  .page-content {
    padding: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
  body {
    background: #fff !important;
  }
}

/* ===== PROFESSIONAL INVOICE PRINT ===== */
.inv-print {
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
}
.inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 25px;
  border-bottom: 3px solid var(--primary);
  margin-bottom: 25px;
}
.inv-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.inv-logo {
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--primary), #ea580c);
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-brand h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 2px;
}
.inv-brand p {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.5;
}
.inv-title-block {
  text-align: right;
}
.inv-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--secondary);
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.inv-meta-table {
  font-size: 0.82rem;
}
.inv-meta-table td {
  padding: 2px 0;
}
.inv-meta-table td:first-child {
  color: var(--text-light);
  padding-right: 12px;
  text-align: right;
}
.inv-meta-table td:last-child {
  color: var(--text-dark);
}
.inv-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
}
.inv-status-paid {
  background: #d1fae5;
  color: #065f46;
}
.inv-status-partial {
  background: #fef3c7;
  color: #92400e;
}
.inv-status-sent {
  background: #dbeafe;
  color: #1e40af;
}
.inv-status-draft {
  background: #f3f4f6;
  color: #6b7280;
}
.inv-status-overdue {
  background: #fee2e2;
  color: #991b1b;
}
.inv-status-cancelled {
  background: #f3f4f6;
  color: #6b7280;
}

.inv-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
.inv-party h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  margin-bottom: 8px;
  font-weight: 600;
}
.inv-party-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.inv-party p {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.6;
}
.inv-party-right {
  text-align: right;
}
.inv-pay-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inv-pay-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 6px;
}
.inv-pay-row.paid {
  background: #d1fae5;
}
.inv-pay-row.balance {
  background: #fee2e2;
  font-weight: 700;
}
.inv-pay-val {
  font-weight: 700;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 25px;
}
.inv-table thead {
  background: var(--secondary);
  color: #fff;
}
.inv-table th {
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.inv-th-num {
  width: 40px;
  text-align: center;
}
.inv-th-right {
  text-align: right;
}
.inv-table tbody tr {
  border-bottom: 1px solid var(--border);
}
.inv-table tbody tr:nth-child(even) {
  background: #f8fafc;
}
.inv-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
}
.inv-td-num {
  text-align: center;
  color: var(--text-light);
}
.inv-td-desc {
  font-weight: 500;
  color: var(--text-dark);
}
.inv-td-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.inv-totals-wrap {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 30px;
}
.inv-notes-area {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-light);
}
.inv-notes-area h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text);
  margin-bottom: 6px;
}
.inv-notes-area p {
  line-height: 1.6;
}
.inv-terms {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.inv-totals {
  min-width: 280px;
}
.inv-total-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 0.88rem;
}
.inv-total-row span:first-child {
  color: var(--text-light);
}
.inv-total-row span:last-child {
  font-weight: 600;
  color: var(--text-dark);
  font-variant-numeric: tabular-nums;
}
.inv-total-row.discount span:last-child {
  color: var(--accent);
}
.inv-total-row.grand {
  background: var(--secondary);
  color: #fff;
  border-radius: 8px;
  font-size: 1rem;
  margin-top: 6px;
}
.inv-total-row.grand span {
  color: #fff;
  font-weight: 800;
}
.inv-total-row.paid-row {
  background: #d1fae5;
  border-radius: 6px;
  margin-top: 4px;
}
.inv-total-row.paid-row span:last-child {
  color: #065f46;
}
.inv-total-row.balance-row {
  background: #fee2e2;
  border-radius: 6px;
  margin-top: 4px;
}
.inv-total-row.balance-row span:last-child {
  color: #991b1b;
  font-weight: 800;
}

.inv-footer {
  text-align: center;
  padding-top: 25px;
  border-top: 2px solid var(--border);
}
.inv-footer p {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
}
.inv-footer .inv-footer-company {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: 400;
}

/* ===== PRINT OVERRIDES ===== */
@media print {
  body {
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .sidebar,
  .top-header,
  .no-print,
  .sidebar-overlay {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
  }
  .page-content {
    padding: 0 !important;
  }
  .invoice-print-card {
    box-shadow: none !important;
    border: none !important;
  }
  .inv-print {
    padding: 20px;
  }
  .inv-header {
    border-bottom-color: #333 !important;
  }
  .inv-table thead {
    background: #1e293b !important;
    -webkit-print-color-adjust: exact;
  }
  .inv-total-row.grand {
    background: #1e293b !important;
    -webkit-print-color-adjust: exact;
  }
  .inv-total-row.paid-row {
    background: #d1fae5 !important;
    -webkit-print-color-adjust: exact;
  }
  .inv-total-row.balance-row {
    background: #fee2e2 !important;
    -webkit-print-color-adjust: exact;
  }
  .inv-pay-row.paid {
    background: #d1fae5 !important;
    -webkit-print-color-adjust: exact;
  }
  .inv-pay-row.balance {
    background: #fee2e2 !important;
    -webkit-print-color-adjust: exact;
  }
  .inv-table tbody tr:nth-child(even) {
    background: #f8fafc !important;
    -webkit-print-color-adjust: exact;
  }
  .inv-status {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}


/* ===== ETERNITY CLAIM SOLUTIONS — ADDITIONAL STYLES ===== */

/* Stage badges */
.badge-document_collection { background: var(--info-light); color: #1e40af; }
.badge-expert_review        { background: var(--purple-light); color: #6d28d9; }
.badge-registration         { background: var(--accent-light); color: #92400e; }
.badge-in_progress          { background: #fff7ed; color: #c2410c; }
.badge-escalated            { background: #fee2e2; color: #991b1b; }
.badge-settled              { background: var(--primary-light); color: #065f46; }
.badge-closed               { background: #f3f4f6; color: #6b7280; }
.badge-dropped              { background: #f3f4f6; color: #9ca3af; }

/* Lead status badges */
.badge-called               { background: var(--accent-light); color: #92400e; }
.badge-interested           { background: var(--purple-light); color: #6d28d9; }
.badge-documents_requested  { background: #fce7f3; color: #9d174d; }
.badge-under_review         { background: #fff7ed; color: #c2410c; }
.badge-registered           { background: var(--info-light); color: #1e40af; }
.badge-not_interested       { background: #f3f4f6; color: #9ca3af; }

/* Stage pipeline */
.stage-pipeline { display: flex; gap: 0; margin: 20px 0; overflow-x: auto; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
.stage-step { flex: 1; min-width: 100px; padding: 12px 8px; text-align: center; font-size: 0.72rem; font-weight: 600; background: var(--bg); border-right: 1px solid var(--border); color: var(--text-light); transition: var(--transition); }
.stage-step:last-child { border-right: none; }
.stage-step.done   { background: var(--primary-light); color: var(--primary-dark); }
.stage-step.active { background: var(--primary); color: #fff; }
.stage-step.danger { background: var(--danger-light); color: #991b1b; }

/* Document card */
.doc-card { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); margin-bottom: 8px; transition: var(--transition); }
.doc-card:hover { border-color: var(--primary); background: var(--primary-light); }
.doc-icon { font-size: 1.5rem; flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; font-size: 0.88rem; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 0.75rem; color: var(--text-light); margin-top: 2px; }

/* Communication entry */
.comm-entry { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.comm-entry:last-child { border-bottom: none; }
.comm-entry:hover { background: #f8fafc; }

/* Receipt print */
.receipt-print { max-width: 680px; margin: 0 auto; padding: 40px; }

/* Agreement print */
@media print {
  .no-print { display: none !important; }
  .sidebar, .top-header, .sidebar-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .admin-layout { display: block !important; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* Claim amount highlight */
.claim-amount-big {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
}

/* Case view grid */
.case-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .case-view-grid { grid-template-columns: 1fr; }
}

/* Tabs link style (for anchor tags used as tabs) */
a.tab-btn {
  display: inline-block;
  text-decoration: none;
}

/* Compact form row */
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
}
@media (max-width: 768px) {
  .form-row-3 { grid-template-columns: 1fr; }
}

/* Status indicator dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.green  { background: var(--primary); }
.status-dot.orange { background: var(--accent); }
.status-dot.red    { background: var(--danger); }
.status-dot.blue   { background: var(--info); }

/* Scrollable timeline */
.timeline-scroll {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Placeholder hint chips */
.placeholder-chip {
  display: inline-block;
  margin: 3px;
  padding: 4px 10px;
  background: var(--info-light);
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: monospace;
  transition: var(--transition);
}
.placeholder-chip:hover {
  background: #1e40af;
  color: #fff;
}

/* Financial summary box */
.fin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.fin-item { text-align: center; }
.fin-item .fin-val { font-size: 1.2rem; font-weight: 800; color: var(--text-dark); }
.fin-item .fin-lbl { font-size: 0.75rem; color: var(--text-light); margin-top: 2px; }

/* Permissions table */
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th, .perm-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.85rem; text-align: center; }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.perm-table th { background: var(--bg); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); }
.perm-table tr:hover td { background: #f8fafc; }
