/* ═══════════════════════════════════════════
   SIXTH SENSE — SHARED STYLES
════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --bg:      #f5f4f0;
  --surface: #ffffff;
  --surf2:   #f0efe9;
  --surf3:   #e8e6df;
  --border:  #e2e0d8;
  --border2: #ccc9bf;
  --text:    #1c1b18;
  --text2:   #6a6760;
  --text3:   #a09d97;
  --accent:  #1d4ed8;
  --acc2:    #eff4ff;
  --acc3:    #bfdbfe;
  --purple:  #7c3aed;
  --green:   #15803d;
  --grn2:    #f0fdf4;
  --grn3:    #bbf7d0;
  --red:     #dc2626;
  --red2:    #fef2f2;
  --red3:    #fecaca;
  --amber:   #b45309;
  --amb2:    #fffbeb;
  --amb3:    #fcd34d;
  --r:       10px;
  --rl:      14px;
  --rxl:     20px;
  --sh:      0 1px 4px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04);
  --shm:     0 4px 14px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shl:     0 12px 40px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --nav-h:   58px;
  --side-w:  62px;
}

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

html { font-size: 15px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── NAV ── */
.ss-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px 0 16px;
  gap: 12px;
  z-index: 100;
  box-shadow: var(--sh);
}

.ss-nav-brand {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; color: inherit;
  flex-shrink: 0;
}

.ss-logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ss-logo svg { width: 17px; height: 17px; fill: #fff; }

.ss-brand-name {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  letter-spacing: -.3px;
  white-space: nowrap;
}
.ss-brand-name span {
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ss-nav-sep { flex: 1; }

.ss-nav-user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text2);
}

.ss-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
}

/* ── SIDEBAR ── */
.ss-sidebar {
  position: fixed; top: var(--nav-h); left: 0; bottom: 0;
  width: var(--side-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 4px;
  z-index: 90;
}

.ss-sidebar-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  width: 48px; padding: 8px 0;
  border-radius: var(--r);
  cursor: pointer;
  border: none; background: transparent;
  text-decoration: none;
  transition: all .13s;
  color: var(--text3);
  font-family: inherit;
}
.ss-sidebar-btn:hover { background: var(--surf2); color: var(--text); }
.ss-sidebar-btn.active { background: var(--acc2); color: var(--accent); }
.ss-sidebar-btn .sb-icon { font-size: 19px; }
.ss-sidebar-btn .sb-label { font-size: 10px; font-weight: 500; letter-spacing: .2px; }
.ss-sidebar-spacer { flex: 1; }

/* ── MAIN CONTENT ── */
.ss-main {
  margin-top: var(--nav-h);
  margin-left: var(--side-w);
  min-height: calc(100vh - var(--nav-h));
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .13s;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
}
.btn-primary   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover   { background: #1e40af; border-color: #1e40af; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border2); }
.btn-secondary:hover { background: var(--surf2); }
.btn-ghost     { background: transparent; color: var(--text2); }
.btn-ghost:hover     { background: var(--surf2); color: var(--text); }
.btn-danger    { background: var(--red2); color: var(--red); border-color: var(--red3); }
.btn-danger:hover    { background: #fee2e2; }
.btn-success   { background: var(--green); color: #fff; }
.btn-success:hover   { background: #166534; }
.btn-sm  { padding: 5px 11px; font-size: 12px; }
.btn-xs  { padding: 3px 8px;  font-size: 11.5px; }
.btn-icon { padding: 7px; border-radius: var(--r); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  box-shadow: var(--sh);
}

/* ── INPUTS ── */
.inp {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border2);
  border-radius: var(--r);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .13s, background .13s;
}
.inp:focus { border-color: var(--accent); background: var(--surface); }
.inp::placeholder { color: var(--text3); }
textarea.inp { resize: vertical; min-height: 72px; line-height: 1.6; }
select.inp {
  cursor: pointer; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a09d97' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 32px;
}

/* ── LABELS ── */
.field-label {
  display: block;
  font-size: 11.5px; font-weight: 600;
  color: var(--text3);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 5px;
}

/* ── TOGGLE ── */
.toggle { position: relative; width: 36px; height: 20px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border2); border-radius: 20px;
  cursor: pointer; transition: .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 14px; height: 14px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500;
}
.badge-blue   { background: var(--acc2); color: var(--accent); }
.badge-green  { background: var(--grn2); color: var(--green); }
.badge-amber  { background: var(--amb2); color: var(--amber); }
.badge-red    { background: var(--red2); color: var(--red); }
.badge-purple { background: #f5f3ff; color: var(--purple); }
.badge-gray   { background: var(--surf2); color: var(--text2); }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ── PAGE HEADER ── */
.page-header {
  display: flex; align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 24px;
}
.page-title {
  font-family: 'DM Serif Display', serif;
  font-size: 24px; letter-spacing: -.3px;
}
.page-subtitle { font-size: 13px; color: var(--text3); margin-top: 2px; }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  align-items: center; justify-content: center;
  z-index: 500; backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--rxl);
  box-shadow: var(--shl);
  max-width: 480px; width: 90%;
  padding: 28px 28px 24px;
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity:0; transform:scale(.95) translateY(10px); }
  to   { opacity:1; transform:scale(1)  translateY(0);     }
}
.modal-title { font-family:'DM Serif Display',serif; font-size:21px; margin-bottom:6px; }
.modal-desc  { font-size:13.5px; color:var(--text2); margin-bottom:18px; line-height:1.6; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:20px; }

/* ── EMPTY STATE ── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 64px 24px; text-align: center;
  color: var(--text3);
}
.empty-state-icon { font-size: 44px; margin-bottom: 14px; }
.empty-state h3   { font-size: 17px; color: var(--text2); margin-bottom: 6px; }
.empty-state p    { font-size: 13.5px; line-height: 1.6; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  :root { --side-w: 0px; }
  .ss-sidebar { display: none; }
  .ss-main   { margin-left: 0; }
}
