/* HW Rental Trucks v3.0 — Premium Design System */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }

:root {
  /* Colors — Sophisticated, near-monochrome with strategic accents */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --surface-3: #ebebef;

  --border: #e4e4e7;
  --border-strong: #d4d4d8;

  --text: #18181b;
  --text-2: #52525b;
  --text-3: #a1a1aa;

  --primary: #0f172a;
  --primary-hover: #1e293b;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;

  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Shadows — soft, layered */
  --sh-1: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --sh-2: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --sh-3: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --sh-4: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --sh-5: 0 20px 25px -5px rgba(0, 0, 0, 0.10), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  /* Transitions */
  --tx-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --tx-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Font */
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: color var(--tx-fast) }
a:hover { color: var(--accent-hover) }

button { font-family: inherit; cursor: pointer; border: 0; background: none }

/* ==================== TOPBAR ==================== */
.bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(10px);
  background-color: rgba(255, 255, 255, 0.85);
}
.bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0 var(--s-5);
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--primary);
  white-space: nowrap;
  padding: var(--s-2) 0;
}
.brand:hover { color: var(--primary); text-decoration: none }
.brand-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  color: white;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-size: 16px;
}

/* Mobile menu toggle */
.menu-btn {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  align-items: center;
  justify-content: center;
  color: var(--text);
  margin-left: auto;
}
.menu-btn:hover { background: var(--surface-2) }
.menu-btn svg { width: 22px; height: 22px }

/* Nav */
.nav {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 2px;
  margin-left: var(--s-4);
}
.nav a {
  padding: var(--s-2) var(--s-3);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-sm);
  transition: all var(--tx-fast);
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none }
.nav a.on {
  color: var(--text);
  background: var(--surface-2);
  font-weight: 600;
}

.bar-right {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: 14px;
}
.uname {
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
}
.uname-sub {
  display: block;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 400;
}

.lang {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: var(--r-full);
  padding: 2px;
  gap: 1px;
}
.lang a {
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.02em;
  transition: all var(--tx-fast);
}
.lang a.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-2) }
.lang a:hover { text-decoration: none; color: var(--text) }

/* ==================== MOBILE DRAWER ==================== */
.drawer-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 60;
  opacity: 0;
  transition: opacity var(--tx-base);
}
.drawer-bg.show { display: block; opacity: 1 }

.drawer {
  position: fixed;
  top: 0; right: 0;
  width: 280px;
  height: 100vh;
  background: var(--surface);
  z-index: 70;
  transform: translateX(100%);
  transition: transform var(--tx-base);
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-5);
}
.drawer.show { transform: translateX(0) }

.drawer-h {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-h .brand { font-size: 16px }
.drawer-x {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  color: var(--text-2);
}
.drawer-x:hover { background: var(--surface-2) }

.drawer-nav {
  padding: var(--s-3);
  flex: 1;
  overflow-y: auto;
}
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--r-md);
  transition: background var(--tx-fast);
}
.drawer-nav a:hover { background: var(--surface-2); text-decoration: none }
.drawer-nav a.on { background: var(--surface-2); color: var(--text); font-weight: 600 }
.drawer-nav .ico { font-size: 18px; width: 22px; text-align: center }

.drawer-foot {
  border-top: 1px solid var(--border);
  padding: var(--s-4) var(--s-5);
}
.drawer-user {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.avatar {
  width: 36px; height: 36px;
  background: var(--primary);
  color: white;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
}
.drawer-foot .lang {
  width: fit-content;
  margin-bottom: var(--s-3);
}

/* ==================== LAYOUT ==================== */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--s-6) var(--s-5);
}
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.head h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}
.head .head-sub {
  font-size: 14px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ==================== STATS ==================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  transition: all var(--tx-base);
  position: relative;
  overflow: hidden;
}
.stat:hover { box-shadow: var(--sh-3); border-color: var(--border-strong) }
.stat .l {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stat .v {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-top: var(--s-2);
  color: var(--text);
  line-height: 1;
}
.stat .ic {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 20px;
  opacity: 0.7;
}
.stat.ok .ic { background: var(--success-soft); color: var(--success) }
.stat.warn .ic { background: var(--warning-soft); color: var(--warning) }
.stat.acc .ic { background: var(--accent-soft); color: var(--accent) }

/* ==================== CARDS ==================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: var(--s-5);
  overflow: hidden;
}
.card-h {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.card-h h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card-h .count {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}
.card-b { padding: var(--s-5) }
.card-b.p0 { padding: 0 }

/* ==================== TRUCK CARDS (active rentals) ==================== */
.active-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s-4);
}
.t-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  transition: all var(--tx-base);
  position: relative;
}
.t-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--sh-3);
  transform: translateY(-1px);
}
.t-card .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
}
.t-card .unit {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.t-card .plate {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  letter-spacing: 0.05em;
}
.t-card .dot {
  width: 8px; height: 8px;
  border-radius: var(--r-full);
  background: var(--warning);
  box-shadow: 0 0 0 4px var(--warning-soft);
  flex-shrink: 0;
  margin-top: var(--s-1);
}
.t-card .dot.ok { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft) }
.t-card .meta {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  font-size: 14px;
  color: var(--text-2);
}
.t-card .meta-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.t-card .meta-row .ico {
  width: 16px;
  color: var(--text-3);
  font-size: 14px;
  flex-shrink: 0;
}
.t-card .meta-row strong { color: var(--text); font-weight: 600 }
.t-card .ret-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  padding: var(--s-3) var(--s-4);
  background: var(--text);
  color: white;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 14px;
  margin-top: var(--s-2);
  transition: all var(--tx-fast);
}
.t-card .ret-btn:hover { background: var(--primary-hover); text-decoration: none }

