﻿/**
 * Siblia Design System - "Navy & Ember 3D"
 * ---------------------------------------------------------------------------
 * Canonical visual language for every page (frontend + admin + future modules).
 * Read DESIGN_SYSTEM.md at the workspace root before building any new UI.
 *
 * Rules for AI models / developers:
 *  - Use the tokens below. Never hardcode a new hex value.
 *  - Cards: rounded-2xl, hairline border, soft layered drop shadow, subtle lift on hover.
 *  - Buttons: navy gradient with inner highlight and colored shadow; orange only as accent.
 *  - Orange (#FF7A18) is decorative. For orange TEXT on light surfaces use #C2410C (WCAG AA).
 *  - Ink is navy #0B2A5C (14:1 on white). Body text never below 4.5:1 contrast.
 *  - Motion: 160-220ms ease-out on hover/focus only. No bouncing.
 */

:root {
  /* Brand */
  --sib-navy: #0B2A5C;
  --sib-navy-deep: #071B3A;
  --sib-navy-soft: #1B3F7A;
  --sib-orange: #FF7A18;
  --sib-orange-deep: #C2410C;
  --sib-orange-soft: #FFF1E6;

  /* Surfaces */
  --sib-canvas: #F5F8FF;
  --sib-surface: #FFFFFF;
  --sib-border: #E2EAF6;
  --sib-muted: #64748B;

  /* Semantic */
  --sib-success: #15803D;
  --sib-warning: #B45309;
  --sib-info: #0369A1;
  --sib-danger: #DC2626;

  /* Depth */
  --sib-shadow-xs: 0 1px 2px rgba(11, 42, 92, .06);
  --sib-shadow-sm: 0 2px 8px rgba(11, 42, 92, .07), 0 1px 2px rgba(11, 42, 92, .05);
  --sib-shadow-md: 0 12px 28px -12px rgba(11, 42, 92, .28), 0 3px 8px rgba(11, 42, 92, .08);
  --sib-shadow-lg: 0 24px 48px -20px rgba(11, 42, 92, .38), 0 8px 16px rgba(11, 42, 92, .10);
  --sib-shadow-glow: 0 10px 24px -10px rgba(255, 122, 24, .55);

  --sib-radius: 1rem;
  --sib-radius-lg: 1.25rem;
  --sib-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------------------------------------------------------------- surfaces */
.card,
.admin-settings-page .card,
.modal-box,
.dropdown-content {
  border-radius: var(--sib-radius) !important;
  border-color: var(--sib-border) !important;
  box-shadow: var(--sib-shadow-sm);
  transition: box-shadow .2s var(--sib-ease), transform .2s var(--sib-ease), border-color .2s var(--sib-ease);
}

.card:hover {
  box-shadow: var(--sib-shadow-md);
  border-color: color-mix(in oklab, var(--sib-navy) 18%, var(--sib-border)) !important;
}

.card:active { transform: translateY(0); }

/* Lift only on interactive cards, never on static panels */
a.card:hover,
button.card:hover,
[data-action]:hover.card {
  transform: translateY(-2px);
}

/* ----------------------------------------------------------------- buttons */
.btn-primary,
.heroui.button--primary,
.heroui.button--primary:focus,
.heroui.button--primary:hover,
.btn-primary:focus,
.btn-primary:hover {
  background: linear-gradient(135deg, var(--sib-navy-deep), var(--sib-navy-soft)) !important;
  border: 1px solid transparent !important;
  border-radius: .8rem !important;
  color: #fff !important;
  box-shadow: var(--sib-shadow-md), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .18s var(--sib-ease), box-shadow .18s var(--sib-ease), filter .18s var(--sib-ease);
}

.btn-primary:hover,
.heroui.button--primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 16px 30px -12px rgba(11, 42, 92, .42), inset 0 1px 0 rgba(255, 255, 255, .25);
}

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

