/* ============================================================
   Mooze CRM - Design System
   Rebranding later = change the variables below. Nothing else.
   ============================================================ */
:root {
  /* Brand - swap these 3 for AHMP colors/logo later */
  --brand-primary: #1E293B;      /* deep slate - primary actions, headers */
  --brand-accent: #6366F1;       /* indigo - links, active states, focus rings */
  --brand-accent-soft: #EEF2FF;  /* light indigo - subtle backgrounds */

  /* Semantic */
  --success: #059669;
  --success-soft: #ECFDF5;
  --warning: #D97706;
  --warning-soft: #FFFBEB;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;

  /* Neutrals */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-faint: #94A3B8;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout shell --- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--brand-primary);
  color: #E2E8F0;
  padding: 24px 16px;
  display: flex; flex-direction: column;
}
.sidebar .brand {
  font-size: 18px; font-weight: 700; color: #fff;
  margin-bottom: 32px; padding: 0 8px;
  letter-spacing: -0.02em;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  color: #CBD5E1; text-decoration: none;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar nav a.active { background: var(--brand-accent); color: #fff; }
.sidebar .user-box {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 16px; margin-top: 16px;
  font-size: 13px; color: var(--text-faint);
}
.sidebar .user-box a { color: #CBD5E1; }

.main { flex: 1; padding: 32px 40px; max-width: 1400px; }
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.02em; }
.page-header p { color: var(--text-muted); margin: 0; font-size: 14px; }

/* --- Cards / surfaces --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.card + .card { margin-top: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* --- Forms --- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=file],
input[type=search], select, textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px var(--brand-accent-soft);
}
.field { margin-bottom: 18px; }
.field-hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s;
}
.btn-primary { background: var(--brand-accent); color: #fff; }
.btn-primary:hover { background: #4F46E5; text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); text-decoration: none; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #FEE2E2; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em;
     color: var(--text-muted); padding: 10px 14px; border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* --- Badges / tags --- */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--brand-accent-soft); color: var(--brand-accent);
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--bg); color: var(--text-muted); }
.tag-pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px;
            font-weight: 600; background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); margin: 2px; }

/* --- Alerts --- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 20px; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--brand-accent-soft); color: var(--brand-accent); }

/* --- Auth screens --- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-primary) 0%, #334155 100%);
}
.auth-card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 40px; width: 100%; max-width: 380px;
}
.auth-card .brand { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.auth-card .subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.auth-card .btn-primary { width: 100%; justify-content: center; padding: 12px; }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 32px; margin-bottom: 12px; }
