*, *::before, *::after { font-family: 'Open Sans', sans-serif; box-sizing: border-box; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #F4F3F0; }
::-webkit-scrollbar-thumb { background: #C8C6BC; border-radius: 4px; }

/* Checkbox */
.cb {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; flex-shrink: 0;
  border: 1.5px solid #C8C6BC; border-radius: 3px;
  cursor: pointer; position: relative;
  transition: border-color 0.12s, background 0.12s;
  background: white;
}
.cb:hover { border-color: #979271; }
.cb:checked { background: #F13110; border-color: #F13110; }
.cb:checked::after {
  content: '';
  position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid white; border-top: none; border-left: none;
  transform: rotate(45deg);
}
.cb:indeterminate { background: #F13110; border-color: #F13110; }
.cb:indeterminate::after {
  content: '';
  position: absolute; left: 2px; top: 5px;
  width: 8px; height: 2px; background: white;
}

/* Table row */
.sds-row { transition: background 0.08s; cursor: default; }
.sds-row:hover { background: #F9F8F6; }
.sds-row.sel { background: #FEF1EE; }
.sds-row.sel:hover { background: #FDEBE7; }

/* Badge */
.badge-new {
  display: inline-flex; align-items: center;
  padding: 1px 5px; gap: 2px;
  background: #F13110; color: white;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.06em; border-radius: 3px;
  text-transform: uppercase; line-height: 1.4;
  vertical-align: middle;
}

/* Sort header */
.sort-th { cursor: pointer; user-select: none; white-space: nowrap; }
.sort-th:hover { color: #F13110; }

/* Toast */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 11px 18px; background: #0E1726; color: white;
  border-radius: 8px; font-size: 13px; font-weight: 500;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 9999; pointer-events: none;
  box-shadow: 0 4px 24px rgba(14,23,38,0.28), 0 1px 4px rgba(14,23,38,0.12);
  max-width: 360px;
}
#toast.on { opacity: 1; transform: translateY(0); }

/* Select dropdown */
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23979271' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px !important;
}

/* Pill filter button */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  border: 1.5px solid #E2E0D8; background: white; color: #0E1726;
  cursor: pointer; transition: border-color 0.12s, background 0.12s, color 0.12s;
  white-space: nowrap;
}
.pill:hover { border-color: #979271; }
.pill.on { background: #F13110; border-color: #F13110; color: white; }

/* Input focus */
.inp {
  outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.inp:focus { border-color: #0E1726 !important; background: white !important; box-shadow: 0 0 0 3px rgba(14,23,38,0.06); }

/* Download btn */
.dl-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
  border: 1.5px solid #E2E0D8; color: #0E1726; background: white;
  cursor: pointer; transition: border-color 0.12s, color 0.12s, background 0.12s;
  white-space: nowrap;
}
.dl-btn:hover { border-color: #F13110; color: #F13110; }
.dl-btn:active { transform: scale(0.97); }

/* Main CTA button */
.cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: white;
  background: #F13110; border: none; cursor: pointer;
  transition: background 0.12s, transform 0.08s;
  box-shadow: 0 2px 8px rgba(241,49,16,0.28), 0 1px 2px rgba(241,49,16,0.16);
}
.cta:hover { background: #D42A0D; }
.cta:active { transform: scale(0.97); }
.cta:disabled { background: #D0CEC8; box-shadow: none; cursor: not-allowed; transform: none; }

/* Card */
.card {
  background: white; border-radius: 12px;
  box-shadow: 0 1px 2px rgba(14,23,38,0.05), 0 4px 20px rgba(14,23,38,0.06);
}

/* Language chip */
.lang-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 12px; font-weight: 600;
  background: #F4F3F0; color: #0E1726;
}

/* Standard chip */
.std-chip {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
  background: #E2E0D8; color: #4A4840;
  letter-spacing: 0.02em;
}

/* Login page background */
.login-bg {
  background:
    radial-gradient(ellipse 70% 50% at 80% -10%, rgba(241,49,16,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at -10% 110%, rgba(14,23,38,0.05) 0%, transparent 55%),
    #F4F3F0;
}

/* Nav tab */
.nav-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 4px; height: 56px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  color: rgba(255,255,255,0.45); background: none; border: none;
  cursor: pointer; position: relative;
  transition: color 0.12s;
  white-space: nowrap;
}
.nav-tab::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: #F13110; border-radius: 2px 2px 0 0;
  opacity: 0; transition: opacity 0.12s;
}
.nav-tab:hover { color: rgba(255,255,255,0.75); }
.nav-tab.active { color: white; }
.nav-tab.active::after { opacity: 1; }

/* Drop zone */
.drop-zone {
  border: 2px dashed #E2E0D8; border-radius: 10px;
  padding: 40px 24px; text-align: center;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer; position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: #F13110; background: #FEF9F8;
}
.drop-zone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

/* Staged file item */
.staged-item {
  display: grid;
  grid-template-columns: 26px minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 28px;
  gap: 8px; align-items: center;
  padding: 10px 14px; border-radius: 8px;
  background: #F9F8F6; border: 1px solid #F0EEEA;
  margin-bottom: 6px;
  overflow: hidden;
}
.staged-item input, .staged-item select {
  padding: 6px 8px; border: 1.5px solid #E2E0D8; border-radius: 6px;
  font-size: 12px; color: #0E1726; background: white; width: 100%;
  outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.staged-item input:focus, .staged-item select:focus {
  border-color: #0E1726; box-shadow: 0 0 0 3px rgba(14,23,38,0.06);
}
.staged-item select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23979271' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; padding-right: 26px !important;
}

.staged-group-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 8px; border: 1.5px solid #E2E0D8; border-radius: 6px;
  font-size: 12px; color: #0E1726; background: white; width: 100%;
  cursor: pointer; text-align: left; outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.staged-group-btn:hover { border-color: #979271; }
.staged-group-btn:focus-visible { border-color: #0E1726; box-shadow: 0 0 0 3px rgba(14,23,38,0.06); }
.staged-group-btn:active { transform: scale(0.98); }

/* Admin delete button */
.del-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
  border: 1.5px solid #E2E0D8; color: #979271; background: white;
  cursor: pointer; transition: border-color 0.12s, color 0.12s, background 0.12s;
  white-space: nowrap;
}
.del-btn:hover { border-color: #F13110; color: #F13110; background: #FEF9F8; }
.del-btn:active { transform: scale(0.97); }

/* Danger CTA (bulk delete) */
.danger-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: white;
  background: #C42300; border: none; cursor: pointer;
  transition: background 0.12s, transform 0.08s;
  box-shadow: 0 2px 8px rgba(196,35,0,0.28), 0 1px 2px rgba(196,35,0,0.16);
}
.danger-cta:hover { background: #A81E00; }
.danger-cta:active { transform: scale(0.97); }

/* Delete confirm overlay */
#delete-confirm {
  position: fixed; inset: 0; background: rgba(14,23,38,0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 9000; padding: 24px;
  backdrop-filter: blur(2px);
}
#delete-confirm.on { display: flex; }

/* User modal overlay */
#user-modal {
  position: fixed; inset: 0; background: rgba(14,23,38,0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 9000; padding: 24px;
  backdrop-filter: blur(2px);
}
#user-modal.on { display: flex; }

/* Role badge */
.role-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.role-badge.admin        { background: #FEF1EE; color: #C42300; }
.role-badge.file_manager { background: #EEF3FE; color: #1A4FC4; }
.role-badge.user         { background: #F4F3F0; color: #4A4840; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
