:root {
  --bg: #f4f2ed;
  --surface: #fff;
  --surface-2: #ece9e2;
  --surface-3: #e4e0d7;
  --ink: #1b1b18;
  --ink-2: #5e5d57;
  --ink-3: #77746c;
  --primary: #10069f;
  --primary-hover: #0a075f;
  --primary-tint: #e4e5fb;
  --line: #dedad1;
  --line-strong: #c8c2b7;
  --danger: #b23b38;
  --danger-tint: #f8e9e6;
  --success: #176b4a;
  --success-tint: #e4f3eb;
  --radius: 4px;
  --radius-lg: 10px;
  --shadow: 0 20px 60px rgba(31, 27, 19, .12);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(220,239,251,.7), transparent 24rem),
    var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.artyco-symbol {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 56px;
  height: 56px;
  color: #fff;
  background: var(--primary);
  border-radius: 50% 50% 47% 53% / 53% 47% 55% 45%;
  font-family: Georgia, serif;
  font-size: 31px;
  font-weight: 700;
  transform: rotate(-4deg);
}
.artyco-symbol-small { width: 35px; height: 35px; font-size: 19px; }

.login-view {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  background:
    linear-gradient(90deg, rgba(8,7,40,.78), rgba(8,7,40,.28)),
    url("../assets/san-miguel-lillo.jpg") center / cover;
}
.login-view::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(6,5,30,.55));
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 500px);
  margin-left: min(40vw, 600px);
  padding: clamp(34px, 5vw, 54px);
  border: 0;
  border-radius: 2px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 28px 100px rgba(0,0,0,.32);
  backdrop-filter: blur(12px);
}
.login-back {
  display: inline-block;
  margin-bottom: 36px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.login-brand { align-items: center; gap: 18px; margin-bottom: 34px; }
.login-brand h1 {
  margin: 2px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 500;
  letter-spacing: -.035em;
}
.login-kicker {
  margin: 0;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.login-card label { margin-top: 14px; color: var(--ink); font-size: 12px; font-weight: 700; }
.login-card input { min-height: 46px; background: #fff; }
.login-card .btn-block { min-height: 48px; margin-top: 22px; }
.quick-login { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.quick-title {
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.quick-buttons { margin-top: 12px; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-user {
  min-height: 60px;
  padding: 11px 13px;
  border-color: var(--line);
  border-radius: 3px;
  background: #fff;
  text-align: left;
}
.quick-user:hover { border-color: var(--primary); background: var(--primary-tint); }

.topbar {
  min-height: 68px;
  padding: 0 24px;
  color: #fff;
  background: var(--primary);
  border-bottom: 0;
  box-shadow: 0 8px 30px rgba(16,6,159,.17);
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  color: #fff;
  text-decoration: none;
}
.topbar .brand strong { display: block; letter-spacing: .18em; font-size: 14px; }
.topbar .brand small { display: block; margin-top: 1px; color: rgba(255,255,255,.7); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.topbar .obra-picker select {
  min-width: min(340px, 32vw);
  height: 42px;
  color: #fff;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.25);
}
.topbar .obra-picker select option { color: var(--ink); background: #fff; }
.topbar .btn.ghost { color: #fff; border-color: transparent; }
.topbar .btn.ghost:hover { background: rgba(255,255,255,.12); }
.topbar .whoami { color: rgba(255,255,255,.76); }

.shell {
  min-height: calc(100vh - 68px);
  grid-template-columns: 224px minmax(0, 1fr);
}
.sidenav {
  padding: 24px 14px;
  background: #fff;
  border-right: 1px solid var(--line);
}
.nav-item {
  min-height: 44px;
  margin-bottom: 4px;
  padding: 0 14px;
  border-radius: 3px;
  color: var(--ink-2);
  font-weight: 650;
}
.nav-item:hover { color: var(--ink); background: var(--surface-2); }
.nav-item.active {
  color: var(--primary);
  background: var(--primary-tint);
  box-shadow: inset 3px 0 0 var(--primary);
}
.nav-ico { color: currentColor; }

.content {
  width: 100%;
  max-width: none;
  padding: 28px clamp(22px, 3vw, 46px) 50px;
}
.files-layout {
  grid-template-columns: minmax(250px, 320px) minmax(520px, 1fr);
  gap: 22px;
  align-items: start;
}
.tree-pane {
  top: 96px;
  max-height: calc(100vh - 125px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.84);
  box-shadow: 0 12px 34px rgba(31,27,19,.055);
  backdrop-filter: blur(12px);
}
.list-pane {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 12px 34px rgba(31,27,19,.055);
}
.pane-head { min-height: 44px; }
.pane-head h2, .page-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -.02em;
}
.tree-row {
  min-height: 38px;
  margin: 2px 0;
  border-radius: 3px;
}
.tree-row:hover { background: var(--surface-2); }
.tree-row.selected { color: var(--primary); background: var(--primary-tint); }
.cap-dot.on { background: var(--primary); }
.filters {
  gap: 8px;
  margin: 18px 0 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
}
.search-box { min-width: 230px; flex: 1 1 280px; }
.filters input, .filters select { background: #fff; }
.file-list { border-top: 1px solid var(--line); }
.file-row {
  min-height: 66px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
}
.file-row:hover { background: #faf9f6; }
.file-name { font-weight: 700; }
.file-meta { margin-top: 4px; color: var(--ink-2); }
.detail-pane {
  width: min(440px, 92vw);
  padding: 24px;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -20px 0 60px rgba(31,27,19,.14);
}

.btn {
  min-height: 38px;
  border-radius: 3px;
  font-weight: 700;
}
.btn.primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
input, select, textarea { min-height: 40px; border-radius: 3px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16,6,159,.11); }
.table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.table thead { color: var(--ink); background: var(--surface-2); }
.table th { padding-top: 13px; padding-bottom: 13px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.table td { padding-top: 13px; padding-bottom: 13px; }
.toolbar-form, .role-form {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.state-block { border-radius: 5px; background: rgba(255,255,255,.7); }
.dialog { border-radius: 6px; box-shadow: var(--shadow); }

@media (max-width: 1050px) {
  .login-card { margin-left: 30vw; }
  .shell { grid-template-columns: 1fr; }
  .sidenav { padding: 10px 14px; }
  .files-layout { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .login-view { align-items: end; padding: 26px 16px; }
  .login-card { width: 100%; margin: 0; padding: 30px 24px; }
  .topbar { padding: 0 12px; }
  .topbar .brand { min-width: 46px; }
  .topbar .brand span:last-child { display: none; }
  .topbar .obra-picker { flex: 1; }
  .topbar .obra-picker select { width: 100%; min-width: 0; }
  .topbar .whoami { display: none; }
  .content { padding: 18px 14px 36px; }
  .files-layout { display: block; }
  .tree-pane { position: static; max-height: 310px; margin-bottom: 14px; }
  .list-pane { padding: 18px 14px; }
  .quick-buttons { grid-template-columns: 1fr 1fr; }
}
