/* ============================================================
   base.css — Valkai Upgrade shared styles
   Used by base.html (dashboard / app pages)
   ============================================================ */

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

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --card: #ffffff;
  --border: #e8e5de;
  --accent: #2d6a4f;
  --accent-light: #d8f3dc;
  --accent2: #f5a623;
  --text: #1a1a1a;
  --muted: #777;
  --danger: #e53e3e;
  --font-body: 'Sora', sans-serif;
  --font-display: 'DM Serif Display', serif;
  --nav-h: 64px;
  --sidebar-w: 260px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── NAVBAR ── */
.navbar {
  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;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  color: var(--accent);
  text-decoration: none;
}

.nav-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
}

.nav-avatar {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 12px; font-weight: 600;
}

.btn-logout {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  transition: all 0.15s;
}
.btn-logout:hover { background: var(--bg); color: var(--danger); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── LAYOUT ── */
.layout {
  display: flex;
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--nav-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  z-index: 90;
  transition: transform 0.3s ease;
}

.sidebar-section { margin-bottom: 2rem; }

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
  display: block;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  transition: all 0.15s;
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: var(--bg);
  color: var(--text);
}

.sidebar-link.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

.sidebar-link .icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-link .badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 100px;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 89;
}
.sidebar-overlay.active { display: block; }

/* ── MAIN ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

/* ── BREADCRUMB ── */
.breadcrumb-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 2rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  list-style-type: none;
}

.breadcrumb a { color: var(--muted); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: #ccc; font-size: 12px; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ── PAGE CONTENT ── */
.page-content {
  padding: 2rem;
  max-width: 1100px;
}

/* ── CARD ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon { font-size: 16px; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.empty-state .icon { font-size: 2rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 14px; }

/* ── MODAL ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-title { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { opacity: 0.88; }

.btn-outline {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

.btn-ghost {
  background: none;
  border: none;
  color: var(--muted);
  padding: 6px 10px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--danger); color: white; }

/* ── FORM ── */
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--accent); background: white; }

.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 5px;
}

/* ── MESSAGES ── */
.messages { padding: 0 2rem; margin-top: 1rem; }
.message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 8px;
}
.message.success { background: var(--accent-light); color: var(--accent); }
.message.error { background: #fff5f5; color: var(--danger); }

/* ── FOOTER ── */
.footer {
  text-align: center;
  padding: 2rem;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main { margin-left: 0; }
  .page-content { padding: 1.25rem; }
  .nav-right .btn-logout { display: none; }
  .breadcrumb-bar { padding: 0.6rem 1.25rem; }
}

@media (max-width: 480px) {
  .page-content { padding: 1rem; }
  .card { padding: 1rem; }
}