/*
  Design system: shared UI primitives, layout helpers, and component defaults.
  This file is intentionally separate from theme overrides and should be loaded
  after `assets/css/main.css` but before template-specific style sheets.
*/

:root {
  --radius: 24px;
  --radius-sm: 16px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.08);
  --shadow-strong: 0 24px 70px rgba(0, 0, 0, 0.12);
  --text-on-primary: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.68);
}

html {
  box-sizing: border-box;
  font-family: 'Inter', 'Rajdhani', 'Rubik', Arial, sans-serif;
  scroll-behavior: smooth;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.58;
  background-color: var(--bg, #f8f4ed);
  color: var(--text, #1f1600);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a, a:link, a:visited {
  color: var(--link, #1f1600);
  text-decoration: none;
}

a:hover, a:focus {
  color: var(--link-hover, #6a5301);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 1rem;
  color: var(--text, #1f1600);
  line-height: 1.08;
  font-weight: 700;
}

h1 { font-size: clamp(2.6rem, 4vw, 4rem); }

h2 { font-size: clamp(2rem, 3vw, 3rem); }

h3 { font-size: clamp(1.7rem, 2.4vw, 2.3rem); }

h4 { font-size: 1.4rem; }

h5 { font-size: 1.15rem; }

h6 { font-size: 1rem; }

p, ul, ol, dl, blockquote {
  margin: 0 0 1.25rem;
}

p:last-child, ul:last-child, ol:last-child, dl:last-child, blockquote:last-child {
  margin-bottom: 0;
}

.container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.section {
  padding: 60px 0;
}

.section-compact {
  padding: 32px 0;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-gap-sm {
  gap: 16px;
}

.text-muted {
  color: var(--text-muted, rgba(31, 22, 0, 0.7));
}

.text-secondary {
  color: var(--text-secondary, #433300);
}

.text-inverse {
  color: var(--text-inverse, #ffffff);
}

.button, .btn, input[type="button"], input[type="submit"], input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  color: var(--text, #1f1600);
  background: transparent;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
  text-decoration: none;
  white-space: nowrap;
}

.button-primary, .btn-primary {
  background: linear-gradient(135deg, var(--brand-primary, #efbf04), var(--brand-primary-hover, #c19902));
  color: var(--text-on-primary, #ffffff);
  box-shadow: var(--shadow-soft);
}

.button-primary:hover, .btn-primary:hover {
  transform: translateY(-1px);
}

.button-primary:active, .btn-primary:active {
  transform: translateY(0);
}

.button-secondary, .btn-secondary {
  background: transparent;
  border-color: var(--brand-secondary, #6a5301);
  color: var(--text, #1f1600);
}

.button-secondary:hover, .btn-secondary:hover {
  background: rgba(239, 191, 4, 0.08);
}

.button-outline, .btn-outline {
  background: transparent;
  border-color: var(--brand-primary, #efbf04);
  color: var(--brand-primary, #efbf04);
}

.button-outline:hover, .btn-outline:hover {
  background: rgba(239, 191, 4, 0.12);
}

.button-disabled, .btn-disabled, .disabled, button:disabled, input:disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.button:focus-visible, .btn:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(239, 191, 4, 0.48);
  outline-offset: 3px;
}

.form-group {
  margin-bottom: 1.35rem;
}

.form-label, label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-secondary, #433300);
}

.form-control, input, textarea, select {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border, rgba(31, 22, 0, 0.12));
  background: var(--surface, var(--admin-surface, #fff4dd));
  color: var(--text, #1f1600);
  padding: 14px 16px;
  font-size: 1rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.form-control::placeholder, input::placeholder, textarea::placeholder {
  color: rgba(31, 22, 0, 0.45);
}

.form-control:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand-primary, #efbf04);
  box-shadow: 0 0 0 5px rgba(239, 191, 4, 0.18);
}

.form-help, .field-hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.94rem;
  color: var(--text-muted, rgba(31, 22, 0, 0.7));
}

.form-error {
  color: var(--brand-primary-active, #947501);
  font-weight: 600;
}

.card {
  background: var(--surface-alt, var(--admin-surface, #fff4dd));
  border: 1px solid var(--border, rgba(31, 22, 0, 0.12));
  border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}

.card-body {
  padding: 24px;
}

.card-header, .card-footer {
  padding: 20px 24px;
  background: var(--surface-alt, var(--admin-bg, #ffebc6));
}

.card-title {
  margin: 0 0 0.5rem;
  color: var(--text, #1f1600);
}

.card-subtitle {
  margin: 0;
  color: var(--text-secondary, #433300);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.98rem;
}

.table th, .table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--surface-soft, rgba(255, 235, 198, 0.5));
  vertical-align: middle;
}

.table th {
  color: var(--text-secondary, #433300);
  font-weight: 700;
  text-align: left;
}

.table tbody tr:hover {
  background: var(--surface-alt, var(--admin-surface, #fff4dd));
}

.table thead th {
}

/* ============================================
   CARDS / WIDGETS (Unified)
   Centralized card & widget styles used across public + admin
   ============================================ */
.card, .panel, .box, .widget, .inner, .cintainerinner {
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 18px rgba(31,22,0,0.06), inset 0 1px 0 rgba(255,255,255,0.02);
  padding: var(--spacing-md);
  transition: var(--transition);
}

.card:hover, .panel:hover, .box:hover, .widget:hover, .inner:hover, .cintainerinner:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(31,22,0,0.10), inset 0 1px 0 rgba(255,255,255,0.02);
}

.card--elevated, .widget--elevated {
  box-shadow: var(--shadow-lg);
}

.card__header, .panel-heading, .box-header {
  margin-bottom: var(--spacing-sm);
  font-weight: 700;
}

.card__body, .panel-body, .box-body {
  padding: 0;
  background: transparent;
}

.card--soft {
  background: linear-gradient(180deg, var(--surface, #ffffff) 0%, var(--surface-soft, #fff8e7) 100%);
}

.alert {
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
}

.alert-info {
  background: rgba(65, 30, 0, 0.06);
  border-color: rgba(65, 30, 0, 0.2);
  color: #433300;
}

.alert-success {
  background: rgba(106, 83, 1, 0.12);
  border-color: rgba(106, 83, 1, 0.26);
  color: #433300;
}

.alert-warning {
  background: rgba(239, 191, 4, 0.14);
  border-color: rgba(239, 191, 4, 0.28);
  color: #433300;
}

.alert-danger {
  background: rgba(177, 109, 59, 0.12);
  border-color: rgba(177, 109, 59, 0.28);
  color: #433300;
}

.modal-content {
  border-radius: 28px;
  border: 1px solid var(--border, rgba(31, 22, 0, 0.12));
  background: var(--surface-alt, var(--admin-bg, #ffebc6));
  box-shadow: 0 32px 80px rgba(31, 22, 0, 0.12);
}

.modal-header, .modal-footer {
  border-color: var(--border, rgba(31, 22, 0, 0.12));
}

.empty-state, .loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  text-align: center;
  padding: 40px 24px;
  border: 1px dashed var(--border, rgba(31, 22, 0, 0.12));
  border-radius: var(--radius);
  background: var(--surface-alt, var(--admin-surface, #fff4dd));
}

.empty-state h3, .loading-state h3 {
  margin-bottom: 0.65rem;
}

.empty-state p, .loading-state p {
  color: var(--text-muted, rgba(31, 22, 0, 0.7));
  max-width: 520px;
}

.navbar, .site-nav, .sidebar {
  background: var(--surface-alt, var(--admin-bg, #ffebc6));
}

.navbar a, .site-nav a, .sidebar a {
  color: var(--text-secondary, #433300);
}

.navbar a:hover, .site-nav a:hover, .sidebar a:hover {
  color: var(--link-hover, #6a5301);
}

.sidebar {
  border-right: 1px solid var(--border, rgba(31, 22, 0, 0.12));
}

.sidebar .nav-link {
  display: block;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
}

.sidebar .nav-link.active {
  background: rgba(239, 191, 4, 0.12);
  color: var(--text, #1f1600);
}

.tooltip, [data-tooltip] {
  position: relative;
}

.tooltip::after, [data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: var(--surface-alt, var(--admin-surface, #fff4dd));
  color: var(--text, #1f1600);
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border, rgba(31, 22, 0, 0.12));
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 999;
}

.tooltip:hover::after, [data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

#theme-switcher-btn {
  position: fixed;
  right: 16px;
  bottom: 76px;
  z-index: 9999;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border, rgba(31, 22, 0, 0.12));
  background: var(--surface-alt, var(--admin-surface, #fff4dd));
  color: var(--text, #1f1600);
  box-shadow: 0 16px 48px rgba(31, 22, 0, 0.18);
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

#theme-switcher-btn:hover {
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .container { width: calc(100% - 28px); }
  .section { padding: 40px 0; }
  .card-body { padding: 18px; }
}

@media (max-width: 640px) {
  .section { padding: 32px 0; }
  .button, .btn { min-height: 44px; padding: 0 18px; }
  .card-body { padding: 16px; }
}