/* ================================
   Design Tokens — Dark theme (default)
   ================================ */
:root {
  --bg-primary: #0c0c18;
  --bg-card: #131326;
  --bg-card-header: #161632;
  --bg-field: #1a1a2e;
  --bg-input: #151528;
  --border: #1e1e38;
  --text-primary: #e0e0e0;
  --text-secondary: #888;
  --text-muted: #555;
  --accent: #e94560;
  --green: #2ecc71;
  --red: #e74c3c;
  --blue: #3498db;
  --purple: #9b59b6;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
}

/* Light theme overrides */
.theme-light {
  --bg-primary: #f5f7fb;
  --bg-card: #ffffff;
  --bg-card-header: #fafbfd;
  --bg-field: #f1f3f9;
  --bg-input: #ffffff;
  --border: #e3e7ef;
  --text-primary: #1a1a2e;
  --text-secondary: #5b6373;
  --text-muted: #9098a8;
}

/* ================================
   Reset & Base
   ================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  line-height: 1.4;
  transition: background 0.25s ease, color 0.25s ease;
}

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

input, textarea {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ================================
   Login Page
   ================================ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.login-container {
  width: 100%;
  max-width: 360px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.login-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 24px;
}

.login-error {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 16px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.btn-login {
  background: var(--accent);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 11px;
  text-align: center;
  transition: opacity 0.15s;
  margin-top: 4px;
}

.btn-login:disabled {
  opacity: 0.6;
}

.btn-login:hover:not(:disabled) {
  opacity: 0.9;
}

/* ================================
   Header
   ================================ */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 48px;
  max-width: 700px;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.header-icon {
  flex-shrink: 0;
}

.header-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 480px) {
  .header-title { font-size: 14px; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-logout,
.btn-theme {
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.18s ease, color 0.18s ease;
}

.btn-logout:hover,
.btn-theme:hover {
  background: var(--bg-field);
  color: var(--text-primary);
}

.btn-theme svg {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

/* Default (dark theme): show sun (click to switch to light) */
.btn-theme .icon-sun { display: block; }
.btn-theme .icon-moon { display: none; }
body.theme-light .btn-theme .icon-sun { display: none; }
body.theme-light .btn-theme .icon-moon { display: block; }

.btn-theme:active svg {
  transform: rotate(35deg) scale(0.92);
}

/* ================================
   Search Bar
   ================================ */
.search-bar-wrap {
  padding: 10px 14px 0;
  max-width: 700px;
  margin: 0 auto;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 10px;
  gap: 8px;
}

.search-icon {
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  padding: 9px 0;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 4px;
  transition: background 0.15s;
}

.search-clear:hover {
  background: var(--border);
}

/* ================================
   Tabs
   ================================ */
.tabs-wrap {
  padding: 10px 14px 0;
  max-width: 700px;
  margin: 0 auto;
}

.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
  position: relative;
}

.tab:hover:not(.active) {
  color: var(--text-primary);
}

.tab.active {
  background: var(--bg-field);
  color: var(--text-primary);
}

.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.tab-icon svg { width: 100%; height: 100%; display: block; }

.tab-label {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  transition:
    max-width 0.40s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease 0.08s,
    margin-left 0.40s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab.active .tab-label {
  max-width: 160px;
  opacity: 1;
  margin-left: 7px;
}

.tab-count {
  background: var(--border);
  border-radius: 10px;
  font-size: 10px;
  padding: 1px 6px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 6px;
  transition: background 0.25s ease, color 0.25s ease;
}

.tab.active .tab-count {
  background: var(--accent);
  color: #fff;
}

/* ================================
   Main / Task List
   ================================ */
.main {
  padding: 10px 14px 80px;
  max-width: 700px;
  margin: 0 auto;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ================================
   States
   ================================ */
.state-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.state-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.empty-icon-wrap {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* ================================
   Card
   ================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: opacity 0.3s, border-color 0.2s, transform 0.15s;
}
.card:hover { border-color: rgba(233, 69, 96, 0.18); }
.card.expanded { border-color: rgba(233, 69, 96, 0.24); }

.card.fading {
  opacity: 0;
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--bg-card-header);
  user-select: none;
  -webkit-user-select: none;
}

.card-header:active {
  background: var(--bg-field);
}

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.12);
}
.avatar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.005em;
}

