/* ============================================================
   STOCKES PEÇAS – PORTAL DESIGN SYSTEM
   Complete CSS with dark theme, orange accents, glassmorphism
   ============================================================ */

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --orange:        #D4580A;
  --orange-light:  #F0691A;
  --orange-hover:  #E8620F;
  --orange-dim:    rgba(212, 88, 10, .15);
  --black:         #0D0D0D;
  --gray-dark:     #1A1A1A;
  --gray-mid:      #2A2A2A;
  --gray-border:   #3A3A3A;
  --gray-light:    #444;
  --white:         #F5F3EF;
  --white-dim:     rgba(245, 243, 239, .7);
  --steel:         #8A8A8A;
  --green:         #22C55E;
  --green-dim:     rgba(34,197,94,.15);
  --yellow:        #EAB308;
  --yellow-dim:    rgba(234,179,8,.15);
  --red:           #EF4444;
  --red-dim:       rgba(239,68,68,.15);
  --blue:          #3B82F6;
  --blue-dim:      rgba(59,130,246,.15);
  --purple:        #A855F7;
  --purple-dim:    rgba(168,85,247,.15);
  --cyan:          #06B6D4;
  --cyan-dim:      rgba(6,182,212,.15);

  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     24px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.4);
  --shadow-md:     0 4px 12px rgba(0,0,0,.5);
  --shadow-lg:     0 8px 30px rgba(0,0,0,.6);
  --transition:    .25s cubic-bezier(.4,0,.2,1);
  --font-heading:  'Bebas Neue', sans-serif;
  --font-body:     'Barlow', sans-serif;
  --font-condensed:'Barlow Condensed', sans-serif;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--black);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--orange-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--orange); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