/* ==================== TABLES ==================== */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch }
table { width: 100%; border-collapse: collapse }
table th {
  background: var(--surface-2);
  padding: var(--s-3) var(--s-4);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table td {
  padding: var(--s-4);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}
table tr:last-child td { border-bottom: 0 }
table tr:hover td { background: var(--surface-2) }
table .mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); letter-spacing: 0.02em }

/* ==================== FORMS ==================== */
.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-4);
}
.fld { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-4) }
.fld label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
}
.fld label .req { color: var(--danger); margin-left: 2px }

.fld input, .fld select, .fld textarea,
input.in, select.in, textarea.in {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: all var(--tx-fast);
  -webkit-appearance: none;
  appearance: none;
}
.fld select, select.in {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='%2371717a'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 011.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z' clip-rule='evenodd' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}
.fld input:focus, .fld select:focus, .fld textarea:focus,
input.in:focus, select.in:focus, textarea.in:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.fld input::placeholder, .fld textarea::placeholder { color: var(--text-3) }
.fld textarea, textarea.in { resize: vertical; min-height: 80px; line-height: 1.5 }
.fld .hint { font-size: 12px; color: var(--text-3); margin-top: 2px }

/* Combo: select + add button */
.combo { display: flex; gap: var(--s-2) }
.combo select { flex: 1 }
.combo .add {
  background: var(--text);
  color: white;
  border-radius: var(--r-md);
  padding: 0 var(--s-4);
  font-size: 18px;
  font-weight: 400;
  white-space: nowrap;
  transition: all var(--tx-fast);
  display: grid;
  place-items: center;
  min-width: 44px;
}
.combo .add:hover { background: var(--primary-hover) }
.combo .add:active { transform: scale(0.96) }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--tx-fast);
  letter-spacing: -0.005em;
  white-space: nowrap;
  user-select: none;
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  text-decoration: none;
}
.btn:active { transform: scale(0.98) }
.btn-p { background: var(--text); color: white; border-color: var(--text) }
.btn-p:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: white }
.btn-acc { background: var(--accent); color: white; border-color: var(--accent) }
.btn-acc:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: white }
.btn-ok { background: var(--success); color: white; border-color: var(--success) }
.btn-ok:hover { background: #059669; border-color: #059669; color: white }
.btn-err { background: var(--surface); color: var(--danger); border-color: var(--border) }
.btn-err:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger) }
.btn-sm { padding: 6px 12px; font-size: 13px }
.btn-lg { padding: 12px 20px; font-size: 15px; font-weight: 600 }
.btn-block { width: 100%; display: flex }

/* ==================== BADGES ==================== */
.b {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.b::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: var(--r-full);
  background: currentColor;
}

/* ==================== ALERTS ==================== */
.alert {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  margin-bottom: var(--s-4);
  font-size: 14px;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.alert-ok { background: var(--success-soft); color: #065f46; border-color: #a7f3d0 }
.alert-err { background: var(--danger-soft); color: #991b1b; border-color: #fecaca }
.alert-info { background: var(--accent-soft); color: #1e40af; border-color: #bfdbfe }

/* ==================== LOGIN ==================== */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
  background:
    radial-gradient(at 30% 20%, rgba(37, 99, 235, 0.10) 0px, transparent 50%),
    radial-gradient(at 80% 80%, rgba(15, 23, 42, 0.08) 0px, transparent 50%),
    var(--bg);
}
.login-box {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: var(--s-10) var(--s-8);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--sh-5);
  border: 1px solid var(--border);
}
.login-box .logo {
  width: 56px; height: 56px;
  background: var(--primary);
  color: white;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  font-size: 28px;
  margin: 0 auto var(--s-5);
}
.login-box h1 {
  font-size: 24px;
  text-align: center;
  margin-bottom: var(--s-1);
  font-weight: 700;
  letter-spacing: -0.025em;
}
.login-box .sub {
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  margin-bottom: var(--s-8);
}
.login-box .lang {
  margin: 0 auto var(--s-6);
  display: flex;
  width: fit-content;
}
.login-box .btn { width: 100%; padding: 12px; font-size: 15px }
.login-tip {
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
}

/* ==================== MODAL ==================== */
.mdl {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(4px);
  animation: fadeIn var(--tx-base);
}
.mdl.show { display: flex }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(100%) } to { transform: translateY(0) } }