.card-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

/* Company badge */
.company-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  padding: 3px 7px;
}

.company-badge.Boxette {
  background: rgba(26, 188, 156, 0.15);
  color: #1abc9c;
  border: 1px solid rgba(26, 188, 156, 0.25);
}

.company-badge.Starling {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.25);
}

.video-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-field);
  padding: 2px 7px;
  border-radius: 10px;
}

.chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s;
  line-height: 1;
}

.card.expanded .chevron {
  transform: rotate(180deg);
}

/* ================================
   Card Expanded Content
   ================================ */
.card-body {
  border-top: 1px solid var(--border);
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Phone row */
.phone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-field);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  gap: 8px;
}

.phone-number {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.025em;
  font-variant-numeric: tabular-nums;
}

.btn-call {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(46, 204, 113, 0.13);
  color: var(--green);
  border: 1px solid rgba(46, 204, 113, 0.28);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}

.btn-call:hover {
  background: rgba(46, 204, 113, 0.22);
}
.btn-call:active {
  transform: scale(0.97);
}

/* Tracking row */
.tracking-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0;
}

.tracking-text {
  flex: 1;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: var(--text-primary);
  word-break: break-all;
}

.btn-copy {
  display: flex;
  align-items: center;
  padding: 4px;
  color: var(--text-muted);
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.btn-copy:hover {
  color: var(--text-primary);
  background: var(--border);
}

.btn-copy.copied {
  color: var(--green);
}

/* Info grid */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.info-cell {
  background: var(--bg-field);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: border-color 0.15s;
}
.info-cell:hover { border-color: var(--border); }

.info-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  font-weight: 500;
}

.info-value {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
  word-break: break-word;
  letter-spacing: 0.005em;
}

/* Section heading */
.section-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-bottom: 6px;
  font-weight: 600;
}

/* Subtasks */
.subtasks-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.subtask-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}

.subtask-name {
  flex: 1;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: var(--text-primary);
}

.subtask-status {
  font-size: 9px;
  color: var(--text-muted);
}

/* Videos */
.videos-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.video-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}

.video-row:hover {
  background: rgba(233, 69, 96, 0.07);
  border-color: rgba(233, 69, 96, 0.25);
}

.video-play-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.video-title {
  flex: 1;
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-ext {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Comment block (legacy / "no files" placeholder) */
.comment-block {
  background: var(--bg-field);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}

.comment-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Note cards (user/officer comments) */
.note {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid transparent;
}
.note-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.note-body {
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}
.note-user {
  background: rgba(52, 152, 219, 0.08);
  border-color: rgba(52, 152, 219, 0.18);
}
.note-user .note-header { color: var(--blue); }
.note-user .note-body { color: var(--text-primary); }
.note-officer {
  background: rgba(231, 76, 60, 0.08);
  border-color: rgba(231, 76, 60, 0.20);
}
.note-officer .note-header { color: var(--red); }
.note-officer .note-body { color: var(--text-primary); font-weight: 500; }

/* Action buttons */
.action-buttons {
  display: flex;
  gap: 8px;
  padding-top: 2px;
}

.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-approve {
  background: rgba(46, 204, 113, 0.15);
  color: var(--green);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.btn-approve:hover {
  background: rgba(46, 204, 113, 0.25);
}

.btn-reject {
  background: rgba(231, 76, 60, 0.12);
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.btn-reject:hover {
  background: rgba(231, 76, 60, 0.22);
}

.btn-ship {
  background: rgba(52, 152, 219, 0.15);
  color: var(--blue);
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.btn-ship:hover {
  background: rgba(52, 152, 219, 0.25);
}

/* Status info (non-actionable cards in shipping/rejected tabs) */
.status-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.status-info-shipped {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.10), rgba(46, 204, 113, 0.16));
  color: var(--green);
  border: 1px solid rgba(46, 204, 113, 0.28);
}
.status-info-rejected {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.08), rgba(231, 76, 60, 0.14));
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.25);
}

