/* ============================================================
   Eurosatory Field Tool — main.css
   Devon Pixels · Ultimate Linings / LINE-X / PAXCON
   ============================================================ */

:root {
  --white:     #FFFFFF;
  --black:     #0A0A0A;
  --red:       #CC0000;
  --red-dark:  #A30000;
  --red-light: #FFE5E5;
  --surface:   #F5F5F5;
  --surface-2: #ECECEC;
  --border:    #E0E0E0;
  --nav-bg:    #1A1A1A;
  --nav-text:  #CCCCCC;
  --text-muted:#666666;
  --text-light:#999999;
  --success:   #1A7F37;
  --warning:   #B45309;

  --font-display: 'Bebas Neue', sans-serif;
  --font-ui:      'Inter', sans-serif;
  --sidebar-width: 220px;
  --topbar-height: 56px;
  --radius:    4px;
  --radius-lg: 8px;
  --shadow:    0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
}

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

body {
  font-family: var(--font-ui);
  background: var(--white);
  color: var(--black);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- LOGIN ---- */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.login-header {
  background: var(--black);
  padding: 32px 32px 28px;
  border-left: 5px solid var(--red);
}
.login-header .brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-logo-mark {
  width: 36px; height: 36px;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
}
.login-logo-mark svg { width: 22px; height: 22px; fill: white; }
.login-header h1 { font-family: var(--font-display); font-size: 26px; color: var(--white); letter-spacing: 1px; }
.login-header p { font-size: 13px; color: #888; margin-top: 4px; }
.login-body { padding: 32px; background: var(--white); }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); margin-bottom: 6px;
}
.form-group input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-ui); font-size: 15px;
  background: var(--white); color: var(--black);
  transition: border-color .15s; -webkit-appearance: none;
}
.form-group input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(204,0,0,.08); }
.login-error { color: var(--red); font-size: 13px; text-align: center; margin-bottom: 12px; display: none; }
.login-error.show { display: block; }
.turnstile-placeholder {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; text-align: center;
  font-size: 12px; color: var(--text-muted); margin-bottom: 18px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary {
  width: 100%; padding: 14px;
  background: var(--red); color: var(--white);
  border: none; border-radius: var(--radius);
  font-family: var(--font-ui); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: var(--red-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* ---- APP SHELL ---- */
#app-shell { display: none; flex-direction: column; height: 100vh; overflow: hidden; }
#app-shell.active { display: flex; }
.offline-top-bar {
  display: none; background: var(--warning); color: var(--white);
  font-size: 13px; font-weight: 600; text-align: center;
  padding: 8px 16px; flex-shrink: 0;
}
.offline-top-bar.show { display: block; }
.shell-body { display: flex; flex: 1; overflow: hidden; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width); background: var(--nav-bg);
  display: flex; flex-direction: column;
  flex-shrink: 0; overflow-y: auto; z-index: 100;
}
.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid #2E2E2E;
  border-left: 4px solid var(--red);
}
.sidebar-brand .app-name { font-family: var(--font-display); font-size: 20px; color: var(--white); letter-spacing: 1px; line-height: 1; margin-bottom: 4px; }
.sidebar-brand .app-sub { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: .5px; }
.sidebar-section { padding: 16px 0 8px; }
.sidebar-section-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #555; padding: 0 16px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  color: var(--nav-text); cursor: pointer;
  transition: background .12s, color .12s;
  font-size: 14px; font-weight: 500;
  border-left: 3px solid transparent;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.nav-item:hover { background: #252525; color: var(--white); }
.nav-item.active { background: #252525; color: var(--white); border-left-color: var(--red); }
.nav-item .nav-icon { width: 18px; height: 18px; opacity: .7; flex-shrink: 0; }
.nav-item.active .nav-icon { opacity: 1; }
.sidebar-footer {
  margin-top: auto; padding: 16px;
  border-top: 1px solid #2E2E2E;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--white); }
.user-email { font-size: 11px; color: #666; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 4px 8px;
  border-radius: 20px; background: #1A7F3722; color: #4CAF50;
  white-space: nowrap; flex-shrink: 0;
}
.sync-badge.offline { background: #B4530922; color: #F59E0B; }
.sync-badge.syncing { background: #1E3A5F22; color: #60A5FA; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---- MAIN ---- */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--white); }
.topbar {
  height: var(--topbar-height); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 12px;
  flex-shrink: 0; background: var(--white);
}
.topbar-back {
  display: none; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--red); cursor: pointer;
  padding: 6px 10px 6px 6px; border-radius: var(--radius);
  border: 1px solid var(--red-light); background: var(--red-light);
  -webkit-tap-highlight-color: transparent; white-space: nowrap; flex-shrink: 0;
}
.topbar-back:hover { background: #FFCCCC; }
.topbar-back svg { width: 14px; height: 14px; }
.topbar-back.visible { display: flex; }
.topbar-title { font-family: var(--font-display); font-size: 22px; letter-spacing: .5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn-sm { padding: 8px 16px; border-radius: var(--radius); font-family: var(--font-ui); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; border: none; white-space: nowrap; }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-dark); }
.btn-outline { background: transparent; color: var(--black); border: 1px solid var(--border) !important; }
.btn-outline:hover { background: var(--surface); }
.page-content { flex: 1; overflow-y: auto; padding: 24px; }
.panel { display: none; }
.panel.active { display: block; }

/* ---- DASHBOARD ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; border-top: 3px solid var(--red); }
.stat-value { font-family: var(--font-display); font-size: 38px; line-height: 1; color: var(--black); margin-bottom: 4px; }
.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.section-heading { font-family: var(--font-display); font-size: 18px; letter-spacing: .5px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }

/* ---- SCHEDULE ---- */
.day-block { margin-bottom: 28px; }
.day-label { font-family: var(--font-display); font-size: 15px; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; padding: 6px 12px; background: var(--surface); border-left: 3px solid var(--red); margin-bottom: 8px; border-radius: 0 var(--radius) var(--radius) 0; }
.meeting-row { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; background: var(--white); transition: box-shadow .15s; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.meeting-row:hover { box-shadow: var(--shadow-md); }
.meeting-time { background: var(--surface); padding: 14px 16px; font-size: 13px; font-weight: 700; color: var(--text-muted); min-width: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--border); font-variant-numeric: tabular-nums; line-height: 1.3; flex-shrink: 0; }
.meeting-time .time-start { font-size: 15px; color: var(--black); }
.meeting-time .time-end { font-size: 11px; }
.meeting-info { padding: 12px 16px; flex: 1; }
.meeting-company { font-size: 15px; font-weight: 700; color: var(--red); display: block; margin-bottom: 2px; }
.meeting-contact { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.meeting-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 2px; text-transform: uppercase; letter-spacing: .3px; }
.tag-red { background: var(--red-light); color: var(--red-dark); }
.tag-grey { background: var(--surface-2); color: var(--text-muted); }
.tag-green { background: #E6F4EA; color: var(--success); }
.meeting-status-bar { width: 4px; flex-shrink: 0; }
.status-confirmed { background: var(--success); }
.status-tentative { background: var(--warning); }

/* ---- SCHEDULE ADDITIONS ---- */
.day-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.day-label-row .day-label { margin-bottom: 0; }
.meeting-row { position: relative; }
.meeting-delete-btn {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: var(--surface-2); color: var(--text-muted);
  font-size: 14px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s, background .12s;
}
.meeting-row:hover .meeting-delete-btn { opacity: 1; }
.meeting-delete-btn:hover { background: var(--red-light); color: var(--red); }

/* ---- CONTACTS ---- */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; align-items: center; }
.search-input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font-ui); font-size: 14px; background: var(--white); color: var(--black); }
.search-input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(204,0,0,.06); }
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.contact-card { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--white); transition: box-shadow .15s; cursor: pointer; }
.contact-card:hover { box-shadow: var(--shadow-md); }
.contact-card-header { padding: 14px 16px 12px; border-left: 4px solid var(--red); background: var(--white); }
.contact-card-header.status-warm { border-left-color: var(--warning); }
.contact-card-header.status-customer { border-left-color: var(--success); }
.contact-card-header.status-grey { border-left-color: #999; }
.contact-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.contact-company { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.contact-role { font-size: 12px; color: var(--text-light); margin-top: 1px; }
.contact-card-body { padding: 10px 16px 14px; border-top: 1px solid var(--border); }
.contact-meta { font-size: 12px; color: var(--text-muted); line-height: 1.8; }
.contact-meta a { color: var(--red); text-decoration: none; font-weight: 500; }
.contact-pinned { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.pin-chip { font-size: 10px; font-weight: 600; padding: 2px 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 2px; color: var(--text-muted); }
.pin-chip.tds { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* ---- MODAL ---- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: var(--radius-lg); width: 100%; max-width: 640px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); border-left: 5px solid var(--red); display: flex; align-items: flex-start; justify-content: space-between; flex-shrink: 0; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.modal-subtitle { font-size: 13px; color: var(--text-muted); }
.modal-close { background: none; border: none; font-size: 22px; color: var(--text-muted); cursor: pointer; padding: 0 4px; line-height: 1; }
.modal-close:hover { color: var(--black); }
.modal-body { flex: 1; overflow-y: auto; padding: 24px; }
.modal-section { margin-bottom: 24px; }
.modal-section-title { font-family: var(--font-display); font-size: 14px; letter-spacing: .5px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.notes-list { list-style: none; }
.note-item { padding: 10px 12px; background: var(--surface); border-radius: var(--radius); margin-bottom: 8px; border-left: 3px solid var(--border); }
.note-item.new-note { border-left-color: var(--red); }
.note-text { font-size: 14px; line-height: 1.5; margin-bottom: 4px; }
.note-meta { font-size: 11px; color: var(--text-light); }
.note-input-area { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font-ui); font-size: 14px; min-height: 80px; resize: vertical; color: var(--black); background: var(--white); }
.note-input-area:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(204,0,0,.06); }
.pinned-items-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pinned-item { padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.pinned-item.tds-item { border-left: 3px solid var(--red); }
.pinned-item.app-item { border-left: 3px solid var(--success); }

/* ---- CONTACT PICKER MODAL ---- */
.picker-contact-row {
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; cursor: pointer;
  transition: all .12s; border-left: 3px solid transparent;
}
.picker-contact-row:hover { border-color: var(--red); border-left-color: var(--red); background: var(--red-light); }
.picker-contact-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.picker-contact-company { font-size: 12px; color: var(--text-muted); }
.picker-empty { font-size: 14px; color: var(--text-muted); text-align: center; padding: 24px; }

/* ---- PDF VIEWER MODAL ---- */
.pdf-modal { max-width: 900px; height: 90vh; }
.pdf-modal .modal-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
#pdf-iframe { width: 100%; flex: 1; border: none; min-height: 0; }

/* ---- PORTFOLIO ---- */
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.brand-badge { font-family: var(--font-display); font-size: 18px; letter-spacing: 1px; padding: 6px 16px; border: 2px solid var(--black); border-radius: 2px; cursor: pointer; transition: all .12s; background: var(--white); color: var(--black); }
.brand-badge:hover, .brand-badge.active-red { background: var(--red); border-color: var(--red); color: var(--white); }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.filter-chip { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: var(--white); color: var(--text-muted); cursor: pointer; transition: all .12s; }
.filter-chip:hover { border-color: var(--red); color: var(--red); }
.filter-chip.active { background: var(--red); border-color: var(--red); color: var(--white); }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.app-card { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--white); transition: box-shadow .15s, transform .12s; cursor: pointer; }
.app-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.app-card-image { height: 140px; background: var(--surface); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); overflow: hidden; position: relative; }
.app-card-image img { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder-text { font-family: var(--font-display); font-size: 28px; color: var(--border); letter-spacing: 1px; text-align: center; padding: 16px; }
.app-card-brand-badge { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 3px 7px; border-radius: 2px; background: var(--black); color: var(--white); text-transform: uppercase; }
.app-card-body { padding: 14px 16px; }
.app-card-category { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--red); margin-bottom: 5px; }
.app-card-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; line-height: 1.3; }
.app-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); }

