:root {
  --sage: #7C9A83;
  --sage-dark: #4E6E58;
  --sage-darker: #2E3A33;
  --sage-light: #E9F0EA;
  --cream: #FAF7F2;
  --sand: #E8C9A0;
  --white: #FFFFFF;
  --text: #2E3A33;
  --text-soft: #6B766E;
  --text-muted: #8A948D;
  --line: #E7E2D9;
  --success: #6FA876;
  --success-bg: #EAF4EB;
  --danger: #C0655A;
  --danger-bg: #F8ECEA;
  --warning-bg: #F7EFDF;
  --night: #141B2E;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(46, 58, 51, 0.06), 0 4px 16px rgba(46, 58, 51, 0.05);
  --sidebar-w: 248px;
}

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

body {
  font-family: 'Nunito Sans', system-ui, sans-serif;
  background: var(--cream);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, .brand { font-family: 'Quicksand', system-ui, sans-serif; }

a { color: var(--sage-dark); text-decoration: none; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}

.login-logo {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--sage-light);
  color: var(--sage-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 0 auto 14px;
}

.login-card h1 { font-size: 21px; text-align: center; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 13.5px; margin-bottom: 26px; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sage-darker);
  color: #DCE5DE;
  padding: 22px 14px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--white);
  font-size: 17px; font-weight: 600;
  padding: 2px 10px 20px;
}

.brand-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--sage);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.nav-section {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7E8F83;
  padding: 16px 10px 6px;
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  color: #C7D3CA;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 14px;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

.nav-link i { font-size: 18px; width: 20px; text-align: center; }
.nav-link:hover { background: rgba(255, 255, 255, 0.07); color: var(--white); }
.nav-link.active { background: var(--sage); color: var(--white); }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}

.topbar h1 { font-size: 19px; font-weight: 600; }

.topbar-user { display: flex; align-items: center; gap: 12px; color: var(--text-soft); font-size: 13.5px; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--sage-light);
  color: var(--sage-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

.content { padding: 26px 28px 48px; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 22px;
}

.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: var(--sage-light);
  color: var(--sage-dark);
  flex-shrink: 0;
}

.stat-icon.sand { background: #F6ECDC; color: #A97C3F; }
.stat-icon.night { background: #E8ECF5; color: #40507A; }

.stat-label { font-size: 12.5px; color: var(--text-muted); }
.stat-value { font-size: 22px; font-weight: 700; font-family: 'Quicksand', sans-serif; line-height: 1.2; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 12px;
  border-bottom: 1px solid #F1EDE5;
  vertical-align: middle;
  font-size: 14px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #FCFAF6; }

.thumb {
  width: 72px; height: 46px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: var(--sage-light);
}

.thumb-round { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--sage-light); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700;
  padding: 3px 11px;
  border-radius: 20px;
}

.badge.green { background: var(--success-bg); color: #3E7A46; }
.badge.gray { background: #F0EDE6; color: var(--text-soft); }
.badge.sand { background: var(--warning-bg); color: #A97C3F; }
.badge.red { background: var(--danger-bg); color: var(--danger); }
.badge.night { background: #E8ECF5; color: #40507A; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }

label { display: block; font-size: 13px; font-weight: 700; color: var(--text-soft); margin-bottom: 6px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], input[type="time"], input[type="date"], input[type="datetime-local"],
input[type="search"], select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #FDFCFA;
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(124, 154, 131, 0.15);
}

textarea { min-height: 110px; resize: vertical; }

.help { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }

.check {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text);
  cursor: pointer;
  margin-bottom: 0;
}

.check input { width: 17px; height: 17px; accent-color: var(--sage-dark); }

.error-text { color: var(--danger); font-size: 12.5px; margin-top: 5px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px;
  border-radius: 24px;
  border: none;
  font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer;
  background: var(--sage-dark);
  color: var(--white);
  transition: background 0.15s, transform 0.1s;
}

.btn:hover { background: #3F5A48; }
.btn:active { transform: scale(0.98); }

.btn.outline {
  background: transparent;
  color: var(--sage-dark);
  border: 1.5px solid var(--sage);
}

.btn.outline:hover { background: var(--sage-light); }

.btn.ghost { background: transparent; color: var(--text-soft); padding: 8px 12px; }
.btn.ghost:hover { background: #F0EDE6; color: var(--text); }

.btn.danger { background: transparent; color: var(--danger); padding: 8px 12px; }
.btn.danger:hover { background: var(--danger-bg); }

.btn.small { padding: 7px 14px; font-size: 13px; }

.btn i { font-size: 16px; }

/* ---------- Flash & misc ---------- */
.flash {
  display: flex; align-items: center; gap: 10px;
  background: var(--success-bg);
  color: #3E7A46;
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 14px;
}

.flash.error { background: var(--danger-bg); color: var(--danger); }

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

.page-head p { color: var(--text-muted); font-size: 13.5px; }

.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filters > div { min-width: 160px; }

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty i { font-size: 40px; color: var(--sage); display: block; margin-bottom: 10px; }

.pagination { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 13.5px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--text-soft);
}
.pagination .current { background: var(--sage-dark); color: var(--white); border-color: var(--sage-dark); }
.pagination a:hover { border-color: var(--sage); color: var(--sage-dark); }

.img-preview {
  max-width: 220px;
  border-radius: 10px;
  display: block;
  margin-top: 8px;
}

audio { width: 100%; max-width: 280px; height: 36px; }

.chart-box { position: relative; height: 260px; }

.actions-cell { display: flex; gap: 4px; justify-content: flex-end; }

.mono { font-family: ui-monospace, monospace; font-size: 12.5px; color: var(--text-soft); }

/* ---------- Mood picker ---------- */
.mood-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.mood-chip { margin: 0; cursor: pointer; }
.mood-chip input { position: absolute; opacity: 0; pointer-events: none; }
.mood-chip span {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: #FDFCFA;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-soft);
  transition: all 0.15s;
}
.mood-chip input:checked + span {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

/* ---------- Type toggle (nefes içerik) ---------- */
.type-toggle { display: flex; gap: 10px; }
.type-toggle label { margin: 0; flex: 1; cursor: pointer; }
.type-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.type-toggle .opt {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #FDFCFA;
  font-weight: 600;
  color: var(--text-soft);
  transition: all 0.15s;
}
.type-toggle .opt i { font-size: 20px; }
.type-toggle input:checked + .opt {
  background: var(--sage-light);
  border-color: var(--sage);
  color: var(--sage-dark);
}

/* ---------- Premium ---------- */
.badge.premium { background: #F3ECDA; color: #A97C3F; }
.premium-banner {
  display: flex; align-items: center; gap: 12px;
  background: #F6ECDC; color: #8A6626;
  border-radius: 12px; padding: 14px 18px; margin-bottom: 18px;
  font-weight: 600; font-size: 14px;
}
.premium-banner i { font-size: 22px; }

.btn.gold { background: #C79A4B; }
.btn.gold:hover { background: #B4863A; }

@media (max-width: 800px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
}