.btn-secondary {
  background: var(--bg-field);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: rgba(231, 76, 60, 0.15);
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
  background: rgba(231, 76, 60, 0.25);
}

/* ================================
   Load More
   ================================ */
.load-more-wrap {
  padding: 14px 0;
  text-align: center;
}

.btn-load-more {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 10px 24px;
  transition: border-color 0.15s, color 0.15s;
}

.btn-load-more:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* ================================
   Modal
   ================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 480px) {
  .modal-backdrop {
    align-items: center;
    padding: 16px;
  }
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 16px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 480px) {
  .modal-card {
    border-radius: var(--radius-lg);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: background 0.15s;
}

.modal-close:hover {
  background: var(--border);
}

.modal-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  width: 100%;
  min-height: 90px;
  transition: border-color 0.15s;
}

.modal-textarea:focus {
  border-color: var(--red);
}

.modal-textarea::placeholder {
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  gap: 8px;
}

/* ================================
   Status colors
   ================================ */
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  flex-shrink: 0;
}

/* ================================
   Responsive
   ================================ */
@media (min-width: 600px) {
  .info-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Video inline player */
.video-item {
  margin-bottom: 6px;
}
.video-item video {
  max-height: 200px;
}
.video-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* ================================
   Attachments — compact tile grid
   ================================ */
.att-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 6px;
}

.att-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-field);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, transform 0.15s;
  text-decoration: none;
}
.att-tile:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.att-tile:active {
  transform: translateY(0);
}

.att-tile img,
.att-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
  pointer-events: none;
}

.att-tile-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.35));
  pointer-events: none;
}

.att-tile-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 3px;
  pointer-events: none;
  text-transform: uppercase;
}

/* Document tiles (PDF, fallback) */
.att-tile-doc {
  flex-direction: column;
  gap: 4px;
  color: #fff;
}
.att-tile-pdf {
  background: linear-gradient(135deg, #c1372a, #a02919);
  border-color: rgba(255, 255, 255, 0.1);
}
.att-tile-other {
  background: linear-gradient(135deg, #3a3a55, #25253d);
  border-color: rgba(255, 255, 255, 0.08);
}
.att-tile-doc-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  text-transform: uppercase;
}

/* ================================
   Fullscreen Viewer
   ================================ */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  z-index: 5;
}

.viewer-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.viewer-title {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.viewer-counter {
  color: #aaa;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.viewer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: #ddd;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.15s, color 0.15s;
}
.viewer-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.viewer-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: #000;
  min-height: 0;
}

.viewer-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.viewer-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: #000;
  display: block;
}

.viewer-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  display: block;
}

/* Prev/Next nav arrows */
.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}
.viewer-nav:hover { background: rgba(0, 0, 0, 0.78); }
.viewer-nav:disabled { opacity: 0.3; cursor: default; pointer-events: none; }
.viewer-nav-prev { left: 10px; }
.viewer-nav-next { right: 10px; }

/* PDF rendered via PDF.js — vertical stack of canvas pages */
.viewer-pdf-wrapper {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #2a2a2a;
  -webkit-overflow-scrolling: touch;
}
.viewer-pdf-page {
  display: block;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  max-width: 100%;
}

.viewer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #ccc;
  font-size: 13px;
  padding: 40px;
}
.viewer-loading .spinner {
  border-color: rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
}

.viewer-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #ddd;
  font-size: 13px;
  padding: 30px;
  text-align: center;
}
.viewer-error-link {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
}
.viewer-error-link:hover { opacity: 0.9; }

/* 2-column info grid */
.info-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 8px;
}

/* Tracking block with details */
.tracking-block {
  background: var(--bg-field);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  margin-bottom: 5px;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}
.tracking-block:hover { border-color: var(--border); }
.tracking-block:last-child { margin-bottom: 0; }

.tracking-details {
  display: flex;
  gap: 14px;
  margin-top: 7px;
  font-size: 11px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.td-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
