:root {
  --navy: #0b1f3a;
  --navy-2: #102a4c;
  --teal: #00b8a8;
  --teal-2: #14d6c4;
  --ink: #0e1726;
  --muted: #5b6b82;
  --line: #e3e9f2;
  --bg: #f5f8fc;
  --white: #ffffff;
  --danger: #d23c3c;
  --ok: #0a8f83;
  --shadow: 0 18px 50px -22px rgba(11, 31, 58, .35);
  --shadow-sm: 0 8px 24px -14px rgba(11, 31, 58, .3);
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1140px;
  --header-h: 68px;
}

* { box-sizing: border-box; }

body.area-body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link { position: absolute; left: -999px; top: 0; z-index: 300; background: var(--navy); color: #fff; padding: 10px 16px; }
.skip-link:focus { left: 0; }

.area-container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 22px; }

/* Header */
.area-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.area-header-inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.area-brand { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 800; color: var(--navy); }
.area-brand-logo { display: inline-block; width: 34px; height: 34px; border-radius: 9px; object-fit: contain; }
.area-brand:hover { text-decoration: none; }
.area-brand-text { color: var(--navy); }
.area-brand-accent { color: var(--teal); margin-left: 2px; }
.area-nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.area-lang-switch { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.area-lang-btn {
  border: 0; background: transparent; cursor: pointer; font-weight: 700; font-size: .8rem;
  padding: 6px 12px; border-radius: 999px; color: var(--muted); transition: .2s; font-family: inherit;
}
.area-lang-btn.is-active { background: var(--navy); color: #fff; }
.area-nav a {
  padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: .92rem; color: #2c3a52;
}
.area-nav a:hover { background: var(--bg); text-decoration: none; }
.area-nav a.is-active { background: var(--navy); color: #fff; }

/* Layout */
.area-main { max-width: 520px; margin: 48px auto; padding: 0 22px; }
.area-main-wide { max-width: var(--container); }

/* Card */
.area-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow-sm); margin-bottom: 26px;
}
.area-card h1, .area-card h2 { margin-top: 0; }
.area-sub { color: var(--muted); margin-top: -.2em; }

/* Forms */
.area-field { display: grid; gap: 6px; margin-bottom: 16px; }
.area-field label { font-size: .85rem; font-weight: 700; color: #2c3a52; }
.area-field small { color: var(--muted); font-size: .78rem; }
.area-field input, .area-field textarea, .area-field select {
  font-family: inherit; font-size: .95rem; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfcfe; transition: border-color .2s, box-shadow .2s; resize: vertical; width: 100%;
}
.area-field input:focus, .area-field textarea:focus, .area-field select:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(0,184,168,.14);
}
.area-field input:disabled { background: #eef2f7; color: var(--muted); }
.area-field.is-invalid input, .area-field.is-invalid textarea, .area-field.is-invalid select {
  border-color: var(--danger); background: #fff6f6;
}
.area-field.is-invalid input:focus { box-shadow: 0 0 0 4px rgba(210,60,60,.14); }
.area-field-error { color: var(--danger); font-size: .78rem; font-weight: 600; }
.area-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* Buttons */
.area-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: .93rem;
  border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer;
  font-family: inherit; transition: background .2s, transform .2s, box-shadow .2s;
}
.area-btn:hover { background: var(--bg); text-decoration: none; }
.area-btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: var(--shadow-sm); }
.area-btn-primary:hover { background: var(--navy-2); }
.area-btn:disabled { opacity: .6; cursor: not-allowed; }
.area-btn-block { width: 100%; }

.area-btn-link {
  background: none; border: 0; color: var(--teal); font-weight: 700; font-size: .85rem;
  cursor: pointer; padding: 2px 6px; font-family: inherit; border-radius: 6px;
}
.area-btn-link:hover { background: rgba(0,184,168,.1); text-decoration: none; }
.area-btn-link.danger { color: var(--danger); }
.area-btn-link.danger:hover { background: rgba(210,60,60,.1); }

/* Notes */
.note { margin: 12px 0 0; font-size: .9rem; font-weight: 600; min-height: 1.2em; }
.note.ok { color: var(--ok); }
.note.err { color: var(--danger); }

