/* assets/styles.css */

:root {
  --bg: #f7f4ee;
  --surface: #fffdf9;
  --surface-soft: #f4eee5;
  --surface-2: #f1ece3;
  --text: #2a2118;
  --muted: #6e6255;
  --line: #ded4c7;
  --brand: #7a5c3e;
  --brand-dark: #5f452d;
  --accent: #b58b62;
  --success-bg: #edf7f1;
  --success-text: #255c3f;
  --warning-bg: #fff6e8;
  --warning-text: #8a5a12;
  --info-bg: #eee8ff;
  --info-text: #4f3a8a;
  --danger-bg: #fdeeee;
  --danger-text: #8a2d2d;

  --radius-xl: 28px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-sm: 0 6px 18px rgba(42, 33, 24, 0.06);
  --shadow-md: 0 12px 30px rgba(42, 33, 24, 0.08);

  --max-width: 1200px;
  --content-width: 1100px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --transition: 0.2s ease;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  padding-left: 1.25rem;
}

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

.container,
.page-shell,
.page-container,
.portal-shell,
.dashboard-shell,
.content-shell,
.section-shell {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.narrow-container {
  width: min(100% - 2rem, 800px);
  margin-inline: auto;
}

.section {
  padding: var(--space-12) 0;
}

.surface,
.card,
.panel,
.tile,
.widget,
.stat-card,
.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card,
.panel,
.tile,
.widget,
.stat-card,
.info-card {
  padding: var(--space-6);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--line);
}

.kicker {
  display: inline-block;
  margin-bottom: var(--space-3);
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

h1,
.hero-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
  margin: 0 0 var(--space-4);
}

h2,
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
}

h3 {
  font-size: clamp(1.125rem, 2vw, 1.35rem);
  margin: 0 0 var(--space-3);
}

.lead,
.hero-copy,
.section-copy,
.muted {
  color: var(--muted);
}

.lead,
.hero-copy {
  font-size: clamp(1rem, 1.4vw, 1.125rem);
}

.stack-xs > * + * {
  margin-top: var(--space-2);
}
.stack-sm > * + * {
  margin-top: var(--space-3);
}
.stack-md > * + * {
  margin-top: var(--space-4);
}
.stack-lg > * + * {
  margin-top: var(--space-6);
}
.stack-xl > * + * {
  margin-top: var(--space-8);
}

.row {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-6);
}

.auto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-6);
}

.btn,
.button,
.cta,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition),
    border-color var(--transition), color var(--transition);
  text-align: center;
}

.btn:hover,
.button:hover,
.cta:hover,
input[type="submit"]:hover {
  background: var(--brand-dark);
}

.btn:active,
.button:active,
.cta:active,
input[type="submit"]:active {
  transform: translateY(1px);
}

.btn-secondary,
.button-secondary,
.btn-outline {
  background: transparent;
  color: var(--brand-dark);
  border-color: var(--line);
}

.btn-secondary:hover,
.button-secondary:hover,
.btn-outline:hover {
  background: var(--surface-soft);
}

.btn-block {
  width: 100%;
}

form {
  width: 100%;
}

label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  padding: 0.85rem 0.95rem;
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181, 139, 98, 0.15);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.notice,
.alert,
.message {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.notice-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.notice-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.notice-info {
  background: var(--info-bg);
  color: var(--info-text);
}

.notice-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

/* Header / nav */
.site-header,
.portal-header,
.dashboard-header,
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(247, 244, 238, 0.9);
  border-bottom: 1px solid rgba(222, 212, 199, 0.9);
}

.site-header-inner,
.portal-header-inner,
.dashboard-header-inner,
.topbar-inner {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0.75rem 0;
}

.brand,
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  font-weight: 800;
}

.nav,
.nav-links,
.header-links {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.nav a,
.nav-links a,
.header-links a {
  color: var(--muted);
  font-weight: 600;
}

.nav a:hover,
.nav-links a:hover,
.header-links a:hover {
  color: var(--text);
}

/* Hero */
.hero {
  padding: clamp(3rem, 7vw, 6rem) 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-8);
  align-items: center;
}

.hero-card {
  padding: clamp(1.25rem, 2vw, 2rem);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

/* Dashboard layout */
.dashboard-layout,
.portal-layout,
.app-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.sidebar,
.portal-sidebar,
.dashboard-sidebar {
  position: sticky;
  top: 92px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.main-content,
.portal-main,
.dashboard-main {
  min-width: 0;
}

.sidebar-nav,
.menu,
.side-links {
  display: grid;
  gap: 0.5rem;
}

.sidebar-nav a,
.menu a,
.side-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 600;
}

.sidebar-nav a:hover,
.menu a:hover,
.side-links a:hover,
.sidebar-nav a.active,
.menu a.active,
.side-links a.active {
  background: var(--surface-soft);
  color: var(--text);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.table-wrap table {
  min-width: 700px;
}

th,
td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
  background: var(--surface-soft);
}

/* Utility */
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.w-full {
  width: 100%;
}
.hidden {
  display: none !important;
}
.mt-0 {
  margin-top: 0 !important;
}
.mb-0 {
  margin-bottom: 0 !important;
}

/* Large tablets */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-layout,
  .portal-layout,
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .portal-sidebar,
  .dashboard-sidebar {
    position: static;
  }
}

/* Tablets / mobile */
@media (max-width: 768px) {
  .container,
  .page-shell,
  .page-container,
  .portal-shell,
  .dashboard-shell,
  .content-shell,
  .section-shell,
  .narrow-container {
    width: min(100% - 1rem, var(--max-width));
  }

  .section {
    padding: var(--space-8) 0;
  }

  .site-header-inner,
  .portal-header-inner,
  .dashboard-header-inner,
  .topbar-inner {
    min-height: auto;
    padding: 0.85rem 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav,
  .nav-links,
  .header-links {
    width: 100%;
    gap: 0.6rem;
  }

  .nav a,
  .nav-links a,
  .header-links a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .row-between {
    align-items: flex-start;
    flex-direction: column;
  }

  .card,
  .panel,
  .tile,
  .widget,
  .stat-card,
  .info-card {
    padding: var(--space-5);
  }

  .btn,
  .button,
  .cta,
  input[type="submit"] {
    width: 100%;
  }

  .hero {
    padding: 2.5rem 0;
  }

  .table-wrap table {
    min-width: 620px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  h1,
  .hero-title {
    font-size: 1.9rem;
  }

  h2,
  .section-title {
    font-size: 1.45rem;
  }

  .card,
  .panel,
  .tile,
  .widget,
  .stat-card,
  .info-card,
  .hero-card {
    padding: 1rem;
    border-radius: 16px;
  }

  th,
  td {
    padding: 0.75rem;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  input[type="search"],
  select,
  textarea {
    min-height: 46px;
    padding: 0.8rem 0.9rem;
  }
}