/* ============================================================
   L'Atelier Electro — ERP Styles
   All @apply replaced with native CSS for Tailwind CDN compat
   ============================================================ */

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(to right, #2563eb, #3b82f6);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(59,130,246,0.25);
  border: none;
  cursor: pointer;
  width: 100%;
}
.btn-primary:hover {
  background: linear-gradient(to right, #1d4ed8, #06b6d4);
}
.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  background: transparent;
  border: 1px solid #475569;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-secondary:hover {
  border-color: #94a3b8;
  color: #fff;
  background: rgba(51,65,85,0.6);
}

/* --- Cards --- */
.card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(51,65,85,0.6);
  border-radius: 1rem;
  padding: 1.75rem;
  backdrop-filter: blur(12px);
}

.stat-card {
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(51,65,85,0.4);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.stat-card:hover {
  border-color: rgba(51,65,85,0.7);
}

/* --- Form elements --- */
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  background: rgba(15,23,42,0.7);
  border: 1px solid rgba(51,65,85,0.8);
  border-radius: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #f1f5f9;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-input::placeholder {
  color: #475569;
}
.form-input:focus {
  border-color: rgba(59,130,246,0.6);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* --- Auth-specific inputs (larger, more polished) --- */
.auth-input {
  width: 100%;
  background: rgba(2, 8, 23, 0.6);
  border: 1px solid rgba(51,65,85,0.7);
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  color: #f1f5f9;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.auth-input::placeholder {
  color: #334155;
}
.auth-input:focus {
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
  background: rgba(2, 8, 23, 0.8);
}

/* --- Client portal nav links --- */
.client-nav {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  color: #94a3b8;
  transition: all 0.15s;
  text-decoration: none;
}
.client-nav:hover {
  color: #fff;
  background: rgba(51,65,85,0.4);
}
.client-nav.active {
  color: #fff;
  background: rgba(37,99,235,0.2);
  border: 1px solid rgba(59,130,246,0.2);
  font-weight: 500;
}

/* --- Admin panel nav links --- */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  color: #94a3b8;
  transition: all 0.15s;
  text-decoration: none;
}
.admin-nav:hover {
  color: #fff;
  background: rgba(51,65,85,0.4);
}
.admin-nav.active {
  color: #fbbf24;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  font-weight: 500;
}

/* --- Admin components --- */
.admin-card {
  background: #161b22;
  border: 1px solid rgba(51,65,85,0.3);
  border-radius: 1rem;
  padding: 1.5rem;
}

.admin-stat-card {
  background: #161b22;
  border: 1px solid rgba(51,65,85,0.3);
  border-radius: 1rem;
  padding: 1.25rem;
  display: block;
}

.admin-input {
  width: 100%;
  background: #0d1117;
  border: 1px solid rgba(51,65,85,0.8);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-input::placeholder {
  color: #475569;
}
.admin-input:focus {
  border-color: rgba(245,158,11,0.5);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.08);
}

.admin-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.admin-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: linear-gradient(to right, #f59e0b, #f97316);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.admin-btn-primary:hover {
  background: linear-gradient(to right, #fbbf24, #fb923c);
}

.admin-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: rgba(51,65,85,0.5);
  border: 1px solid #475569;
  color: #cbd5e1;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s;
  cursor: pointer;
}
.admin-btn-secondary:hover {
  background: rgba(51,65,85,0.8);
}

.admin-filter-btn {
  padding: 0.375rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(30,41,59,0.6);
  border: 1px solid rgba(51,65,85,0.4);
  color: #94a3b8;
  transition: all 0.15s;
  cursor: pointer;
}
.admin-filter-btn:hover {
  color: #fff;
  border-color: #475569;
}
.admin-filter-btn.active {
  background: rgba(245,158,11,0.15);
  border-color: rgba(245,158,11,0.3);
  color: #fbbf24;
}

/* --- Status badges --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-open          { background: rgba(59,130,246,0.15); color: #60a5fa; }
.status-in_progress   { background: rgba(234,179,8,0.15);  color: #facc15; }
.status-waiting_client{ background: rgba(249,115,22,0.15); color: #fb923c; }
.status-resolved      { background: rgba(34,197,94,0.15);  color: #4ade80; }
.status-closed        { background: rgba(100,116,139,0.3); color: #94a3b8; }
.status-pending       { background: rgba(59,130,246,0.15); color: #60a5fa; }
.status-sent          { background: rgba(6,182,212,0.15);  color: #22d3ee; }
.status-accepted      { background: rgba(34,197,94,0.15);  color: #4ade80; }
.status-rejected      { background: rgba(239,68,68,0.15);  color: #f87171; }
.status-expired       { background: rgba(100,116,139,0.3); color: #94a3b8; }
.status-draft         { background: rgba(100,116,139,0.3); color: #94a3b8; }
.status-paid          { background: rgba(34,197,94,0.15);  color: #4ade80; }
.status-overdue       { background: rgba(239,68,68,0.15);  color: #f87171; }
.status-cancelled     { background: rgba(100,116,139,0.3); color: #94a3b8; }

/* --- Priority indicators --- */
.priority-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  flex-shrink: 0;
  display: inline-block;
}
.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.priority-dot.priority-low     { background: #94a3b8; }
.priority-dot.priority-medium  { background: #60a5fa; }
.priority-dot.priority-high    { background: #fb923c; }
.priority-dot.priority-urgent  { background: #f87171; animation: pulse 1s infinite; }

.priority-badge.priority-low    { background: rgba(100,116,139,0.3); color: #94a3b8; }
.priority-badge.priority-medium { background: rgba(59,130,246,0.15); color: #60a5fa; }
.priority-badge.priority-high   { background: rgba(249,115,22,0.15); color: #fb923c; }
.priority-badge.priority-urgent { background: rgba(239,68,68,0.15);  color: #f87171; }

/* --- Sidebar legacy --- */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
  transition: all 0.15s;
  text-decoration: none;
}
.sidebar-link:hover { color: #fff; background: rgba(51,65,85,0.5); }
.sidebar-link.active { color: #fff; background: rgba(37,99,235,0.2); font-weight: 500; }

/* --- Grid pattern background --- */
.grid-pattern {
  background-image:
    linear-gradient(rgba(99,102,241,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.07) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* --- Circuit board pattern --- */
.circuit-bg {
  background-image:
    linear-gradient(rgba(59,130,246,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.08) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* --- Line clamp --- */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Scrollbar styling --- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* --- Pulse animation (for urgent priority) --- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
