/* ============================================================
   FIT WORKS DISPLAY — Design System
   ============================================================ */

/* ===== VARIABLES ===== */
:root {
  --navy:       #1a3a6b;
  --navy-dk:    #142e57;
  --navy-lt:    #234d8a;
  --red:        #e02020;
  --red-dk:     #c01818;
  --green:      #4caf50;
  --green-dk:   #388e3c;
  --bg:         #f4f5f9;
  --white:      #ffffff;
  --text:       #2d3748;
  --text-md:    #4a5568;
  --text-sm:    #718096;
  --border:     #e2e8f0;
  --border-dk:  #cbd5e0;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow:     0 2px 8px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.14);
  --r:          8px;
  --r-sm:       4px;
  --sidebar-w:  240px;
  --topbar-h:   60px;
  --transition: 150ms ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
       color: var(--text); background: var(--bg); line-height: 1.5; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font: inherit; }
input, select, textarea { font: inherit; }
ul { list-style: none; }
svg { display: block; fill: none; stroke: currentColor;
      stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ===== APP SHELL ===== */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition);
  z-index: 100;
}
.sidebar-brand {
  padding: 0 20px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  user-select: none;
}
.brand-fit    { color: var(--red);   font-weight: 800; font-size: 18px; letter-spacing: -0.5px; }
.brand-works  { color: #fff;         font-weight: 800; font-size: 18px; letter-spacing: -0.5px; }
.brand-display{ color: rgba(255,255,255,.45); font-weight: 400; font-size: 11px;
                margin-left: 6px; text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav { flex: 1; padding: 8px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,.70);
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  font-size: 13.5px;
  text-decoration: none;
}
.nav-item:hover  { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: var(--red); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 12px;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--navy-lt);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.user-details { overflow: hidden; }
.user-name { display: block; color: #fff; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; color: rgba(255,255,255,.45); font-size: 11px; text-transform: capitalize; }
.nav-logout { border-left-color: transparent !important; background: none !important; width: 100%; border: none; text-align: left; }
.nav-logout:hover { background: rgba(255,255,255,.08) !important; }

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 50;
}
.topbar-toggle { display: none; }
.breadcrumb { flex: 1; font-size: 14px; color: var(--text-md); font-weight: 500; }
.topbar-end { display: flex; align-items: center; gap: 12px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(76,175,80,.25);
}
.status-dot.offline { background: var(--red); box-shadow: 0 0 0 2px rgba(224,32,32,.25); }

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
  padding: 24px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text); }
.page-loading { display: flex; justify-content: center; padding: 60px 0; }

/* ===== LOGIN ===== */
.page-login {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-lt) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.login-brand {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-bottom: 4px;
}
.login-subtitle { font-size: 13px; color: var(--text-sm); margin-bottom: 28px; }
.login-lgpd  { font-size: 11px; color: var(--text-sm); margin-top: 20px; line-height: 1.6; }
.login-footer{ font-size: 11px; color: var(--text-sm); margin-top: 8px; text-align: center; }

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.card-header {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-body { padding: 20px; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--r);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.navy  { background: rgba(26,58,107,.10); color: var(--navy); }
.stat-icon.red   { background: rgba(224,32,32,.10); color: var(--red); }
.stat-icon.green { background: rgba(76,175,80,.10); color: var(--green); }
.stat-number { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label  { font-size: 12px; color: var(--text-sm); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-sm);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-md);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(26,58,107,.03); }
.table .actions { display: flex; gap: 4px; }