::selection { background: var(--orange); color: var(--white); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--gray-dark); }
::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--steel); }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); letter-spacing: .04em; line-height: 1.2; color: var(--white); }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }
.text-orange { color: var(--orange-light); }
.text-steel { color: var(--steel); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-lg { font-size: 1.125rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-uppercase { text-transform: uppercase; }
.font-condensed { font-family: var(--font-condensed); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* ── Utility Classes ──────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: .25rem; }
.gap-sm { gap: .5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 2rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: .5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mb-xl { margin-bottom: 2rem; }
.p-md { padding: 1rem; }
.p-lg { padding: 1.5rem; }

/* ── Login Page ───────────────────────────────────────────── */
.login-wrapper {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1.5rem;
  background: radial-gradient(ellipse at 30% 20%, rgba(212,88,10,.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(212,88,10,.06) 0%, transparent 60%),
              var(--black);
}
.login-card {
  width: 100%; max-width: 440px;
  background: rgba(26,26,26,.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .5s ease-out;
}
.login-logo {
  display: flex; align-items: center; justify-content: center;
  gap: .75rem; margin-bottom: 2rem;
}
.login-logo svg { width: 48px; height: 48px; }
.login-logo-text {
  font-family: var(--font-heading);
  font-size: 2rem; color: var(--white); letter-spacing: .06em;
}
.login-logo-text span { color: var(--orange-light); }

/* Login Tabs */
.login-tabs {
  display: flex; border-bottom: 2px solid var(--gray-border);
  margin-bottom: 1.5rem;
}
.login-tab {
  flex: 1; padding: .75rem; text-align: center;
  font-family: var(--font-condensed); font-size: 1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--steel); background: none; border: none;
  cursor: pointer; transition: all var(--transition);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.login-tab:hover { color: var(--white); }
.login-tab.active {
  color: var(--orange-light);
  border-bottom-color: var(--orange-light);
}
.login-tab-panel { display: none; }
.login-tab-panel.active { display: block; animation: fadeUp .3s ease-out; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; margin-bottom: .4rem;
  font-size: .85rem; font-weight: 600; color: var(--white-dim);
  text-transform: uppercase; letter-spacing: .04em;
  font-family: var(--font-condensed);
}
.form-control {
  width: 100%; padding: .7rem 1rem;
  background: var(--gray-mid);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-body); font-size: .95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control::placeholder { color: var(--steel); }
.form-control:focus {
  border-color: var(--orange-light);
  box-shadow: 0 0 0 3px var(--orange-dim);
}
.form-control:disabled {
  opacity: .5; cursor: not-allowed;
}
.form-control.error { border-color: var(--red); }
.form-error-msg {
  font-size: .8rem; color: var(--red); margin-top: .3rem;
  display: none;
}
.form-error-msg.visible { display: block; animation: fadeUp .2s ease-out; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A8A8A' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-check {
  display: flex; align-items: center; gap: .5rem; cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--orange-light);
  cursor: pointer;
}
.form-check label { font-size: .9rem; color: var(--white-dim); cursor: pointer; }

.form-inline { display: flex; gap: .75rem; align-items: flex-end; }
.form-inline .form-group { flex: 1; margin-bottom: 0; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; padding: .65rem 1.5rem;
  font-family: var(--font-condensed); font-size: .95rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
  white-space: nowrap; text-decoration: none;
  line-height: 1.4;
}
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  color: var(--white); box-shadow: 0 2px 8px rgba(212,88,10,.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--orange-light), var(--orange));
  box-shadow: 0 4px 16px rgba(212,88,10,.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--gray-mid); color: var(--white);
  border: 1px solid var(--gray-border);
}
.btn-secondary:hover { background: var(--gray-light); border-color: var(--steel); }

.btn-outline {
  background: transparent; color: var(--orange-light);
  border: 1px solid var(--orange-light);
}
.btn-outline:hover {
  background: var(--orange-dim); color: var(--orange-light);
}

.btn-danger {
  background: var(--red); color: var(--white);
}
.btn-danger:hover { background: #dc2626; }

.btn-success {
  background: var(--green); color: var(--white);
}
.btn-success:hover { background: #16a34a; }

.btn-sm { padding: .4rem .85rem; font-size: .8rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon.btn-sm { width: 30px; height: 30px; }

/* ── Admin Layout ─────────────────────────────────────────── */
.layout-admin {
  display: flex; min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); position: fixed; top: 0; left: 0; bottom: 0;
  background: var(--gray-dark);
  border-right: 1px solid var(--gray-border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-header {
  padding: 1.25rem 1.5rem; display: flex; align-items: center; gap: .75rem;
  border-bottom: 1px solid var(--gray-border);
}
.sidebar-logo {
  font-family: var(--font-heading); font-size: 1.6rem; color: var(--white);
  letter-spacing: .06em;
}
.sidebar-logo span { color: var(--orange-light); }
.sidebar-badge {
  font-size: .65rem; font-weight: 700; padding: .15rem .4rem;
  background: var(--orange-dim); color: var(--orange-light);
  border-radius: 3px; text-transform: uppercase;
  font-family: var(--font-condensed); letter-spacing: .06em;
}
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.5rem; color: var(--steel);
  font-family: var(--font-condensed); font-size: .95rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  transition: all var(--transition); cursor: pointer;
  text-decoration: none; border-left: 3px solid transparent;
}
.sidebar-nav-item:hover {
  color: var(--white); background: rgba(255,255,255,.04);
}
.sidebar-nav-item.active {
  color: var(--orange-light); background: var(--orange-dim);
  border-left-color: var(--orange-light);
}
.sidebar-nav-item .nav-icon {
  width: 20px; height: 20px; opacity: .7; flex-shrink: 0;
}
.sidebar-nav-item.active .nav-icon { opacity: 1; }
.sidebar-nav-divider {
  height: 1px; background: var(--gray-border); margin: .75rem 1.5rem;
}
.sidebar-footer {
  padding: 1rem 1.5rem; border-top: 1px solid var(--gray-border);
  display: flex; align-items: center; gap: .75rem;
}
.sidebar-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--orange-dim); color: var(--orange-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-condensed); font-weight: 800; font-size: .9rem;
}
.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name {
  font-size: .85rem; font-weight: 600; color: var(--white); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role { font-size: .7rem; color: var(--steel); text-transform: uppercase; }

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none; position: fixed; top: 1rem; left: 1rem;
  z-index: 200; width: 42px; height: 42px;
  background: var(--gray-dark); border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm); color: var(--white);
  cursor: pointer; align-items: center; justify-content: center;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 90;
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0 !important; }
}

/* Main content area */
.main-content {
  flex: 1; margin-left: var(--sidebar-w);
  min-height: 100vh; display: flex; flex-direction: column;
}

/* Top bar inside main */
.topbar {
  height: var(--topbar-h); padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--gray-border);
  background: rgba(26,26,26,.8);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 50;
  overflow: visible;
}
.topbar-title {
  font-family: var(--font-heading); font-size: 1.5rem;
  letter-spacing: .04em;
}
.topbar-actions { display: flex; align-items: center; gap: 1rem; position: relative; }
.topbar-user { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--steel); }
.topbar-user strong { color: var(--white); }

.page-content {
  flex: 1; padding: 2rem;
}
@media (max-width: 600px) { .page-content { padding: 1rem; } }