/* Accent / CTA buttons use the ember gradient with accessible dark ink */
.btn-accent,
.badge-accent {
  background: linear-gradient(135deg, var(--sib-orange), #FF9D4D) !important;
  color: var(--sib-navy-deep) !important;
  border: 0 !important;
  box-shadow: var(--sib-shadow-glow), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.btn-outline {
  border-radius: .8rem !important;
  border-color: var(--sib-border) !important;
  transition: border-color .18s var(--sib-ease), box-shadow .18s var(--sib-ease), transform .18s var(--sib-ease);
}

.btn-outline:hover {
  border-color: var(--sib-navy) !important;
  box-shadow: var(--sib-shadow-sm);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------------ inputs */
.input,
.textarea,
.select,
.file-input {
  border-radius: .8rem !important;
  border-color: var(--sib-border) !important;
  background: var(--sib-surface) !important;
  box-shadow: var(--sib-shadow-xs);
  transition: border-color .18s var(--sib-ease), box-shadow .18s var(--sib-ease);
}

.input:focus,
.textarea:focus,
.select:focus,
.file-input:focus {
  border-color: var(--sib-navy) !important;
  box-shadow: 0 0 0 3px rgba(255, 122, 24, .22) !important;
  outline: none !important;
}

/* -------------------------------------------------------------- typography */
body {
  background: var(--sib-canvas);
  color: var(--sib-navy-deep);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .admin-settings-heading h1, .admin-list-heading h1 {
  color: var(--sib-navy-deep);
  letter-spacing: -.02em;
}

.text-base-content\/60,
.text-base-content\/70 { color: var(--sib-muted) !important; }

/* --------------------------------------------------------------- focus ring */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--sib-orange);
  outline-offset: 2px;
}

/* --------------------------------------------------- admin sidebar spacing */
/* remove the stacked top gap (scroll padding + first heading margin) */
.js_admin-sidebar-scroll { padding-top: 0 !important; }
#admin-nav > li.admin-nav-heading:first-child { margin-top: 0 !important; }

/* --------------------------------------------------------------- nav active */
.menu-active,
.menu .active > a,
.admin-nav-heading,
.tab.active,
.tab.tab-active {
  color: var(--sib-navy) !important;
}

.menu-active,
.tab.active,
.tab.tab-active {
  background: linear-gradient(90deg, rgba(11, 42, 92, .10), rgba(255, 122, 24, .10)) !important;
  border-radius: .75rem;
  box-shadow: inset 3px 0 0 var(--sib-orange);
}

/* ------------------------------------------------------------------- badges */
.badge { border-radius: .65rem !important; }
.badge-success { background: rgba(21, 128, 61, .12) !important; color: var(--sib-success) !important; }
.badge-warning { background: rgba(180, 83, 9, .12) !important; color: var(--sib-warning) !important; }
.badge-error  { background: rgba(220, 38, 38, .12) !important; color: var(--sib-danger) !important; }
.badge-info   { background: rgba(3, 105, 161, .12) !important; color: var(--sib-info) !important; }

/* ------------------------------------------------------------------- tables */
.table th {
  color: var(--sib-navy);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.table tbody tr { transition: background .16s var(--sib-ease); }
.table tbody tr:hover { background: rgba(11, 42, 92, .035); }

/* ---------------------------------------------------------------- top bars */
.site-topbar,
.admin-topbar {
  background: linear-gradient(90deg, var(--sib-navy-deep), var(--sib-navy)) !important;
  box-shadow: var(--sib-shadow-sm);
}

/* -------------------------------------------------------------- stat tiles */
.stat-tile {
  border-radius: var(--sib-radius-lg) !important;
  background: linear-gradient(160deg, var(--sib-surface), var(--sib-canvas));
  border: 1px solid var(--sib-border) !important;
  box-shadow: var(--sib-shadow-md);
  position: relative;
  overflow: hidden;
}

.stat-tile::after {
  content: "";
  position: absolute;
  inset: auto -20% -55% auto;
  width: 120px;
  height: 120px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(255, 122, 24, .22), transparent 70%);
  pointer-events: none;
}

/* --------------------------------------------------------------- divider */
.divider, hr { border-color: var(--sib-border) !important; }

/* ------------------------------------------------------------ dark themes */
[data-theme$="-dark"] {
  --sib-canvas: #0A1730;
  --sib-surface: #10203D;
  --sib-border: #1E3357;
  --sib-muted: #A8BCDC;
  --sib-shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  --sib-shadow-md: 0 12px 28px -12px rgba(0, 0, 0, .6);
}

[data-theme$="-dark"] body { background: var(--sib-canvas); }

/* ---------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ------------------------------------------------------- ecom sidebar collapse */
/* Agriculture / commerce full-bleed pages keep the site menu collapsed; the
   icon-only rail must collapse its own track so the content area reflows. */
#site-sidebar.overlay-minified {
  width: 3.75rem !important;
  padding: .5rem !important;
  border-radius: var(--sib-radius) !important;
}

#site-sidebar.overlay-minified .menu,
#site-sidebar.overlay-minified nav {
  width: 100%;
}

@media (min-width: 1024px) {
  #site-sidebar.overlay-minified {
    width: 3.75rem;
    flex: 0 0 3.75rem;
  }
}

/* -------------------------------------------------------------- agriculture hero */
.sx-hero {
  border-radius: var(--sib-radius-lg) !important;
  border: 1px solid var(--sib-border) !important;
  background: linear-gradient(160deg, var(--sib-surface), var(--sib-canvas));
  box-shadow: var(--sib-shadow-md);
}

.sx-stat {
  border-radius: var(--sib-radius-lg) !important;
  background: linear-gradient(160deg, var(--sib-surface), var(--sib-canvas));
  border: 1px solid var(--sib-border) !important;
  box-shadow: var(--sib-shadow-md);
  padding: 1rem;
}

.sx-panel {
  border-radius: var(--sib-radius-lg) !important;
  border: 1px solid var(--sib-border) !important;
  background: linear-gradient(160deg, var(--sib-surface), var(--sib-canvas));
  box-shadow: var(--sib-shadow-md);
}