/* ---- APPLICATION DETAIL ---- */
.app-detail-gallery { position: relative; width: 100%; background: var(--black); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px; user-select: none; }
.gallery-main { position: relative; height: 340px; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: pan-y; }
.gallery-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.gallery-slide.active { opacity: 1; pointer-events: auto; }
.gallery-slide-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery-slide-label { font-family: var(--font-display); font-size: 32px; color: rgba(255,255,255,.15); letter-spacing: 2px; text-align: center; padding: 0 32px; }
.gallery-slide-caption-bg { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.7)); padding: 32px 20px 16px; }
.gallery-slide-caption { font-size: 13px; color: rgba(255,255,255,.85); font-weight: 500; }
.gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10; transition: background .15s; -webkit-tap-highlight-color: transparent; }
.gallery-arrow:hover { background: rgba(255,255,255,.25); }
.gallery-arrow svg { width: 18px; height: 18px; stroke: white; fill: none; }
.gallery-arrow.prev { left: 12px; }
.gallery-arrow.next { right: 12px; }
.gallery-counter { position: absolute; top: 12px; right: 14px; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.6); background: rgba(0,0,0,.4); padding: 3px 10px; border-radius: 20px; z-index: 10; font-variant-numeric: tabular-nums; }
.gallery-brand-overlay { position: absolute; top: 12px; left: 14px; font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--white); background: var(--red); padding: 4px 10px; border-radius: 2px; z-index: 10; text-transform: uppercase; }
.gallery-thumbs { display: flex; gap: 6px; padding: 10px 12px; background: #111; overflow-x: auto; scrollbar-width: none; }
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumb { flex-shrink: 0; width: 64px; height: 44px; border-radius: 3px; background: #2A2A2A; border: 2px solid transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .5px; transition: border-color .15s; overflow: hidden; -webkit-tap-highlight-color: transparent; text-align: center; padding: 3px; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--red); }
.app-detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.app-detail-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.app-detail-category { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--red); }
.app-detail-brand { font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 3px 8px; background: var(--black); color: var(--white); border-radius: 2px; text-transform: uppercase; }
.app-detail-title { font-family: var(--font-display); font-size: 32px; letter-spacing: .5px; line-height: 1.1; margin-bottom: 16px; }
.app-detail-description { font-size: 15px; line-height: 1.7; color: #333; margin-bottom: 24px; }
.detail-section { margin-bottom: 24px; }
.detail-section-title { font-family: var(--font-display); font-size: 16px; letter-spacing: .5px; color: var(--black); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--red); display: inline-block; }
.benefits-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.benefits-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; }
.benefits-list li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-top: 7px; flex-shrink: 0; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table tr:last-child { border-bottom: none; }
.spec-table td { padding: 9px 12px; vertical-align: top; }
.spec-table td:first-child { font-weight: 600; color: var(--text-muted); width: 42%; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
.spec-table tr:nth-child(odd) td { background: var(--surface); }
.detail-sidebar-card { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px; }
.detail-sidebar-card-header { background: var(--surface); padding: 12px 16px; font-family: var(--font-display); font-size: 14px; letter-spacing: .5px; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border); }
.detail-sidebar-card-body { padding: 14px 16px; }
.tds-link-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; transition: all .12s; text-decoration: none; color: var(--black); background: var(--white); }
.tds-link-row:hover { border-color: var(--red); background: var(--red-light); }
.tds-link-icon { width: 28px; height: 36px; background: var(--surface-2); border-radius: 2px; display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 800; color: var(--red); letter-spacing: .5px; border: 1px solid var(--border); flex-shrink: 0; position: relative; }
.tds-link-icon::before { content: ''; position: absolute; top: 0; right: 0; width: 8px; height: 8px; background: var(--red); clip-path: polygon(0 0, 100% 100%, 100% 0); }
.tds-link-name { font-size: 12px; font-weight: 600; flex: 1; line-height: 1.3; }
.tds-link-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.btn-full { width: 100%; padding: 12px; border-radius: var(--radius); font-family: var(--font-ui); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s; border: none; text-align: center; display: block; }
.btn-full.red { background: var(--red); color: var(--white); }
.btn-full.red:hover { background: var(--red-dark); }
.btn-full.outline { background: var(--white); color: var(--black); border: 1px solid var(--border) !important; margin-top: 8px; }
.btn-full.outline:hover { background: var(--surface); }

