/* RUEZALS™ Visual Design System — Unified Skin
   Extracted from login portal (July 9, 2026)
   Contains complete design system: colors, typography, layout, animations
   Apply to dashboard.php and related pages for design consistency
*/

/* ========== COLOR PALETTE & THEME VARIABLES ========== */
:root {
  --void: #020706;
  --obsidian: #07100c;
  --panel: rgba(5, 15, 9, .90);
  --panel-strong: rgba(3, 10, 6, .97);
  --emerald: #0e4d30;
  --emerald-bright: #32b764;
  --teal: #29c4c0;
  --gold: #c8962a;
  --gold-bright: #e8bd4f;
  --parchment: #ece8dd;
  --muted: #8d9d92;
  --line: rgba(77, 151, 93, .24);
  --gold-line: rgba(200, 150, 42, .38);
  --danger: #c75e54;
  --shadow: 0 24px 80px rgba(0, 0, 0, .55), inset 0 0 70px rgba(14, 77, 48, .12);
  --radius: 5px;
  --sidebar: 228px;
  --topbar: 72px;
}

/* ========== GLOBAL RESET & BASE STYLES ========== */
* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--parchment);
  background:
    radial-gradient(1000px 680px at 68% -10%, rgba(25, 86, 52, .22), transparent 68%),
    radial-gradient(820px 580px at -10% 100%, rgba(200, 150, 42, .08), transparent 70%),
    linear-gradient(150deg, #030907, var(--void) 52%, #010302);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
img { max-width: 100%; }

/* ========== ANIMATED BACKGROUND CANVAS ========== */
.realm-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.realm-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 35%, transparent 0, transparent 38%, rgba(0,0,0,.52) 100%);
}