.mdl-box {
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp var(--tx-base);
  box-shadow: var(--sh-5);
}
.mdl-h {
  padding: var(--s-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.mdl-h h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mdl-x {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-size: 22px;
  line-height: 1;
}
.mdl-x:hover { background: var(--surface-2); color: var(--text) }
.mdl-b { padding: var(--s-5) }
.mdl-f {
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--s-2);
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--surface);
}
.mdl-err {
  font-size: 13px;
  color: var(--danger);
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--danger-soft);
  border-radius: var(--r-sm);
  display: none;
}
.mdl-err:not(:empty) { display: block }

/* ==================== HELPERS ==================== */
.muted { color: var(--text-3) }
.right { text-align: right }
.center { text-align: center }
.mt-2 { margin-top: var(--s-4) }
.mt-3 { margin-top: var(--s-5) }
.mb-2 { margin-bottom: var(--s-4) }
.mb-3 { margin-bottom: var(--s-5) }
.gap-1 { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center }
.gap-2 { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center }
.flex { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap }
.flex-1 { flex: 1 }
.empty {
  padding: var(--s-12) var(--s-5);
  text-align: center;
  color: var(--text-3);
}
.empty-ico {
  font-size: 40px;
  opacity: 0.4;
  margin-bottom: var(--s-3);
  display: block;
}

/* ==================== RESPONSIVE — MOBILE ==================== */
@media (max-width: 900px) {
  .nav { display: none }
  .menu-btn { display: flex }
  .uname-block { display: none }
  .lang { display: none }
  .bar-right .btn { display: none }
}

@media (max-width: 640px) {
  .bar-inner { padding: 0 var(--s-3); height: 56px }
  .brand { font-size: 16px }
  .brand-icon { width: 30px; height: 30px; font-size: 15px }
  .wrap { padding: var(--s-4) var(--s-3) }
  .head { margin-bottom: var(--s-4) }
  .head h1 { font-size: 22px }
  .stats { gap: var(--s-2); margin-bottom: var(--s-4) }
  .stat { padding: var(--s-3) var(--s-4) }
  .stat .v { font-size: 24px }
  .stat .ic { width: 32px; height: 32px; font-size: 16px; top: var(--s-3); right: var(--s-3) }
  .card-h, .card-b { padding: var(--s-4) }
  .card-h h2 { font-size: 14px }
  .active-grid { grid-template-columns: 1fr; gap: var(--s-3) }
  .row { gap: var(--s-3) }
  .fld input, .fld select, .fld textarea {
    padding: 12px 14px;
    font-size: 16px; /* Evita zoom en iOS */
  }
  .btn { padding: 10px 16px }
  .btn-lg { padding: 14px 20px }
  table th, table td { padding: var(--s-3) }
  .login-box { padding: var(--s-8) var(--s-5) }
}

@media print {
  .bar, .btn, .menu-btn, .drawer, .drawer-bg, .no-p { display: none !important }
  .wrap { max-width: 100%; padding: 0 }
  .card { box-shadow: none; border: 1px solid #ccc }
}

/* iOS safe area */
@supports (padding: env(safe-area-inset-top)) {
  .bar { padding-top: env(safe-area-inset-top) }
  .drawer { padding-top: env(safe-area-inset-top) }
}

/* ==================== UPLOADS ==================== */
.upload-area {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--s-4);
  background: var(--surface-2);
  transition: all var(--tx-fast);
}
.upload-area:hover { border-color: var(--accent); background: var(--accent-soft) }

.upload-buttons {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
}
.upload-btn {
  flex: 1;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 500;
  padding: 12px 16px;
}

.upload-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--s-2);
}
.upload-list:empty { display: none }

.att-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--border);
}
.att-item img, .att-item video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.att-item .att-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 26px; height: 26px;
  border-radius: var(--r-full);
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 0;
  z-index: 2;
}
.att-item .att-del:hover { background: var(--danger) }
.att-item .att-vid-ico {
  position: absolute;
  bottom: 4px; left: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  font-size: 11px;
}
.att-item .att-status {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: grid;
  place-items: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.upload-progress {
  margin-top: var(--s-3);
}
.progress-bar {
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width var(--tx-fast);
}
.progress-text {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

/* Galería en vista detalle */
.att-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--s-2);
}
.att-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-3);
  display: block;
}
.att-thumb img, .att-thumb video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.att-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.4);
  color: white;
  font-size: 20px;
}