/* ---- TDS LIBRARY ---- */
.tds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tds-card { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--white); transition: box-shadow .15s; cursor: pointer; }
.tds-card:hover { box-shadow: var(--shadow-md); }
.tds-card-preview { height: 120px; background: var(--surface); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); position: relative; }
.pdf-icon { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pdf-icon-file { width: 44px; height: 56px; background: var(--white); border: 1px solid var(--border); border-radius: 2px; position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; box-shadow: var(--shadow); }
.pdf-icon-file::before { content: ''; position: absolute; top: 0; right: 0; width: 12px; height: 12px; background: var(--red); clip-path: polygon(0 0, 100% 100%, 100% 0); }
.pdf-icon-label { font-size: 9px; font-weight: 800; letter-spacing: 1px; color: var(--red); }
.pdf-icon-filename { font-size: 10px; color: var(--text-light); text-align: center; padding: 0 8px; }
.tds-fav-badge { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--white); border-radius: 50%; box-shadow: var(--shadow); cursor: pointer; transition: transform .12s; }
.tds-fav-badge:hover { transform: scale(1.15); }
.tds-card-info { padding: 12px 14px; }
.tds-card-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; line-height: 1.3; }
.tds-card-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.tds-card-actions { display: flex; gap: 6px; }
.btn-xs { font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: var(--radius); cursor: pointer; border: none; transition: all .12s; }
.btn-xs.red { background: var(--red); color: var(--white); }
.btn-xs.red:hover { background: var(--red-dark); }
.btn-xs.outline { background: var(--white); color: var(--black); border: 1px solid var(--border) !important; }
.btn-xs.outline:hover { background: var(--surface); }