/* ===== FORMS ===== */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label, label.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-md);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.field-hint { font-size: 11px; color: var(--text-sm); margin-top: 4px; }
.field-error { font-size: 11px; color: var(--red); margin-top: 4px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="time"],
input[type="url"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,58,107,.12);
}
input.error, select.error, textarea.error { border-color: var(--red); }
textarea { resize: vertical; min-height: 100px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718096' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
input[type="color"] { padding: 2px 4px; height: 36px; cursor: pointer; }

.input-row { display: flex; position: relative; }
.input-row input { flex: 1; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.btn-input-action {
  padding: 0 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--text-sm);
  display: flex; align-items: center;
}
.btn-input-action:hover { background: var(--border); color: var(--text); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type="color"] { width: 44px; flex-shrink: 0; }
.color-field input[type="text"] { flex: 1; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 15px; height: 15px; }

.btn-primary  { background: var(--red);    color: #fff;          border-color: var(--red-dk); }
.btn-primary:hover  { background: var(--red-dk); }

.btn-secondary { background: var(--white); color: var(--text-md); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: var(--border-dk); }

.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-navy { background: var(--navy); color: #fff; border-color: var(--navy-dk); }
.btn-navy:hover { background: var(--navy-dk); }

.btn-ghost { background: transparent; color: var(--text-sm); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 32px; height: 32px; padding: 0;
  background: transparent; border: none; color: var(--text-sm);
  border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon svg { width: 16px; height: 16px; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-green  { background: rgba(76,175,80,.12); color: var(--green-dk); }
.badge-red    { background: rgba(224,32,32,.12); color: var(--red-dk); }
.badge-navy   { background: rgba(26,58,107,.10); color: var(--navy); }
.badge-gray   { background: var(--bg); color: var(--text-sm); border: 1px solid var(--border); }
.badge-orange { background: rgba(245,158,11,.12); color: #b45309; }

/* ===== ALERTS ===== */
.alert {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.alert-error  { background: rgba(224,32,32,.08); color: var(--red-dk); border: 1px solid rgba(224,32,32,.25); }
.alert-success{ background: rgba(76,175,80,.08); color: var(--green-dk); border: 1px solid rgba(76,175,80,.25); }
.alert-info   { background: rgba(26,58,107,.06); color: var(--navy); border: 1px solid rgba(26,58,107,.20); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  animation: modalIn .18s ease;
}
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }
@keyframes modalIn { from { opacity:0; transform:scale(.96) translateY(8px); } to { opacity:1; transform:none; } }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ===== TOASTS ===== */
#toastContainer {
  position: fixed; top: 20px; right: 20px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: all;
  background: var(--white);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--border);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  min-width: 260px; max-width: 380px;
  transform: translateX(110%);
  transition: transform .25s ease, opacity .25s ease;
  opacity: 0;
}
.toast.show { transform: none; opacity: 1; }
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.info    { border-left-color: var(--navy); }
.toast-msg { flex: 1; }
.toast-close { background: none; border: none; font-size: 16px; color: var(--text-sm); padding: 0 2px; line-height: 1; }
.toast-close:hover { color: var(--text); }

/* ===== DRAG-AND-DROP PLAYLIST ===== */
.playlist-list { display: flex; flex-direction: column; gap: 4px; }
.playlist-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  transition: box-shadow var(--transition), border-color var(--transition);
  cursor: default;
}
.playlist-item:hover { border-color: var(--border-dk); box-shadow: var(--shadow-sm); }
.playlist-item.dragging { opacity: .45; box-shadow: var(--shadow-lg); }
.playlist-item.drag-over { border-color: var(--navy); border-style: dashed; }
.drag-handle {
  color: var(--text-sm); cursor: grab;
  flex-shrink: 0;
  display: flex; align-items: center;
}
.drag-handle svg { width: 16px; height: 16px; }
.drag-handle:active { cursor: grabbing; }
.item-info { flex: 1; min-width: 0; }
.item-title { font-size: 13.5px; font-weight: 500; color: var(--text);
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta  { font-size: 11px; color: var(--text-sm); margin-top: 2px; }
.item-time-wrap { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.time-input {
  width: 64px !important; text-align: center;
  padding: 5px 8px !important;
  font-size: 13px !important;
}
.item-actions { display: flex; gap: 2px; flex-shrink: 0; }

/* ===== EDITOR TOOLBAR ===== */
.editor-container { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 2px;
  padding: 6px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.editor-btn {
  padding: 4px 8px;
  background: none; border: 1px solid transparent;
  border-radius: 3px;
  font-size: 13px; color: var(--text-md);
  min-width: 28px; min-height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.editor-btn:hover { background: var(--white); border-color: var(--border); }
.editor-btn.active { background: rgba(26,58,107,.08); color: var(--navy); border-color: var(--navy-lt); }
.editor-sep { width: 1px; background: var(--border); margin: 2px 4px; align-self: stretch; }
.editor-select { padding: 3px 6px; font-size: 12px; height: 28px; border: 1px solid var(--border); border-radius: 3px; }
.editor-body {
  min-height: 200px; max-height: 400px;
  padding: 14px;
  overflow-y: auto;
  outline: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}
.editor-body:focus { box-shadow: inset 0 0 0 2px rgba(26,58,107,.15); }

/* ===== TV PREVIEW ===== */
.tv-preview-outer {
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  background: #000;
  cursor: default;
}
.tv-preview-frame {
  width: 1920px;
  height: 1080px;
  transform-origin: top left;
  display: flex;
  position: relative;
  font-size: 28px;
  overflow: hidden;
}
.tv-zone-left  { display: flex; align-items: center; justify-content: center; background: #111; overflow: hidden; }
.tv-zone-right {
  display: flex; flex-direction: column;
  background: #fff;
  overflow: hidden;
}
.tv-zone-full  { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

.tv-header {
  padding: 28px 32px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.tv-header-logo { width: 90px; height: 90px; object-fit: contain; }
.tv-header-text { flex: 1; }
.tv-cond-name   { font-size: 28px; font-weight: 700; color: #1a3a6b; line-height: 1.2; }
.tv-cond-accent { height: 4px; border-radius: 2px; margin-top: 10px; }

.tv-com-title {
  font-size: 32px; font-weight: 800;
  text-align: center;
  padding: 24px 32px 20px;
  flex-shrink: 0;
  color: #1a1a1a;
}
.tv-com-body {
  flex: 1; overflow: hidden;
  padding: 0 32px;
  font-size: 22px;
  line-height: 1.65;
  color: #333;
}
.tv-com-footer {
  padding: 20px 32px 28px;
  font-size: 19px;
  color: #555;
  border-top: 1px solid #e2e2e2;
  flex-shrink: 0;
}
.tv-clock-overlay {
  position: absolute; top: 24px; right: 32px;
  font-size: 32px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,.55); padding: 8px 20px;
  border-radius: 40px; letter-spacing: 2px;
}
.tv-progress-bar {
  position: absolute; bottom: 0; left: 0;
  height: 6px; background: var(--red);
  transition: width .5s linear;
}

.tv-controls {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--r) var(--r);
  border-top: none;
}
.tv-controls .btn-icon { width: 40px; height: 40px; }
.tv-controls .btn-icon svg { width: 20px; height: 20px; }
.tv-item-info { flex: 1; font-size: 13px; color: var(--text-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-timer     { font-size: 13px; color: var(--text-sm); font-variant-numeric: tabular-nums; }

.mode-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.mode-tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--white);
  color: var(--text-md);
  transition: all var(--transition);
}
.mode-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ===== CONDOMÍNIO CARD ===== */
.cond-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cond-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.cond-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cond-card-header {
  height: 72px;
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
.cond-logo { max-height: 48px; max-width: 120px; object-fit: contain; }
.cond-logo-placeholder {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; color: #fff;
}
.cond-card-body { padding: 14px 16px; }
.cond-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.cond-meta { font-size: 12px; color: var(--text-sm); }
.cond-card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 4px;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-sm); pointer-events: none; }
.search-input { padding-left: 34px !important; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-sm);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: .35; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-md); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ===== SPINNER ===== */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.mt-4  { margin-top:  4px; }  .mt-8  { margin-top:  8px; }
.mt-12 { margin-top: 12px; }  .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }  .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; }
.flex-1{ flex: 1; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-sm { font-size: 12px; }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-gray  { color: var(--text-sm); }
.font-bold  { font-weight: 700; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider    { height: 1px; background: var(--border); margin: 16px 0; }
.thumbnail  { width: 64px; height: 40px; object-fit: cover; border-radius: 3px; background: var(--bg); flex-shrink: 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { position: fixed; height: 100%; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: none; }
  .topbar-toggle { display: flex; }
  .main-wrapper { margin-left: 0 !important; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .modal { max-height: 95vh; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .cond-grid  { grid-template-columns: 1fr; }
  .login-card { padding: 24px 20px; }
}
