@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500;1,600&family=Lato:ital,wght@0,400;0,700;0,900;1,400&family=Playfair+Display:wght@600;700;800;900&display=swap');

:root {
  --navy: #1b1f32;
  --navy-2: #252a45;
  --ink: #1a1610;
  --muted: #7a706a;
  --line: #d8cdb8;
  --paper: #fffdf9;
  --wash: #f5f0e8;
  --blue: #c8912a;
  --teal: #c8912a;
  --green: #417254;
  --amber: #b97818;
  --red: #a03018;
  --gold: #c8912a;
  --gold-dark: #a9741b;
  --gold-pale: #f5ecd0;
  --cream-mid: #ede5d5;
  --navy-light: #2f3558;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-brand: 'Cormorant Garamond', Palatino, serif;
  --font-body: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  --shadow: 0 12px 34px rgba(27, 31, 50, .10);
  --radius: 8px;
  --letterhead-opacity: .075;
  font-family: var(--font-body);
  color: var(--ink);
}

html { background: var(--wash); scroll-behavior: smooth; }
body { background: var(--wash); color: var(--ink); font-family: var(--font-body); }
::selection { background: var(--gold); color: #fff; }
h1, h2, h3 { color: var(--ink); font-family: var(--font-display); letter-spacing: -.018em; }
button, input, select, textarea { font-family: var(--font-body); }
a, button, input, select, textarea { transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Shell and navigation */
.app-shell { grid-template-columns: 272px minmax(0, 1fr); }
/* The original drawing is a decorative grey watermark behind page content. */
.main, .login-panel { isolation: isolate; }
.main::before, .login-panel::after {
  content: '';
  position: fixed;
  inset: 92px 0 0 272px;
  z-index: -1;
  pointer-events: none;
  background-color: #727272;
  opacity: var(--letterhead-opacity);
  -webkit-mask: url('../img/studio-scarrone-storico.png') center / min(100%, 1200px) auto no-repeat;
  mask: url('../img/studio-scarrone-storico.png') center / min(100%, 1200px) auto no-repeat;
}
.login-panel::after { position: absolute; inset: 0; }
.sidebar {
  width: 272px;
  height: 100dvh;
  min-height: 0;
  padding: 28px 18px 22px;
  background: var(--navy);
  border-right: 1px solid rgba(200, 145, 42, .28);
  color: #fff;
}
.sidebar > :not(.nav) { flex-shrink: 0; }
.sidebar > .nav {
  min-height: 0;
  overflow-y: auto;
  grid-auto-rows: max-content;
}
.brand { gap: 13px; }
.brand-mark {
  width: 44px;
  height: 44px;
  padding: 2px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand strong {
  color: #fff;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.brand small {
  margin-top: 3px;
  color: var(--gold);
  font-family: var(--font-brand);
  font-size: .82rem;
  font-style: italic;
  letter-spacing: .015em;
}
.workspace-label {
  margin: 38px 12px 12px;
  color: rgba(255, 255, 255, .42);
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .16em;
}
.nav { gap: 4px; }
.nav a {
  position: relative;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: rgba(255, 255, 255, .67);
  font-size: .70rem;
  font-weight: 900;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.nav a span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(200, 145, 42, .55);
  border-radius: 50%;
  color: var(--gold);
}
.nav a svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.nav a:hover, .nav a.active {
  background: var(--navy-2);
  border-color: rgba(200, 145, 42, .18);
  color: #fff;
}
.nav a.active { box-shadow: inset 2px 0 var(--gold); }
.nav a.active span { border-color: var(--gold); background: rgba(200, 145, 42, .09); box-shadow: 0 1px 6px rgba(200, 145, 42, .18); }
.sidebar-foot { border-color: rgba(200, 145, 42, .22); }
.user-chip > span {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-family: var(--font-brand);
  font-size: .9rem;
}
.user-chip strong { color: #fff; }
.user-chip small { color: rgba(255, 255, 255, .48); }
.logout { color: rgba(255, 255, 255, .55); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.logout:hover { color: var(--gold); }

.topbar {
  height: 102px;
  padding: 20px 38px;
  background: rgba(255, 253, 249, .94);
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(27, 31, 50, .03);
}
.topbar h1 { margin-top: 3px; font-size: 1.72rem; font-weight: 700; }
.top-status { color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.top-status i { background: var(--gold); box-shadow: 0 0 0 4px rgba(200, 145, 42, .14); }
.menu-toggle { color: var(--navy); }
.page-content { max-width: 1520px; padding: 30px 38px 56px; }
.eyebrow, .kicker {
  color: var(--gold-dark);
  font-family: var(--font-body);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Panels, cards and data */
.focus-panel {
  min-height: 150px;
  padding: 28px 32px;
  border: 1px solid rgba(200, 145, 42, .28);
  border-radius: 10px;
  background:
    radial-gradient(circle at 83% 5%, rgba(224, 123, 32, .18), transparent 26%),
    linear-gradient(125deg, #171b2c 0%, var(--navy-2) 70%, #3b2119 115%);
  box-shadow: 0 14px 38px rgba(27, 31, 50, .18);
}
.focus-panel:after { width: 245px; height: 245px; right: 95px; top: -112px; border: 1px solid rgba(200, 145, 42, .18); }
.focus-panel h2 { color: #fff; font-size: 1.65rem; }
.focus-panel .eyebrow { color: var(--gold); }
.focus-panel p:last-child { color: rgba(255, 255, 255, .62); }
.completion-ring {
  background: radial-gradient(closest-side, var(--navy-2) 76%, transparent 77% 99%), conic-gradient(var(--gold) var(--p), rgba(255,255,255,.12) 0);
}
.completion-ring strong { color: #fff; font-family: var(--font-display); }
.completion-ring span { color: rgba(255, 255, 255, .58); text-transform: uppercase; letter-spacing: .06em; }
.card, .stat-card, .entity-head, .period-navigation {
  background: var(--paper);
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: 0 3px 13px rgba(27, 31, 50, .055);
}
.card { overflow: hidden; }
.card.calendar-wrap { overflow: auto; }
.card-head { padding: 21px 22px 17px; }
.card-head h2 { font-size: 1.13rem; font-weight: 700; }
.card-head > div:after {
  content: '';
  display: block;
  width: 38px;
  height: 2px;
  margin-top: 10px;
  background: var(--gold);
}
.stat-card { position: relative; min-height: 86px; padding: 18px; }
.stat-card:after { content: ''; position: absolute; inset: auto 0 0; height: 2px; background: var(--gold); opacity: .68; border-radius: 0 0 8px 8px; }
.stat-icon {
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  background: transparent !important;
  color: var(--gold) !important;
}
.stat-card small { color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.stat-card strong { color: var(--navy); font-family: var(--font-display); font-size: 1.55rem; }
.text-link, .row-action, .breadcrumb a { color: var(--gold-dark); }
.text-link:hover, .row-action:hover, .breadcrumb a:hover { color: var(--navy); }
.activity-list li, th, td, .check-row, .module-row, .document-row, .request-row, .deadline-row { border-color: #e5ddcf; }
.activity-dot.blue, .activity-dot.amber { background: var(--gold); }
table { color: var(--ink); }
th { background: #f3eee5; color: var(--muted); font-size: .61rem; font-weight: 900; letter-spacing: .09em; }
tbody tr { transition: background-color 150ms ease; }
tbody tr:hover { background: rgba(245, 236, 208, .42); }
td code, .entity-meta code { background: var(--gold-pale); color: #76510f; border-radius: 3px; }

.badge { border-radius: 3px; font-size: .59rem; letter-spacing: .055em; text-transform: uppercase; }
.badge-completed, .badge-resolved, .badge-closed { background: #e8f0e7; color: #365e43; }
.badge-submitted, .badge-under_review, .badge-open, .badge-in_progress { background: #eceaf2; color: #494765; }
.badge-draft { background: #eee9df; color: #70675d; }
.badge-ready { background: var(--gold-pale); color: #76510f; }
.badge-integration_required, .badge-reopened, .badge-waiting_company { background: #f7e5dc; color: #8d341b; }

/* Controls and forms */
.btn {
  min-height: 38px;
  border-width: 1.5px;
  border-radius: 4px;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.btn:active { transform: scale(.98); }
.btn-primary { border-color: var(--navy); background: var(--navy); color: #fff; }
.btn-primary:hover { border-color: var(--gold); background: var(--gold); }
.btn-secondary { border-color: #bfae93; background: transparent; color: var(--navy); }
.btn-secondary:hover { border-color: var(--navy); background: var(--navy); color: #fff; }
.search-box { border-color: var(--line); border-radius: 4px; background: var(--paper); }
.search-box span { color: var(--gold); }
.search-box button { border-color: var(--line); background: var(--cream-mid); color: var(--navy); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.field > span, .period-form label {
  color: var(--ink);
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.field input, .field select, .field textarea, .period-form input, .login-card input {
  border: 1px solid #cfc2ae;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus, .period-form input:focus, .login-card input:focus, .period-picker select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 145, 42, .14);
}
.switch-field input:checked + span { background: var(--gold); }
.form-errors { border-color: #dfb9aa; border-radius: 4px; background: #f9ece7; color: #802d18; }
.field.has-error input, .field.has-error select { border-color: #a1362a; background: #fdf3f2; }
.field-error { color: #a1362a; font-size: .68rem; line-height: 1.35; margin: 0; }
.alert { border-radius: 4px; }
.alert-success { border-color: #bfd1be; background: #ecf3eb; color: #365e43; }
.alert-error { border-color: #dfb9aa; background: #f9ece7; color: #802d18; }
.alert-info { border: 1px solid #bfd0dc; background: #edf4f8; color: #36566d; }

/* Operational modules */
.company-name > span, .entity-avatar {
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: transparent;
  color: var(--gold-dark);
  font-family: var(--font-display);
}
.entity-head { padding: 22px; }
.entity-head h2, .module-header h2, .request-detail-head h2 { font-family: var(--font-display); }
.tabs { border-color: var(--line); }
.tabs a { font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; }
.tabs a.active { border-color: var(--gold); color: var(--navy); }
.tabs span { border-radius: 3px; background: var(--cream-mid); }
.mini-progress { background: #e5ddcf; }
.mini-progress i { background: var(--gold); }
.module-icon, .check-icon {
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: transparent;
  color: var(--gold-dark);
}
.module-icon.done, .check-icon.done { border-color: #7da08a; background: #edf3ec; color: var(--green); }
.attendance-toolbar { background: var(--paper); }
.attendance-table thead th, .attendance-table thead .employee-col { background: #f0e9dd; }
.attendance-table .employee-col, .attendance-cell { background: var(--paper); }
.attendance-table th, .attendance-table td { border-color: #ded4c4; }
.employee-col code { color: var(--gold-dark); }
.attendance-cell:hover { background: var(--gold-pale); }
.attendance-cell.has-data { background: #f8f0db; color: #7b5512; }
.attendance-cell em { background: var(--gold); }
.weekend { background: #f0e8e2 !important; }
.row-total { background: #f0e9dd; }
.dialog { border-radius: 8px; box-shadow: 0 28px 80px rgba(15, 17, 29, .45); }
.dialog::backdrop { background: rgba(20, 22, 36, .7); }
.remove-entry, .icon-button { border-radius: 4px; }
.file-icon {
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: var(--gold-pale);
  color: #76510f;
}
.upload-zone { border-color: #bfae93; border-radius: 6px; background: #faf6ee; }
.upload-zone:hover { border-color: var(--gold); background: var(--gold-pale); }
.upload-zone > span { color: var(--gold); }
.report-intro { border-color: var(--line); border-radius: 8px; background: linear-gradient(135deg, #f8f2e7, #fffdf9); }
.report-intro > span { color: var(--gold); }
.priority-high, .priority-low { background: var(--gold); }
.studio-message { border-radius: 4px 8px 8px 8px; background: #eeeaf0; }
.company-message { border-radius: 8px 4px 8px 8px; background: var(--gold-pale); }
.deadline-row > time { border-color: var(--gold); border-radius: 4px; color: var(--navy); }
.deadline-row > time strong { font-family: var(--font-display); }
.period-navigation { padding: 11px 12px; }
.period-arrow { color: var(--gold-dark); }
.period-arrow:hover { background: var(--gold-pale); }
.period-picker select { border-radius: 4px; background: var(--cream-mid); color: var(--navy); }

/* Authentication */
.auth-page { background: var(--navy); }
.login-shell { grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); }
.login-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 48px clamp(44px, 7vw, 112px);
  background:
    linear-gradient(115deg, rgba(15, 17, 29, .88) 0%, rgba(27, 31, 50, .77) 56%, rgba(83, 40, 20, .58) 100%),
    linear-gradient(145deg, #111426 0%, #252a45 52%, #c7531a 85%, #e07b20 100%);
}
.login-intro:before, .login-intro:after {
  content: '';
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(200, 145, 42, .22);
  border-radius: 50%;
}
.login-intro:before { width: 520px; height: 520px; right: -235px; top: -95px; }
.login-intro:after { width: 350px; height: 350px; right: -120px; top: -10px; }
.login-intro h1 { max-width: 760px; color: #fff; font-family: var(--font-display); font-weight: 800; letter-spacing: -.04em; }
.login-intro h1 em { color: var(--gold); font-family: var(--font-brand); font-weight: 500; }
.login-intro > div > p:last-child { color: rgba(255, 255, 255, .68); }
.login-intro .kicker { color: var(--gold); }
.login-foot { color: rgba(255, 255, 255, .45); }
.login-panel { position: relative; background: var(--wash); }
.login-panel:before { content: ''; position: absolute; top: 0; left: 0; width: 64px; height: 3px; background: var(--gold); }
.login-card {
  width: min(430px, 100%);
  padding: 42px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 48px rgba(27, 31, 50, .12);
}
.login-card:before { content: ''; display: block; width: 42px; height: 2px; margin-bottom: 28px; background: var(--gold); }
.mobile-auth-brand { display: none; }
.login-card h2 { color: var(--navy); font-family: var(--font-display); font-size: 2rem; }
.login-card label { color: var(--ink); font-size: .66rem; letter-spacing: .055em; text-transform: uppercase; }
.support { color: var(--muted); }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .main::before { left: 0; }
  .sidebar { left: -290px; }
  .sidebar.open { left: 0; }
  .login-shell { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { height: 84px; padding: 16px 18px; }
  .main::before { top: 84px; }
  .topbar h1 { font-size: 1.4rem; }
  .page-content { padding: 20px 18px 42px; }
  .focus-panel { min-height: 0; padding: 23px 20px; }
  .focus-panel h2 { font-size: 1.34rem; }
  .stat-card { min-height: 78px; padding: 13px; }
  .stat-icon { width: 36px; height: 36px; }
  .login-panel { padding: 18px; }
  .login-card { padding: 32px 24px; }
  .login-card:before { display: none; }
  .mobile-auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 28px; }
  .mobile-auth-brand img { width: 38px; height: 38px; object-fit: contain; }
  .mobile-auth-brand strong, .mobile-auth-brand small { display: block; }
  .mobile-auth-brand strong { color: var(--navy); font-size: .67rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
  .mobile-auth-brand small { margin-top: 2px; color: var(--gold-dark); font-family: var(--font-brand); font-size: .78rem; font-style: italic; }
}