/* ── Client Layout (Top Nav) ──────────────────────────────── */
.layout-client { min-height: 100vh; display: flex; flex-direction: column; }
.client-topnav {
  height: var(--topbar-h); padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--gray-dark);
  border-bottom: 1px solid var(--gray-border);
  position: sticky; top: 0; z-index: 100;
}
.client-topnav-logo {
  font-family: var(--font-heading); font-size: 1.5rem;
  color: var(--white); letter-spacing: .06em;
  display: flex; align-items: center; gap: .5rem;
}
.client-topnav-logo span { color: var(--orange-light); }
.client-topnav-links {
  display: flex; align-items: center; gap: 1.5rem;
}
.client-topnav-link {
  font-family: var(--font-condensed); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--steel); font-size: .9rem;
  transition: color var(--transition);
}
.client-topnav-link:hover, .client-topnav-link.active { color: var(--orange-light); }
.client-content { flex: 1; padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%; }
@media (max-width: 600px) {
  .client-content { padding: 1rem; }
  .client-topnav { padding: 0 1rem; }
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem; margin-bottom: 2rem;
}
.stat-card {
  background: rgba(42,42,42,.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%; background: var(--orange-light);
  border-radius: 0 2px 2px 0;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.stat-card-label {
  font-family: var(--font-condensed); font-size: .8rem;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--steel);
  margin-bottom: .25rem;
}
.stat-card-value {
  font-family: var(--font-heading); font-size: 2.2rem;
  color: var(--white); line-height: 1;
}
.stat-card-change {
  font-size: .8rem; margin-top: .5rem;
  display: flex; align-items: center; gap: .25rem;
}
.stat-card-change.up { color: var(--green); }
.stat-card-change.down { color: var(--red); }
.stat-card-icon {
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; opacity: .1; color: var(--orange-light);
}

.stat-card.green::before { background: var(--green); }
.stat-card.blue::before { background: var(--blue); }
.stat-card.yellow::before { background: var(--yellow); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.cyan::before { background: var(--cyan); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto; border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  background: var(--gray-dark);
}
.data-table {
  width: 100%; border-collapse: collapse;
  font-size: .9rem;
}
.data-table thead { background: var(--gray-mid); }
.data-table th {
  padding: .75rem 1rem; text-align: left;
  font-family: var(--font-condensed); font-size: .8rem;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--steel);
  border-bottom: 1px solid var(--gray-border);
  white-space: nowrap;
}
.data-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(58,58,58,.5);
  color: var(--white-dim);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background var(--transition);
}
.data-table tbody tr:hover { background: rgba(255,255,255,.03); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover { background: var(--orange-dim); }
.table-empty {
  text-align: center; padding: 3rem 1rem; color: var(--steel);
}
.table-empty svg { width: 48px; margin: 0 auto .75rem; opacity: .3; }

/* ── Status Badges ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .65rem;
  font-family: var(--font-condensed); font-size: .75rem;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; border-radius: 999px;
  white-space: nowrap;
}
.badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
}
.badge-orcamento          { background: var(--blue-dim);   color: var(--blue);   } .badge-orcamento::before          { background: var(--blue); }
.badge-aguardando_pagamento { background: var(--yellow-dim); color: var(--yellow); } .badge-aguardando_pagamento::before { background: var(--yellow); }
.badge-pago               { background: var(--green-dim);  color: var(--green);  } .badge-pago::before               { background: var(--green); }
.badge-escaneamento       { background: var(--cyan-dim);   color: var(--cyan);   } .badge-escaneamento::before       { background: var(--cyan); }
.badge-projeto            { background: var(--purple-dim); color: var(--purple); } .badge-projeto::before            { background: var(--purple); }
.badge-aprovacao_cliente   { background: var(--yellow-dim); color: var(--yellow); } .badge-aprovacao_cliente::before   { background: var(--yellow); }
.badge-fabricacao         { background: var(--orange-dim); color: var(--orange-light); } .badge-fabricacao::before         { background: var(--orange-light); }
.badge-qualidade          { background: var(--blue-dim);   color: var(--blue);   } .badge-qualidade::before          { background: var(--blue); }
.badge-entregue           { background: var(--green-dim);  color: var(--green);  } .badge-entregue::before           { background: var(--green); }
.badge-cancelado          { background: var(--red-dim);    color: var(--red);    } .badge-cancelado::before          { background: var(--red); }

.badge-prioridade-alta    { background: var(--red-dim);    color: var(--red);    } .badge-prioridade-alta::before    { background: var(--red); }
.badge-prioridade-media   { background: var(--yellow-dim); color: var(--yellow); } .badge-prioridade-media::before   { background: var(--yellow); }
.badge-prioridade-baixa   { background: var(--green-dim);  color: var(--green);  } .badge-prioridade-baixa::before   { background: var(--green); }

.badge-tipo { background: var(--gray-mid); color: var(--steel); border: 1px solid var(--gray-border); }
.badge-tipo::before { display: none; }

/* ── Status labels map ────────────────────────────────────── */
/* Used for display — actual JS maps these */

/* ── Progress Bar (Overall Status) ────────────────────────── */
.progress-bar-wrapper { margin-bottom: 1rem; }
.progress-bar-label { display: flex; justify-content: space-between; margin-bottom: .4rem; font-size: .8rem; color: var(--steel); }
.progress-bar-track {
  height: 8px; background: var(--gray-mid); border-radius: 999px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.progress-bar-fill.green { background: linear-gradient(90deg, #16a34a, var(--green)); }

/* Status Steps Progress */
.status-steps {
  display: flex; align-items: flex-start; margin: 1.5rem 0;
  overflow-x: auto; padding-bottom: .5rem;
}
.status-step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; min-width: 80px; position: relative;
}
.status-step::before {
  content: ''; position: absolute; top: 14px; left: -50%; right: 50%;
  height: 2px; background: var(--gray-border);
}
.status-step:first-child::before { display: none; }
.status-step.completed::before { background: var(--green); }
.status-step.active::before { background: var(--orange-light); }
.status-step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gray-mid); border: 2px solid var(--gray-border);
  display: flex; align-items: center; justify-content: center;
  z-index: 1; transition: all var(--transition);
  font-size: .7rem; color: var(--steel);
}
.status-step.completed .status-step-dot {
  background: var(--green); border-color: var(--green); color: var(--white);
}
.status-step.active .status-step-dot {
  background: var(--orange); border-color: var(--orange-light); color: var(--white);
  box-shadow: 0 0 0 4px var(--orange-dim);
  animation: pulse-dot 2s ease-in-out infinite;
}
.status-step-label {
  margin-top: .4rem; font-size: .65rem; font-weight: 600;
  text-transform: uppercase; color: var(--steel);
  text-align: center; font-family: var(--font-condensed);
  letter-spacing: .03em; max-width: 80px;
}
.status-step.completed .status-step-label { color: var(--green); }
.status-step.active .status-step-label { color: var(--orange-light); }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px var(--orange-dim); }
  50% { box-shadow: 0 0 0 8px rgba(212,88,10,.08); }
}

