:root {
  --green: #102820;
  --green-2: #174132;
  --gold: #c6a15b;
  --ink: #17211d;
  --muted: #68746f;
  --line: #dce4df;
  --paper: #f7f8f5;
  --white: #ffffff;
  --accent: #b7863b;
  --accent-dark: #805a24;
  --soft: #eef3f0;
  --danger: #a33a32;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: var(--green);
  color: var(--white);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px clamp(18px, 5vw, 56px);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-logo {
  display: block;
  height: auto;
  max-height: 42px;
  max-width: 132px;
  object-fit: contain;
  width: auto;
}

.brand span {
  font-size: 20px;
  font-weight: 750;
}

.nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.nav a,
.button,
button,
input[type="submit"] {
  align-items: center;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 6px;
  color: var(--white);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  text-decoration: none;
}

.topbar .nav a {
  background: transparent;
  border-color: rgba(255, 255, 255, .24);
}

.user-badge {
  align-items: center;
  color: rgba(255, 255, 255, .72);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  margin-right: 14px;
  min-height: 36px;
}

.topbar .nav .logout-link {
  background: rgba(163, 58, 50, .2);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  color: var(--white);
  min-height: 40px;
  padding: 4px;
}

.topbar .nav .logout-link:hover {
  background: rgba(163, 58, 50, .34);
  border-color: rgba(255, 255, 255, .28);
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.icon-button,
.topbar .nav .icon-button {
  background: transparent;
  border: 0;
  color: #000;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  width: 32px;
}

.icon-button:hover,
.topbar .nav .icon-button:hover {
  background: transparent;
  border: 0;
  color: #000;
}

.topbar .nav .logout-link.icon-button,
.topbar .nav .logout-link.icon-button:hover {
  min-height: 40px;
  min-width: 40px;
  width: 40px;
}

.topbar .nav .logout-link.icon-button {
  background: rgba(163, 58, 50, .2);
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--white);
}

.topbar .nav .logout-link.icon-button:hover {
  background: rgba(163, 58, 50, .34);
  border-color: rgba(255, 255, 255, .28);
  color: var(--white);
}

.icon-button img {
  display: block;
  height: 32px;
  width: 32px;
}

.logout-link.icon-button img {
  filter: brightness(0) invert(1);
}

.button.secondary,
button.secondary {
  background: var(--white);
  border-color: var(--line);
  color: var(--green);
}

.primary-action {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
  min-width: 148px;
}

.primary-action:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.primary-action.icon-button,
.primary-action.icon-button:hover {
  background: transparent;
  border: 0;
  color: #000;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  width: 32px;
}

.button.danger,
button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.content {
  margin: 0 auto;
  max-width: 1180px;
  padding: 34px clamp(18px, 5vw, 56px) 56px;
}

.auth {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(16, 40, 32, .08);
  margin: 0 auto;
  max-width: 460px;
  padding: 28px;
  width: 100%;
}

.panel.wide {
  max-width: none;
}

h1,
h2 {
  color: var(--green);
  letter-spacing: 0;
  margin: 0 0 16px;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
}

h2 {
  font-size: 22px;
}

.lead {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 22px;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.folder-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 150px;
  overflow: hidden;
  position: relative;
}

.folder-card::before {
  content: "";
  display: block;
  height: 6px;
  inset: 0 0 auto;
  position: absolute;
}

.folder-card .meta {
  color: var(--muted);
  font-size: 14px;
}

.folder-theme-owners {
  --folder-color: #2f6f9f;
  --folder-soft: #eaf2f7;
  --folder-ink: #1d4f73;
}

.folder-theme-marketing {
  --folder-color: #d98238;
  --folder-soft: #fbefe5;
  --folder-ink: #8d4d1f;
}

.folder-theme-administracion {
  --folder-color: #c6a15b;
  --folder-soft: #f7f0df;
  --folder-ink: #7a602b;
}

.folder-theme-comunicacion {
  --folder-color: #4f8f7b;
  --folder-soft: #e8f3ef;
  --folder-ink: #2e6556;
}

.folder-theme-academia {
  --folder-color: #7d7199;
  --folder-soft: #f0edf5;
  --folder-ink: #564b74;
}

.folder-theme-default {
  --folder-color: var(--green);
  --folder-soft: var(--soft);
  --folder-ink: var(--green);
}

.folder-card[class*="folder-theme-"] {
  background: linear-gradient(180deg, var(--folder-soft) 0, var(--white) 54px);
  border-color: var(--folder-color);
  padding-top: 24px;
}

.folder-card[class*="folder-theme-"]::before {
  background: var(--folder-color);
}

.folder-card[class*="folder-theme-"] h2 {
  color: var(--folder-ink);
}

.folder-title {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.folder-title h1 {
  margin-bottom: 0;
}

.folder-title .back-link {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 700;
  height: 42px;
  justify-content: center;
  line-height: 1;
  text-decoration: none;
  width: 42px;
}

.folder-title .back-link:hover {
  background: var(--soft);
}

.page-head {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-right: 2px;
}

.page-head .lead {
  margin-bottom: 0;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
}

fieldset {
  background: var(--soft);
  border: 1px solid #d7e1dc;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
}

legend {
  color: var(--green);
  font-size: 14px;
  font-weight: 750;
  padding: 0 6px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}

.modal {
  background: var(--white);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(16, 40, 32, .26);
  max-height: min(720px, calc(100vh - 48px));
  max-width: 720px;
  overflow: auto;
  padding: 26px;
  width: min(100%, 720px);
}

.modal::backdrop {
  background: rgba(16, 40, 32, .54);
}

.modal-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-head h2 {
  font-size: 24px;
  margin-bottom: 0;
}

.modal-close {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green);
  display: inline-flex;
  font-size: 24px;
  font-weight: 600;
  height: 38px;
  justify-content: center;
  line-height: 1;
  min-height: 38px;
  padding: 0;
  text-decoration: none;
  width: 38px;
}

.modal-close:hover {
  background: var(--soft);
}

.modal-form {
  gap: 18px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  color: var(--green);
  display: grid;
  font-size: 14px;
  font-weight: 750;
  gap: 7px;
}

input,
select,
textarea {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(183, 134, 59, .18);
}

input[type="checkbox"] {
  min-height: auto;
  width: auto;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

.checks {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checks label {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  font-weight: 600;
  gap: 9px;
  min-height: 42px;
  padding: 10px 12px;
}

.checks input {
  min-height: auto;
  width: auto;
}

.notice,
.error {
  border-radius: 6px;
  font-weight: 650;
  margin: 0 0 18px;
  padding: 12px 14px;
}

.notice {
  background: #e7f2eb;
  color: #1f5a37;
}

.error {
  background: #f7e8e6;
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

.content-row {
  transition: background .16s ease;
}

.content-row:hover td {
  background: #fbfcfa;
}

.file-cell {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.file-icon {
  display: block;
  flex: 0 0 34px;
  height: 34px;
  object-fit: contain;
  width: 34px;
}

.file-name {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.type-badge {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  min-height: 28px;
  padding: 7px 10px;
  white-space: nowrap;
}

.type-badge.item-kind-folder {
  background: #f7f0df;
  border-color: #e5cf9b;
  color: #7a602b;
}

.type-badge.item-kind-pdf {
  background: #f7e8e6;
  border-color: #edc8c3;
  color: #a33a32;
}

.type-badge.item-kind-image {
  background: #e8f3ef;
  border-color: #c8dfd6;
  color: #2e6556;
}

.type-badge.item-kind-text,
.type-badge.item-kind-document {
  background: #eaf2f7;
  border-color: #c8ddea;
  color: #1d4f73;
}

tr[class*="folder-theme-"] td {
  background: linear-gradient(90deg, var(--folder-soft), var(--white) 72%);
}

tr[class*="folder-theme-"] td:first-child {
  border-left: 6px solid var(--folder-color);
  color: var(--folder-ink);
  font-weight: 750;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions form {
  display: inline;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 30px;
  text-align: center;
}

.breadcrumbs {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.breadcrumbs a {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

  @media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .page-head {
    align-items: stretch;
    display: grid;
  }

  .page-head .button,
  .page-head button {
    justify-self: end;
  }

  .modal {
    padding: 18px;
    width: calc(100% - 28px);
  }

  .form-actions {
    display: grid;
  }

  .checks {
    grid-template-columns: 1fr;
  }

  .actions .button,
  .actions button {
    width: 100%;
  }

}