/* ========== LOGIN PAGE ========== */
.login-page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px;
}
.login-shell {
  width: min(1080px, 96vw);
  min-height: 650px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(4, 13, 8, .90), rgba(2, 7, 5, .94));
  box-shadow: var(--shadow), 0 0 0 10px rgba(30, 41, 34, .56);
}
.login-art {
  position: relative;
  padding: 46px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-right: 1px solid var(--gold-line);
  background:
    linear-gradient(135deg, rgba(14,77,48,.22), transparent 58%),
    radial-gradient(circle at 20% 10%, rgba(41,196,192,.10), transparent 45%);
}
.login-art::after {
  content: "";
  position: absolute;
  width: 470px;
  height: 470px;
  right: -180px;
  bottom: -180px;
  border: 1px solid rgba(200,150,42,.22);
  transform: rotate(45deg);
  box-shadow: 0 0 80px rgba(200,150,42,.06), inset 0 0 60px rgba(14,77,48,.14);
}
.brand-lockup { position: relative; z-index: 2; }
.brand-logo { width: min(520px, 100%); filter: drop-shadow(0 0 14px rgba(236,232,221,.16)); }
.eyebrow {
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: .32em;
  font-size: .69rem;
  font-weight: 800;
}
.login-title {
  margin: 22px 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  line-height: .93;
  letter-spacing: -.035em;
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(200,150,42,.18);
}
.login-copy { max-width: 590px; color: #b9c7bd; font-size: 1rem; }
.access-row { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 28px; }
.access-chip {
  border: 1px solid rgba(41,196,192,.24);
  background: rgba(4,20,16,.62);
  color: #78c9b7;
  padding: 8px 11px;
  font-size: .69rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.house-note { position: relative; z-index: 2; color: #6f8175; font-size: .75rem; letter-spacing: .08em; }

.login-form-panel {
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(3, 9, 6, .74);
}
.login-form-panel h2 { margin: 0; font-family: Georgia, serif; color: var(--parchment); font-size: 2rem; }
.login-form-panel .sub { margin: 7px 0 32px; color: var(--muted); font-size: .88rem; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; color: #789482; font-size: .69rem; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; }
.field input, .field select {
  width: 100%;
  height: 48px;
  border-radius: 2px;
  border: 1px solid rgba(58, 119, 72, .45);
  background: rgba(1, 7, 4, .82);
  color: var(--parchment);
  padding: 0 14px;
  outline: none;
  transition: .2s ease;
}
.field input:focus, .field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,150,42,.10); }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 22px; color: #718176; font-size: .77rem; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; }
.checkbox input { accent-color: var(--gold); }
.primary-button, .ghost-button, .small-button {
  border-radius: 2px;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, color .16s ease, background .16s ease;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .14em;
}
.primary-button {
  width: 100%;
  border: 1px solid #d3aa3e;
  background: linear-gradient(135deg, #d7a62f, #8f6510);
  color: #080703;
  padding: 14px 18px;
}
.primary-button:hover { transform: translateY(-1px); background: linear-gradient(135deg, #edc458, #aa7a17); }
.form-security { margin-top: 20px; color: #516458; font-size: .69rem; line-height: 1.7; }

/* ========== DASHBOARD SHELL ========== */
.portal {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(2,9,5,.98), rgba(2,7,4,.94));
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 50px rgba(0,0,0,.26);
}
.sidebar-brand { padding: 22px 19px 18px; border-bottom: 1px solid var(--line); }
.sidebar-brand img { width: 100%; max-height: 46px; object-fit: contain; object-position: left center; }
.portal-name { margin-top: 11px; color: var(--gold); font-family: Georgia, serif; font-size: 1.02rem; letter-spacing: .06em; }
.portal-name small { display: block; margin-top: 4px; color: #3c6950; font: 700 .52rem Inter, sans-serif; letter-spacing: .28em; text-transform: uppercase; }
.role-seal {
  margin: 17px 16px 8px;
  padding: 12px;
  border: 1px solid rgba(200,150,42,.22);
  background: rgba(200,150,42,.045);
}
.role-seal .label { color: #596d60; font-size: .56rem; text-transform: uppercase; letter-spacing: .22em; }
.role-seal strong { display: block; margin-top: 5px; color: var(--gold-bright); font-family: Georgia, serif; font-size: .98rem; }
.nav-section { padding: 13px 10px; }
.nav-heading { padding: 0 10px 6px; color: #345440; font-size: .54rem; letter-spacing: .25em; text-transform: uppercase; font-weight: 800; }
.nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 3px 0;
  padding: 10px;
  color: #6f8575;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: .75rem;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.nav-link .icon { width: 20px; color: #3d7250; font-family: monospace; }
.nav-link:hover, .nav-link.active { color: var(--parchment); border-color: rgba(61,114,80,.35); background: rgba(14,77,48,.15); }
.nav-link.active .icon { color: var(--gold); }
.sidebar-foot { margin-top: auto; padding: 15px 18px 18px; border-top: 1px solid var(--line); color: #385040; font-size: .62rem; line-height: 1.7; }
.sidebar-foot b { color: #6b8e76; }

.portal-main { grid-column: 2; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 9, 5, .86);
  backdrop-filter: blur(14px);
}
.mobile-menu { display: none; }
.top-title { min-width: 0; }
.top-title h1 { margin: 0; color: var(--parchment); font: 700 1.12rem Georgia, serif; letter-spacing: .04em; }
.top-title p { margin: 3px 0 0; color: #496453; font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; }
.top-spacer { flex: 1; }
.search-box { position: relative; width: min(360px, 34vw); }
.search-box input {
  width: 100%; height: 36px; padding: 0 36px 0 12px;
  color: #a8bbb0; background: rgba(1,7,4,.7); border: 1px solid rgba(55,104,67,.34); border-radius: 2px; outline: none;
}
.search-box span { position: absolute; right: 12px; top: 8px; color: #3b6248; }
.security-pill { white-space: nowrap; padding: 8px 11px; border: 1px solid rgba(50,183,100,.28); background: rgba(14,77,48,.15); color: #6fbd84; font-size: .57rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; }
.user-badge { display: flex; align-items: center; gap: 9px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--gold-line); background: linear-gradient(135deg, rgba(200,150,42,.22), rgba(14,77,48,.22)); color: var(--gold-bright); font: 700 .8rem Georgia, serif; }
.user-badge strong { display: block; font-size: .72rem; }
.user-badge small { display: block; color: #526b59; font-size: .58rem; text-transform: uppercase; letter-spacing: .12em; }

.content { padding: 28px; max-width: 1600px; margin: 0 auto; }
.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 28px;
  padding: 32px;
  border: 1px solid var(--gold-line);
  background: linear-gradient(145deg, rgba(8,24,14,.88), rgba(3,11,7,.90));
  box-shadow: var(--shadow);
}
.hero-panel::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -170px;
  top: -240px;
  transform: rotate(45deg);
  border: 1px solid rgba(200,150,42,.20);
  box-shadow: inset 0 0 60px rgba(14,77,48,.16);
}
.hero-copy { position: relative; z-index: 2; }
.hero-copy h2 { margin: 8px 0 13px; font: 700 clamp(2rem, 4vw, 3.5rem)/1.05 Georgia, serif; color: var(--gold-bright); }
.hero-copy p { max-width: 760px; color: #9dafa2; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 21px; }
.ghost-button, .small-button {
  border: 1px solid rgba(81,143,96,.42);
  background: rgba(6,21,12,.62);
  color: #7ba889;
  padding: 10px 14px;
  font-size: .62rem;
}
.ghost-button.gold { border-color: var(--gold-line); color: var(--gold-bright); background: rgba(200,150,42,.07); }
.ghost-button:hover, .small-button:hover { transform: translateY(-1px); color: var(--parchment); border-color: rgba(200,150,42,.55); }
.hero-mark { position: relative; z-index: 2; display: grid; place-items: center; }
.hero-mark img { width: min(290px, 80%); opacity: .74; filter: drop-shadow(0 18px 32px rgba(0,0,0,.55)); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 32px 0 14px; }
.section-head h2 { margin: 0; font: 700 1.22rem Georgia, serif; color: #d8d1c1; }
.section-head p { margin: 4px 0 0; color: #53675a; font-size: .72rem; }
.section-head .mini { color: #4f6e59; font-size: .62rem; letter-spacing: .11em; text-transform: uppercase; }
.grid { display: grid; gap: 14px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(8,22,13,.84), rgba(3,10,6,.82));
  box-shadow: 0 12px 34px rgba(0,0,0,.18);
  border-radius: 3px;
}
.card::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 34%; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); opacity: .62; }
.card-pad { padding: 18px; }
.stat-card .label { color: #54715d; font-size: .58rem; letter-spacing: .17em; text-transform: uppercase; font-weight: 800; }
.stat-card .value { margin-top: 10px; color: var(--parchment); font: 700 1.7rem Georgia, serif; }
.stat-card .trend { margin-top: 8px; color: #4b8060; font-size: .66rem; }
.stat-card .trend.gold { color: var(--gold); }
.card h3 { margin: 0 0 6px; color: #d9d4c8; font: 700 1rem Georgia, serif; }
.card p { margin: 0; color: #718277; font-size: .74rem; }
.card-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-tag { padding: 5px 8px; border: 1px solid rgba(41,196,192,.22); color: #61aaa2; font-size: .52rem; letter-spacing: .12em; text-transform: uppercase; }

.metric-bars { display: grid; gap: 14px; margin-top: 17px; }
.metric-row { display: grid; grid-template-columns: 115px 1fr 54px; align-items: center; gap: 10px; font-size: .67rem; color: #6f8175; }
.bar { height: 6px; overflow: hidden; background: rgba(66,99,76,.17); }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, #2d8451, var(--gold)); box-shadow: 0 0 14px rgba(200,150,42,.24); }
.metric-row strong { color: #aab8ae; text-align: right; font-size: .64rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .69rem; }
th { color: #4f735a; text-transform: uppercase; letter-spacing: .12em; font-size: .54rem; text-align: left; border-bottom: 1px solid var(--line); padding: 10px 11px; }
td { color: #8e9d93; border-bottom: 1px solid rgba(55,104,67,.14); padding: 11px; }
td strong { color: #d3d8d2; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald-bright); box-shadow: 0 0 8px rgba(50,183,100,.65); }
.status.pending::before { background: var(--gold); box-shadow: 0 0 8px rgba(200,150,42,.6); }

.doc-card { display: flex; min-height: 190px; }
.doc-icon { width: 120px; display: grid; place-items: center; border-right: 1px solid var(--line); background: rgba(14,77,48,.11); color: var(--gold); font: 700 2rem Georgia, serif; }
.doc-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.doc-body .doc-meta { color: #466651; font-size: .56rem; text-transform: uppercase; letter-spacing: .15em; }
.doc-body h3 { margin-top: 8px; }
.doc-body p { flex: 1; }
.doc-actions { display: flex; gap: 8px; margin-top: 18px; }

.role-panel { display: none; }
.role-panel.active { display: block; animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.notice {
  margin: 16px 0;
  padding: 13px 15px;
  border-left: 3px solid var(--gold);
  background: rgba(200,150,42,.06);
  color: #a99d7d;
  font-size: .72rem;
}

/* ========== DOCUMENT VIEWER ========== */
.docs-layout { display: grid; grid-template-columns: 280px 1fr; gap: 14px; min-height: calc(100vh - 130px); }
.docs-index { padding: 16px; }
.doc-select { width: 100%; text-align: left; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); background: rgba(4,15,8,.75); color: #75917e; cursor: pointer; }
.doc-select.active, .doc-select:hover { color: var(--parchment); border-color: var(--gold-line); background: rgba(200,150,42,.06); }
.doc-frame { min-height: 76vh; width: 100%; border: 0; background: #1a1815; }
.doc-search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.doc-search-row input { flex: 1; min-width: 0; padding: 10px; background: rgba(1,7,4,.8); border: 1px solid var(--line); color: var(--parchment); outline: none; }

/* ========== ACCOUNT SETTINGS ========== */
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-card .field input, .form-card .field select { height: 42px; }
.language-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.language-chip { border: 1px solid rgba(50,183,100,.28); color: #75ad83; background: rgba(14,77,48,.12); padding: 7px 9px; font-size: .62rem; letter-spacing: .08em; }

.portal-footer { margin-top: 34px; padding: 16px 2px 6px; display: flex; justify-content: space-between; gap: 20px; color: #33493b; font-size: .59rem; letter-spacing: .08em; text-transform: uppercase; }

/* ========== MODAL DIALOG ========== */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 20px; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
.modal-backdrop.open { display: grid; }
.modal { width: min(520px, 96vw); border: 1px solid var(--gold-line); background: #06100a; box-shadow: var(--shadow); padding: 24px; }
.modal h3 { font: 700 1.3rem Georgia, serif; color: var(--gold-bright); margin: 0 0 8px; }
.modal p { color: #829187; font-size: .78rem; }
.modal-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1100px) {
  :root { --sidebar: 208px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-grid { grid-template-columns: 1fr 1fr; }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-mark { display: none; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { min-height: 420px; border-right: 0; border-bottom: 1px solid var(--gold-line); }
}
@media (max-width: 800px) {
  :root { --sidebar: 272px; }
  .portal { display: block; }
  .portal-main { grid-column: auto; }
  .sidebar { transform: translateX(-102%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); background: rgba(3,12,7,.8); color: #7b9a83; cursor: pointer; }
  .topbar { padding: 0 15px; }
  .search-box { display: none; }
  .security-pill { display: none; }
  .content { padding: 18px 14px; }
  .two-grid, .three-grid, .account-grid, .docs-layout { grid-template-columns: 1fr; }
  .docs-layout { min-height: auto; }
  .doc-frame { min-height: 68vh; }
  .portal-footer { flex-direction: column; }
}
@media (max-width: 540px) {
  .login-page { padding: 0; align-items: stretch; }
  .login-shell { width: 100%; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .login-art { padding: 30px 24px; min-height: 360px; }
  .login-form-panel { padding: 34px 24px; }
  .stats-grid { grid-template-columns: 1fr; }
  .hero-panel { padding: 22px; }
  .top-title p, .user-badge strong, .user-badge small { display: none; }
  .content { padding: 14px 10px; }
  .doc-card { flex-direction: column; }
  .doc-icon { width: 100%; height: 65px; border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