/* ── Timeline ─────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; background: var(--gray-border);
}
.timeline-item {
  position: relative; padding-bottom: 1.5rem;
  animation: fadeUp .3s ease-out;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -2rem; top: .2rem;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gray-mid); border: 2px solid var(--gray-border);
  z-index: 1;
}
.timeline-item.status-change .timeline-dot { background: var(--orange); border-color: var(--orange-light); }
.timeline-item.file-upload .timeline-dot { background: var(--blue); border-color: var(--blue); }
.timeline-item.payment .timeline-dot { background: var(--green); border-color: var(--green); }
.timeline-item.note .timeline-dot { background: var(--purple); border-color: var(--purple); }

.timeline-content { background: var(--gray-mid); border: 1px solid var(--gray-border); border-radius: var(--radius-sm); padding: .75rem 1rem; }
.timeline-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .25rem;
}
.timeline-author { font-size: .8rem; font-weight: 600; color: var(--white); }
.timeline-date { font-size: .7rem; color: var(--steel); }
.timeline-text { font-size: .85rem; color: var(--white-dim); line-height: 1.5; }

/* ── Cards (Glassmorphism) ────────────────────────────────── */
.card {
  background: rgba(42,42,42,.5);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--gray-light);
}
.card-clickable { cursor: pointer; }
.card-clickable:hover { border-color: var(--orange-light); }
.card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1rem;
}
.card-title {
  font-family: var(--font-condensed); font-size: 1.1rem;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; color: var(--white);
}
.card-subtitle { font-size: .8rem; color: var(--steel); margin-top: .15rem; }
.card-body { font-size: .9rem; color: var(--white-dim); }
.card-footer {
  margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--gray-border);
  display: flex; justify-content: space-between; align-items: center;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
@media (max-width: 600px) {
  .cards-grid { grid-template-columns: 1fr; }
}

/* ── File List ────────────────────────────────────────────── */
.file-list { display: flex; flex-direction: column; gap: .5rem; }
.file-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem;
  background: var(--gray-mid); border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.file-item:hover { background: rgba(255,255,255,.04); }
.file-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  font-family: var(--font-condensed);
}
.file-icon.stl { background: var(--blue-dim); color: var(--blue); }
.file-icon.pdf { background: var(--red-dim); color: var(--red); }
.file-icon.jpg, .file-icon.png { background: var(--green-dim); color: var(--green); }
.file-icon.zip { background: var(--yellow-dim); color: var(--yellow); }
.file-icon.other { background: var(--gray-mid); color: var(--steel); border: 1px solid var(--gray-border); }
.file-info { flex: 1; overflow: hidden; }
.file-name { font-size: .9rem; font-weight: 500; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: .75rem; color: var(--steel); }
.file-actions { display: flex; gap: .25rem; }

/* Upload Area */
.upload-area {
  border: 2px dashed var(--gray-border);
  border-radius: var(--radius-md);
  padding: 2rem; text-align: center;
  cursor: pointer; transition: all var(--transition);
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--orange-light);
  background: var(--orange-dim);
}
.upload-area svg { width: 48px; height: 48px; margin: 0 auto .75rem; color: var(--steel); }
.upload-area p { color: var(--steel); font-size: .9rem; }
.upload-area .upload-hint { font-size: .75rem; margin-top: .25rem; color: var(--gray-light); }