.area-links { margin: 18px 0 0; font-size: .9rem; }

/* Toolbar / tabs */
.area-tabs { display: flex; gap: 8px; margin: 0 0 20px; border-bottom: 1px solid var(--line); }
.area-tab {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 16px;
  font-family: inherit; font-weight: 700; font-size: .95rem; color: var(--muted); cursor: pointer;
}
.area-tab.is-active { color: var(--navy); border-bottom-color: var(--teal); }

.area-toolbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-bottom: 20px; }
.area-field-inline { margin-bottom: 0; flex: 1 1 260px; }
.area-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Upload */
.area-upload { margin-bottom: 22px; }
.area-upload-actions { display: flex; align-items: center; gap: 14px; }
.area-progress { color: var(--muted); font-size: .88rem; font-weight: 600; }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius-sm); background: #fbfcfe;
  padding: 30px 20px; text-align: center; cursor: pointer; color: var(--muted);
  transition: border-color .2s, background .2s; margin-bottom: 16px;
}
.dropzone:hover { border-color: rgba(0,184,168,.5); background: #f3fbfa; }
.dropzone:focus-visible { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(0,184,168,.14); }
.dropzone.is-dragover { border-color: var(--teal); background: #eefbf9; }
.dropzone.has-file { border-style: solid; border-color: var(--line); background: #fff; padding: 16px; text-align: left; }
.dropzone-icon { color: var(--teal); margin-bottom: 8px; }
.dropzone-text { margin: 0; font-weight: 600; color: #2c3a52; }
.dropzone-browse { color: var(--teal); text-decoration: underline; margin-left: 4px; }
.dropzone-hint { margin: 6px 0 0; font-size: .8rem; color: var(--muted); }
.dropzone-selected { display: flex; align-items: center; gap: 12px; }
.file-chip-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: rgba(0,184,168,.12); color: var(--teal); flex: 0 0 auto; }
.file-chip-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-chip-name { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-size { font-size: .8rem; color: var(--muted); }

.area-desc-field { position: relative; }
.area-desc-counter { position: absolute; right: 10px; bottom: 8px; font-size: .72rem; color: var(--muted); background: #fbfcfe; padding: 0 4px; pointer-events: none; }

/* Table */
.area-table-wrap { overflow-x: auto; }
.area-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.area-table th, .area-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.area-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.area-table tbody tr:hover { background: #fafcfe; }
.area-actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.area-empty { color: var(--muted); font-style: italic; }

/* Keep the actions column from growing the row and misaligning the row border */
.area-table td.area-actions-cell { vertical-align: middle; white-space: nowrap; }

/* Long descriptions/names: constrain width so they never break the layout */
.area-name-cell { max-width: 220px; overflow-wrap: anywhere; word-break: break-word; }
.area-desc-cell { max-width: 320px; min-width: 180px; }
.clamp-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.clamp.is-expanded .clamp-text { -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.clamp-toggle { display: block; margin-top: 4px; padding: 0; }

/* Modal */
.area-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.area-modal[hidden] { display: none; }
.area-modal-backdrop { position: absolute; inset: 0; background: rgba(11,31,58,.5); }
.area-modal-dialog {
  position: relative; background: #fff; border-radius: var(--radius); padding: 28px;
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
}
.area-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }

.area-dialog { max-width: 460px; }
.area-dialog-title { margin: 0 0 8px; }
.area-dialog-message { margin: 0 0 18px; color: var(--muted); }
.area-dialog-field { margin-bottom: 18px; }
.area-btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: var(--shadow-sm); }
.area-btn-danger:hover { background: #b93232; }

/* Toasts */
.area-toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.area-toast {
  background: var(--navy); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow); font-weight: 600; font-size: .9rem;
  opacity: 1; transform: translateY(0); transition: opacity .3s, transform .3s;
}
.area-toast.ok { background: var(--ok); }
.area-toast.err { background: var(--danger); }
.area-toast.is-hiding { opacity: 0; transform: translateY(8px); }
@media (max-width: 640px) {
  .area-toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

@media (max-width: 640px) {
  .area-grid-2 { grid-template-columns: 1fr; }
  .area-card { padding: 22px; }
  .area-main { margin: 26px auto; }
}
