@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700&display=swap');

:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(22, 30, 49, 0.8);
  --bg-card-hover: rgba(30, 41, 67, 0.9);
  --border-card: rgba(255, 255, 255, 0.1);
  --border-focus: #3b82f6;

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-purple: #8b5cf6;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.2);
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --bg-input: rgba(15, 23, 42, 0.85);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html, body, #app-shell {
  height: 100%;
  max-height: 100vh;
  overflow: hidden;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

.glass-card {
  background: rgba(30, 41, 67, 0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  transition: all 0.2s ease-in-out;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: var(--shadow-glow);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

/* Forms */
.input-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  min-height: 48px;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.35rem;
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  user-select: none;
  transition: all 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #1d4ed8);
  color: white;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-success), #059669);
  color: white;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-danger), #dc2626);
  color: white;
}

.btn-sm {
  min-height: 34px !important;
  padding: 0.35rem 0.75rem !important;
  font-size: 0.82rem !important;
  gap: 0.4rem !important;
  border-radius: 8px !important;
}

.btn-icon {
  min-height: 34px !important;
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  accent-color: #3b82f6;
  cursor: pointer;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-RECEBIDO { background: rgba(107, 114, 128, 0.25); color: #d1d5db; border: 1px solid rgba(107, 114, 128, 0.4); }
.badge-EM_ANALISE { background: rgba(59, 130, 246, 0.25); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.badge-DIAGNOSTICO { background: rgba(139, 92, 246, 0.25); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.4); }
.badge-AGUARDA_ORCAMENTO { background: rgba(245, 158, 11, 0.25); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-ORCAMENTO_ENVIADO { background: rgba(236, 72, 153, 0.25); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.4); }
.badge-APROVADO { background: rgba(16, 185, 129, 0.25); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-EM_REPARACAO { background: rgba(14, 165, 233, 0.25); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.4); }
.badge-TESTES { background: rgba(168, 85, 247, 0.25); color: #e879f9; border: 1px solid rgba(168, 85, 247, 0.4); }
.badge-CONCLUIDO { background: rgba(34, 197, 94, 0.25); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.4); }
.badge-PRONTO_LEVANTAMENTO { background: rgba(20, 184, 166, 0.25); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.4); }
.badge-ENTREGUE { background: rgba(99, 102, 241, 0.25); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.4); }
.badge-ARQUIVADO { background: rgba(75, 85, 99, 0.25); color: #9ca3af; border: 1px solid rgba(75, 85, 99, 0.4); }

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

/* Scrollable navigation */
.nav-scroll-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}

/* ─── THEME CONFIGURATIONS ──────────────────────────────── */
body.theme-light {
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-card: #cbd5e1;
  --border-focus: #2563eb;
  --bg-input: #f8fafc;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --shadow-glow: 0 4px 15px rgba(37, 99, 235, 0.12);
}

body.theme-light {
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.05) 0px, transparent 50%);
}

body.theme-light .glass-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
}
body.theme-light .glass-card:hover {
  background: #f8fafc;
  border-color: #2563eb;
}
body.theme-light .input-field {
  border: 1px solid #cbd5e1;
  color: #0f172a;
  background-color: #ffffff;
}

body.theme-light h1, body.theme-light h2, body.theme-light h3, body.theme-light h4, body.theme-light h5, body.theme-light h6 {
  color: #0f172a !important;
}

body.theme-light th, body.theme-light td {
  color: #0f172a !important;
}

body.theme-light label {
  color: #334155 !important;
}

body.theme-light p {
  color: #475569 !important;
}

body.theme-light .glass-panel div:not(.badge):not(.btn):not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-secondary),
body.theme-light .glass-panel span:not(.badge):not(.btn):not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-secondary):not([class^="badge-"]),
body.theme-light .glass-card div:not(.badge):not(.btn):not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-secondary),
body.theme-light .glass-card span:not(.badge):not(.btn):not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-secondary):not([class^="badge-"]) {
  color: #0f172a !important;
}

body.theme-charcoal {
  --bg-main: #121214;
  --bg-card: #1f1f23;
  --bg-card-hover: #26262c;
  --border-card: #2e2e38;
  --border-focus: #a855f7;
  --bg-input: #151518;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #a855f7;
  --accent-primary-hover: #9333ea;
  --shadow-glow: 0 0 25px rgba(168, 85, 247, 0.2);
}

body.theme-charcoal {
  background-image: 
    radial-gradient(at 0% 0%, rgba(168, 85, 247, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.06) 0px, transparent 50%);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  padding: 1rem 0.5rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 1050px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 1rem;
}

.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  transform: rotate(90deg);
}

.modal-shake {
  animation: modalShake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes modalShake {
  0%, 100% { transform: scale(1) translateX(0); }
  20%, 60% { transform: scale(1.008) translateX(-4px); }
  40%, 80% { transform: scale(1.008) translateX(4px); }
}

@media (max-width: 768px) {
  .modal-overlay {
    padding: 0.5rem;
  }
  .modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* Tables and grids */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;

  text-align: left;
  font-size: 0.95rem;
}

.data-table th {
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-card);
}

.data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-card);
  color: var(--text-primary);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Kanban specific board */
.kanban-container {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  height: 100%;
}

.kanban-column {
  width: 310px;
  min-width: 310px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.kanban-header {
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.kanban-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kanban-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  flex: 1;
  padding: 0.2rem;
}

.repair-card {
  padding: 1.15rem;
  cursor: pointer;
  position: relative;
}

.repair-card-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.repair-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.4rem 0;
  color: var(--text-primary);
}

.repair-card-client {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.repair-card-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}