/* ── Modals ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
  animation: fadeIn .2s ease-out;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--gray-dark);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .3s ease-out;
}
.modal-lg { max-width: 760px; }
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-family: var(--font-heading); font-size: 1.4rem; letter-spacing: .04em;
}
.modal-close {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: none; border: none; color: var(--steel);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); font-size: 1.2rem;
}
.modal-close:hover { color: var(--white); background: rgba(255,255,255,.08); }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-border);
  display: flex; justify-content: flex-end; gap: .75rem;
}

/* ── Tags ─────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem;
  font-family: var(--font-condensed); font-size: .75rem;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; border-radius: 999px;
  background: var(--gray-mid); color: var(--steel);
  border: 1px solid var(--gray-border);
  transition: all var(--transition);
}
.tag:hover { border-color: var(--steel); }
.tag-remove {
  width: 14px; height: 14px; border-radius: 50%;
  background: none; border: none; color: var(--steel);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: .7rem; transition: color var(--transition);
}
.tag-remove:hover { color: var(--red); }
.tags-list { display: flex; flex-wrap: wrap; gap: .4rem; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.tag-cloud .tag { cursor: pointer; }
.tag-cloud .tag:hover, .tag-cloud .tag.active {
  background: var(--orange-dim); color: var(--orange-light);
  border-color: var(--orange-light);
}

/* ── Filter Bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: .75rem;
  align-items: flex-end;
  padding: 1rem 1.25rem;
  background: var(--gray-dark);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}
.filter-bar .form-group { margin-bottom: 0; min-width: 160px; flex: 1; }
.filter-bar .form-control { padding: .55rem .85rem; font-size: .85rem; }
.filter-bar .btn { flex-shrink: 0; }
@media (max-width: 600px) {
  .filter-bar { flex-direction: column; }
  .filter-bar .form-group { min-width: 100%; }
}

/* ── Search Bar (large) ───────────────────────────────────── */
.search-bar-lg {
  position: relative; margin-bottom: 2rem;
}
.search-bar-lg input {
  width: 100%; padding: 1rem 1.5rem 1rem 3.5rem;
  background: var(--gray-dark);
  border: 2px solid var(--gray-border);
  border-radius: var(--radius-lg);
  color: var(--white);
  font-size: 1.1rem; font-family: var(--font-body);
  transition: all var(--transition); outline: none;
}
.search-bar-lg input:focus {
  border-color: var(--orange-light);
  box-shadow: 0 0 0 4px var(--orange-dim);
}
.search-bar-lg input::placeholder { color: var(--steel); }
.search-bar-lg .search-icon {
  position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--steel);
  pointer-events: none;
}

