:root {
  --green-950: #073b27;
  --green-800: #08633f;
  --green-650: #0b8f55;
  --green-500: #13ad67;
  --green-100: #dcfce9;
  --ink: #18231d;
  --muted: #65736b;
  --line: #dce6df;
  --surface: #ffffff;
  --canvas: #f3f7f4;
  --danger: #bd2c3a;
  --shadow: 0 20px 55px rgba(7, 59, 39, .10);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 5% 0%, #e4f7ec 0, transparent 34%), var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--green-800); }

.login-page { display: grid; place-items: center; padding: 32px 18px; }
.login-shell { width: min(1040px, 100%); display: grid; grid-template-columns: 1.15fr .85fr; overflow: hidden; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.login-brand { position: relative; min-height: 610px; padding: 58px; color: #fff; background: linear-gradient(145deg, var(--green-950), var(--green-650)); overflow: hidden; }
.login-brand::after { content: ""; position: absolute; width: 340px; height: 340px; right: -120px; bottom: -150px; border: 70px solid rgba(255,255,255,.08); border-radius: 50%; }
.brand-mark { width: 108px; height: 108px; padding: 10px; object-fit: contain; background: #fff; border-radius: 24px; }
.eyebrow { margin: 70px 0 14px; font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #a7f3c8; }
.login-brand h1 { max-width: 560px; margin: 0; font-size: clamp(32px, 4vw, 54px); line-height: 1.06; letter-spacing: -.04em; }
.login-brand p { max-width: 500px; margin-top: 24px; font-size: 18px; line-height: 1.65; color: #d8f5e5; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 64px 54px; }
.login-panel h2 { margin: 0 0 8px; font-size: 30px; }
.login-panel > p { margin: 0 0 32px; color: var(--muted); line-height: 1.55; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 14px; font-weight: 700; }
.control { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); outline: none; transition: .2s; }
.control:focus { border-color: var(--green-500); box-shadow: 0 0 0 4px rgba(19,173,103,.13); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 18px; border: 0; border-radius: 12px; font-weight: 750; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--green-650); box-shadow: 0 9px 22px rgba(11,143,85,.22); }
.button-primary:hover { background: var(--green-800); }
.button-secondary { color: var(--green-800); background: var(--green-100); }
.button-danger { color: var(--danger); background: #fff0f1; }
.button-block { width: 100%; }
.status { min-height: 24px; margin-top: 14px; font-size: 14px; color: var(--danger); }
.status.success { color: var(--green-800); }
.language-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.85); }
.language-switch button { min-width: 42px; padding: 7px 9px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.language-switch button.is-active { color: #fff; background: var(--green-650); }
.login-panel .language-switch { align-self: flex-end; margin-bottom: 42px; }
.button[disabled] { opacity: .65; cursor: wait; transform: none; }

.app-shell { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 22px; border: 1px solid rgba(220,230,223,.8); border-radius: 20px; background: rgba(255,255,255,.9); box-shadow: 0 12px 34px rgba(7,59,39,.06); backdrop-filter: blur(14px); }
.brand-inline { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-inline img { width: 58px; height: 58px; object-fit: contain; }
.brand-inline strong { display: block; font-size: 16px; }
.brand-inline span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.user-tools { display: flex; align-items: center; gap: 12px; }
.user-copy { text-align: right; }
.user-copy strong, .user-copy span { display: block; }
.user-copy span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 34px 0 22px; }
.hero h1 { margin: 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.035em; }
.hero p { margin: 10px 0 0; color: var(--muted); }
.card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 30px rgba(7,59,39,.05); }
.filters { display: grid; grid-template-columns: minmax(180px,.6fr) minmax(260px,1.4fr) auto; align-items: end; gap: 16px; padding: 20px; }
.filters .field { margin: 0; }
.content-card { margin-top: 18px; overflow: hidden; }
.content-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.content-head h2 { margin: 0; font-size: 19px; }
.loader { width: 24px; height: 24px; border: 3px solid var(--green-100); border-top-color: var(--green-650); border-radius: 50%; animation: spin .7s linear infinite; }
.loader[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 13px 16px; text-align: left; color: var(--muted); background: #f8faf8; font-size: 12px; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 15px 16px; border-top: 1px solid #edf2ee; vertical-align: middle; font-size: 14px; }
.data-table tbody tr:hover { background: #fbfefc; }
.category { font-weight: 750; color: var(--green-800); }
.file-cell { display: flex; align-items: center; gap: 8px; min-width: 230px; }
.icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; color: var(--green-800); background: var(--green-100); cursor: pointer; }
.empty-state, .error-state { padding: 64px 24px; text-align: center; color: var(--muted); }
.error-state { color: var(--danger); }

.modal { position: fixed; inset: 0; z-index: 20; display: none; place-items: center; padding: 20px; background: rgba(4,28,18,.58); }
.modal.is-open { display: grid; }
.modal-card { width: min(620px, 100%); max-height: 90vh; overflow-y: auto; padding: 26px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-close { border: 0; background: transparent; color: var(--muted); font-size: 28px; cursor: pointer; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.hint { margin: -7px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: auto; padding: 34px; }
  .login-brand .eyebrow { margin-top: 38px; }
  .login-panel { padding: 42px 32px; }
  .filters { grid-template-columns: 1fr; }
  .topbar, .hero { align-items: flex-start; }
  .topbar { flex-direction: column; }
  .user-tools { width: 100%; justify-content: space-between; }
  .user-copy { text-align: left; }
}

@media (max-width: 520px) {
  .app-shell { width: min(100% - 20px, 1440px); }
  .brand-inline span { display: none; }
  .user-copy { display: none; }
  .hero { margin-top: 26px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
}