/* ---- ADD PROSPECT ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full-width { grid-column: 1 / -1; }
.form-field label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 6px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font-ui); font-size: 14px;
  color: var(--black); background: var(--white); -webkit-appearance: none;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(204,0,0,.06); }
.form-field textarea { min-height: 80px; resize: vertical; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ---- TOAST ---- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--black); color: var(--white);
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; z-index: 9999;
  opacity: 0; transition: opacity .2s;
  pointer-events: none; white-space: nowrap;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .app-detail-layout { grid-template-columns: 1fr; }
  .app-detail-sidebar { order: -1; }
  .gallery-main { height: 240px; }
}

@media (max-width: 768px) {
  .shell-body { flex-direction: column-reverse; }
  .sidebar { width: 100%; height: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; flex-shrink: 0; }
  .sidebar-brand { display: none; }
  .sidebar-section { display: flex; padding: 0; }
  .sidebar-section-label { display: none; }
  .nav-item { flex-direction: column; gap: 3px; padding: 10px 14px; font-size: 10px; text-align: center; min-width: 70px; border-left: none; border-top: 3px solid transparent; }
  .nav-item.active { border-top-color: var(--red); border-left-color: transparent; }
  .nav-item .nav-icon { width: 20px; height: 20px; }
  .sidebar-footer { display: none; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .contacts-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr 1fr; }
  .tds-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full-width { grid-column: 1; }
  .pinned-items-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .gallery-main { height: 200px; }
  .gallery-slide-label { font-size: 22px; }
}

@media (max-width: 400px) {
  .portfolio-grid { grid-template-columns: 1fr; }
  .tds-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