/* ── Toast Notifications ──────────────────────────────────── */
.toast-container {
  position: fixed; top: 1.5rem; right: 1.5rem;
  z-index: 9999; display: flex; flex-direction: column;
  gap: .5rem; max-width: 400px; width: calc(100% - 3rem);
  pointer-events: none;
}
.toast {
  padding: .85rem 1.25rem;
  border-radius: var(--radius-sm);
  display: flex; align-items: flex-start; gap: .75rem;
  font-size: .9rem; box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: slideInRight .3s ease-out;
  position: relative; overflow: hidden;
}
.toast::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,.2);
  animation: shrink var(--toast-duration, 4s) linear forwards;
}
.toast-success { background: #065f46; border: 1px solid var(--green); color: #d1fae5; }
.toast-error   { background: #7f1d1d; border: 1px solid var(--red); color: #fecaca; }
.toast-warning { background: #78350f; border: 1px solid var(--yellow); color: #fef3c7; }
.toast-info    { background: #1e3a5f; border: 1px solid var(--blue); color: #dbeafe; }
.toast-icon { flex-shrink: 0; font-size: 1.1rem; }
.toast-body { flex: 1; }
.toast-close {
  flex-shrink: 0; background: none; border: none; color: inherit; opacity: .6;
  cursor: pointer; font-size: 1rem; padding: 0; line-height: 1;
}
.toast-close:hover { opacity: 1; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes shrink {
  from { width: 100%; }
  to   { width: 0; }
}

/* ── Loading Spinner ──────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-border);
  border-top-color: var(--orange-light);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner-sm { width: 20px; height: 20px; border-width: 2px; }
.spinner-lg { width: 56px; height: 56px; border-width: 4px; }

.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(13,13,13,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; border-radius: inherit;
}
.loading-full {
  position: fixed; inset: 0;
  background: rgba(13,13,13,.85);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9998;
}
.loading-full p {
  margin-top: 1rem; color: var(--steel); font-size: .9rem;
}
.btn .spinner-sm { margin: 0; }

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

/* ── Skeleton Loading ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-mid) 25%, var(--gray-light) 50%, var(--gray-mid) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 1rem; margin-bottom: .5rem; width: 80%; }
.skeleton-text.short { width: 40%; }
.skeleton-heading { height: 1.5rem; margin-bottom: .75rem; width: 60%; }
.skeleton-card { height: 120px; }
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 4rem 2rem;
}
.empty-state svg { width: 120px; height: 120px; margin: 0 auto 1.5rem; opacity: .15; color: var(--steel); }
.empty-state h3 { font-size: 1.5rem; margin-bottom: .5rem; }
.empty-state p { color: var(--steel); font-size: .95rem; max-width: 400px; margin: 0 auto; }

/* ── Checklist ────────────────────────────────────────────── */
.checklist { display: flex; flex-direction: column; gap: .5rem; }
.checklist-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .85rem;
  background: var(--gray-mid); border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
}
.checklist-item:hover { background: rgba(255,255,255,.04); }
.checklist-item.checked {
  border-color: var(--green);
  background: var(--green-dim);
}
.checklist-check {
  width: 22px; height: 22px; border-radius: 4px;
  border: 2px solid var(--gray-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--transition);
  color: transparent;
}
.checklist-item.checked .checklist-check {
  background: var(--green); border-color: var(--green); color: var(--white);
}
.checklist-label { font-size: .9rem; color: var(--white-dim); flex: 1; }
.checklist-item.checked .checklist-label { text-decoration: line-through; color: var(--steel); }
.checklist-actions {
  display: flex; gap: 4px; opacity: 0;
  transition: opacity var(--transition);
}
.checklist-item:hover .checklist-actions { opacity: 1; }
.btn-icon {
  background: none; border: 1px solid var(--gray-border);
  border-radius: 4px; padding: 4px 6px; cursor: pointer;
  color: var(--steel); transition: all var(--transition);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { border-color: var(--orange); color: var(--orange-light); }
.btn-icon-danger:hover { border-color: var(--red); color: var(--red); }
.checklist-add { margin-top: .5rem; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0;
  margin-top: .75rem;
  border-top: 1px solid var(--gray-border);
}
.pagination-info {
  font-size: .85rem;
  color: var(--steel);
}
.pagination-info strong {
  color: var(--white);
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pagination-controls .btn {
  min-width: 36px;
  justify-content: center;
  padding: 6px 10px;
}
.pagination-controls .btn.btn-primary {
  pointer-events: none;
}
.pagination-dots {
  padding: 0 6px;
  color: var(--steel);
  font-size: .85rem;
}
@media (max-width: 600px) {
  .pagination-bar {
    justify-content: center;
    flex-direction: column;
    text-align: center;
  }
  .pagination-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
  .pagination-controls .btn {
    min-width: 32px;
    padding: 5px 8px;
    font-size: .75rem;
  }
}

/* ── Quick Actions ────────────────────────────────────────── */
.quick-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 2rem; }

/* ── Chart Placeholder ────────────────────────────────────── */
.chart-placeholder {
  background: var(--gray-dark); border: 1px solid var(--gray-border);
  border-radius: var(--radius-md); padding: 2rem;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 300px;
  color: var(--steel); text-align: center;
}
.chart-placeholder svg { width: 64px; height: 64px; margin-bottom: 1rem; opacity: .2; }

/* ── Section Headings ─────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.section-title {
  font-family: var(--font-heading); font-size: 1.3rem; letter-spacing: .04em;
}

/* ── Two Column Layout ────────────────────────────────────── */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
}
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.col-span-2 { grid-column: span 2; }
@media (max-width: 900px) { .col-span-2 { grid-column: span 1; } }

/* ── Panel / Section Box ──────────────────────────────────── */
.panel {
  background: var(--gray-dark);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-title {
  font-family: var(--font-condensed); font-size: .9rem;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--white);
}
.panel-body { padding: 1.25rem; }

/* ── Fab Cards (Factory) ──────────────────────────────────── */
.fab-card {
  background: var(--gray-dark);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  overflow: hidden; transition: all var(--transition);
}
.fab-card:hover { border-color: var(--orange-light); box-shadow: var(--shadow-md); }
.fab-card-header {
  padding: 1rem 1.25rem; display: flex; align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-border);
  background: rgba(42,42,42,.3);
}
.fab-card-body { padding: 1.25rem; }
.fab-card-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--gray-border);
  display: flex; align-items: center; justify-content: space-between;
}

/* ── Project Card (Client) ────────────────────────────────── */
.project-card {
  background: rgba(42,42,42,.5);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--orange-light);
}
.project-card-code {
  font-family: var(--font-condensed); font-size: .8rem;
  color: var(--orange-light); font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.project-card-title {
  font-family: var(--font-condensed); font-size: 1.15rem;
  font-weight: 700; text-transform: uppercase;
  margin: .25rem 0 .75rem;
}
.project-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1rem; font-size: .8rem; color: var(--steel);
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: .25rem; margin-top: 1.5rem;
}
.pagination-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-mid); border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm); color: var(--steel);
  font-size: .85rem; cursor: pointer; transition: all var(--transition);
}
.pagination-btn:hover { color: var(--white); border-color: var(--steel); }
.pagination-btn.active { background: var(--orange); border-color: var(--orange); color: var(--white); }
.pagination-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ── Divider ──────────────────────────────────────────────── */
.divider { height: 1px; background: var(--gray-border); margin: 1.5rem 0; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in { animation: fadeIn .4s ease-out; }
.animate-fade-up { animation: fadeUp .4s ease-out; }
.animate-scale-in { animation: scaleIn .3s ease-out; }

/* Stagger children animation */
.stagger-children > * {
  opacity: 0; animation: fadeUp .4s ease-out forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: .05s; }
.stagger-children > *:nth-child(2) { animation-delay: .1s; }
.stagger-children > *:nth-child(3) { animation-delay: .15s; }
.stagger-children > *:nth-child(4) { animation-delay: .2s; }
.stagger-children > *:nth-child(5) { animation-delay: .25s; }
.stagger-children > *:nth-child(6) { animation-delay: .3s; }
.stagger-children > *:nth-child(7) { animation-delay: .35s; }
.stagger-children > *:nth-child(8) { animation-delay: .4s; }
.stagger-children > *:nth-child(9) { animation-delay: .45s; }
.stagger-children > *:nth-child(10) { animation-delay: .5s; }

/* ── Responsive Breakpoints ───────────────────────────────── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .topbar { padding: 0 1rem; }
  .topbar-title { font-size: 1.2rem; }
  .status-steps { gap: 0; }
  .status-step-label { font-size: .55rem; max-width: 60px; }
  .status-step-dot { width: 22px; height: 22px; font-size: .6rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 1.5rem; }
  .modal { max-height: 95vh; }
  .modal-body { padding: 1rem; }
  .cards-grid { grid-template-columns: 1fr; }
}

/* ── Print Styles ─────────────────────────────────────────── */
@media print {
  .sidebar, .sidebar-toggle, .topbar, .client-topnav, .toast-container { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: white; color: black; }
  .card, .panel, .stat-card { border: 1px solid #ddd; background: white; }
}

/* ── Approval Banner ──────────────────────────────────────── */
.approval-banner {
  background: var(--yellow-dim);
  border: 1px solid var(--yellow);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem;
  animation: fadeUp .4s ease-out;
}
.approval-banner p { color: var(--yellow); font-weight: 600; flex: 1; }

/* ── WhatsApp Button ──────────────────────────────────────── */
.btn-whatsapp {
  background: #25d366; color: var(--white);
}
.btn-whatsapp:hover { background: #1ebe57; }

/* ── Priority Badge ───────────────────────────────────────── */
.priority-flag {
  display: inline-flex; align-items: center; gap: .25rem;
  font-family: var(--font-condensed); font-size: .7rem;
  font-weight: 700; text-transform: uppercase;
}
.priority-flag.alta { color: var(--red); }
.priority-flag.media { color: var(--yellow); }
.priority-flag.baixa { color: var(--green); }

/* ── Result Card (Biblioteca) ─────────────────────────────── */
.result-card {
  background: var(--gray-dark); border: 1px solid var(--gray-border);
  border-radius: var(--radius-md); overflow: hidden;
  transition: all var(--transition); cursor: pointer;
}
.result-card:hover { border-color: var(--orange-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.result-card-thumb {
  height: 160px; background: var(--gray-mid);
  display: flex; align-items: center; justify-content: center;
  color: var(--steel); font-size: 2rem; overflow: hidden;
}
.result-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.result-card-body { padding: 1rem; }
.result-card-title {
  font-family: var(--font-condensed); font-size: 1rem;
  font-weight: 700; text-transform: uppercase; margin-bottom: .3rem;
}
.result-card-meta { font-size: .8rem; color: var(--steel); margin-bottom: .5rem; }

/* ── Password reveal ──────────────────────────────────────── */
.password-reveal {
  background: var(--orange-dim); border: 1px solid var(--orange-light);
  border-radius: var(--radius-sm); padding: 1rem 1.25rem;
  text-align: center;
}
.password-reveal strong { color: var(--orange-light); font-size: 1.2rem; letter-spacing: .1em; font-family: monospace; }
.password-reveal p { font-size: .85rem; color: var(--white-dim); margin-top: .5rem; }

/* ── Toggle Switch ────────────────────────────────────────── */
.toggle-switch {
  position: relative; width: 44px; height: 24px;
  display: inline-block; cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--gray-light); border-radius: 999px;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--white); top: 3px; left: 3px;
  transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Alert Box ────────────────────────────────────────────── */
.alert {
  padding: .85rem 1.25rem; border-radius: var(--radius-sm);
  display: flex; align-items: flex-start; gap: .75rem;
  font-size: .9rem; margin-bottom: 1rem;
}
.alert-error { background: var(--red-dim); border: 1px solid var(--red); color: #fecaca; }
.alert-success { background: var(--green-dim); border: 1px solid var(--green); color: #d1fae5; }
.alert-warning { background: var(--yellow-dim); border: 1px solid var(--yellow); color: #fef3c7; }
.alert-info { background: var(--blue-dim); border: 1px solid var(--blue); color: #dbeafe; }

/* ── Misc ─────────────────────────────────────────────────── */
.back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--steel); font-size: .9rem; margin-bottom: 1.5rem;
  transition: color var(--transition);
}
.back-link:hover { color: var(--orange-light); }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
}
.page-header h1, .page-header h2 { margin: 0; }

.detail-grid {
  display: grid; grid-template-columns: 140px 1fr; gap: .5rem 1rem; font-size: .9rem;
}
.detail-grid dt {
  color: var(--steel); font-family: var(--font-condensed);
  font-weight: 700; text-transform: uppercase; font-size: .8rem;
}
.detail-grid dd { color: var(--white-dim); }

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* ── Mobile Navigation ────────────────────────────────────── */
@media (max-width: 600px) {
  .client-topnav {
    padding: 0 .75rem;
    height: 56px;
  }
  .client-topnav-logo {
    font-size: 1.2rem;
  }
  .client-topnav-links {
    gap: .75rem;
  }
  .client-topnav-link {
    font-size: .75rem;
  }
  .client-content {
    padding: .75rem;
  }
  
  /* Page headers stack on mobile */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
  }
  .page-header h1 {
    font-size: 1.6rem;
  }

  /* Project detail grid stacks */
  .detail-grid {
    grid-template-columns: 1fr;
    gap: .25rem .5rem;
  }
  .detail-grid dt {
    margin-top: .5rem;
  }

  /* Approval banner stacks */
  .approval-banner {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  .approval-banner .btn {
    width: 100%;
  }

  /* Status steps scroll horizontally */
  .status-steps {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .5rem;
    scrollbar-width: none;
  }
  .status-steps::-webkit-scrollbar { display: none; }

  /* Tables become scrollable */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Buttons full-width on mobile */
  .btn-block-mobile {
    width: 100%;
    justify-content: center;
  }

  /* Back link */
  .back-link {
    margin-bottom: 1rem;
    font-size: .8rem;
  }

  /* Cards padding */
  .panel-body {
    padding: 1rem;
  }
  .panel-header {
    padding: .75rem 1rem;
    flex-direction: column;
    gap: .5rem;
    align-items: flex-start;
  }

  /* Form improvements */
  .form-row {
    grid-template-columns: 1fr !important;
  }

  /* Modal full-screen on mobile */
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  /* Upload area */
  .upload-area {
    padding: 1.5rem 1rem;
  }

  /* Buttons row wrap */
  .page-header > div {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
  }
  .page-header > div .btn {
    flex: 1;
    min-width: 0;
    font-size: .75rem;
    padding: 8px 10px;
  }
}

/* ── Small Phone (< 380px) ────────────────────────────────── */
@media (max-width: 380px) {
  .client-topnav-logo { font-size: 1rem; }
  .client-topnav-link { font-size: .65rem; }
  h1 { font-size: 1.4rem !important; }
  .stat-card { padding: 1rem; }
  .stat-card-value { font-size: 1.4rem; }
}

/* ── Tablet (600-900px) ───────────────────────────────────── */
@media (min-width: 601px) and (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Touch-friendly ───────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .btn, .sidebar-nav-item, .client-topnav-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .data-table td, .data-table th {
    padding: .75rem .5rem;
  }
  .clickable:active {
    transform: scale(0.98);
    transition: transform 0.1s;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PWA INSTALL BANNER
   ═══════════════════════════════════════════════════════════════ */
.pwa-install-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(135deg, #1a1a1a, #222);
  border-top: 2px solid var(--orange);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -4px 20px rgba(0,0,0,.5);
}
.pwa-install-banner.show {
  transform: translateY(0);
}
.pwa-install-banner-content {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
}
.pwa-install-banner-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}
.pwa-install-banner-text h4 {
  font-family: var(--font-condensed);
  font-size: .9rem; font-weight: 700;
  text-transform: uppercase;
  color: var(--white);
  margin: 0;
}
.pwa-install-banner-text p {
  font-size: .75rem;
  color: var(--steel);
  margin: 2px 0 0;
}
.pwa-install-banner .btn-install {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
}
.pwa-install-banner .btn-install:hover {
  background: var(--orange-hover);
}
.pwa-install-banner .btn-dismiss {
  background: none;
  border: none;
  color: var(--steel);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  line-height: 1;
}

/* ── Safe area for devices with notch ─────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pwa-install-banner {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
  .client-topnav {
    padding-top: env(safe-area-inset-top);
  }
}

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATIONS SYSTEM
   ═══════════════════════════════════════════════════════════════ */
.notif-bell-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 12px;
  z-index: 9999;
}
.notif-bell-btn {
  background: none;
  border: none;
  color: var(--steel, #888);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}
.notif-bell-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text, #e5e5e5);
}
.notif-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  border: 2px solid var(--bg, #0d0d0d);
}
.notif-badge-pop {
  animation: notifPop 0.3s ease-out;
}
@keyframes notifPop {
  0% { transform: scale(0.5); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: var(--surface, #1a1a1a);
  border: 1px solid var(--steel-700, #333);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 10000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.notif-dropdown.open {
  display: flex;
  animation: notifDropIn 0.2s ease-out;
}
@keyframes notifDropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--steel-700, #333);
  font-size: 0.9rem;
  color: var(--text, #e5e5e5);
}
.notif-mark-all {
  background: none;
  border: none;
  color: var(--orange, #D4580A);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}
.notif-mark-all:hover {
  background: rgba(212,88,10,0.1);
}
.notif-dropdown-list {
  overflow-y: auto;
  max-height: 400px;
  flex: 1;
}
.notif-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--steel, #888);
  font-size: 0.85rem;
}
.notif-empty svg { margin-bottom: 12px; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: relative;
}
.notif-item:hover {
  background: rgba(255,255,255,0.05);
}
.notif-item.unread {
  background: rgba(212,88,10,0.06);
}
.notif-item-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.notif-item-body {
  flex: 1;
  min-width: 0;
}
.notif-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text, #e5e5e5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-msg {
  font-size: 0.78rem;
  color: var(--steel, #888);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-time {
  font-size: 0.72rem;
  color: var(--steel, #666);
  margin-top: 4px;
}
.notif-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange, #D4580A);
  flex-shrink: 0;
  margin-top: 6px;
}
@media (max-width: 480px) {
  .notif-dropdown {
    width: calc(100vw - 24px);
    right: -60px;
  }
}
