/* ============================================
   BRAZIO TECH — Components
   ============================================ */

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 10px 20px; border: 1px solid transparent; border-radius: var(--radius-md);
  font-family: var(--font-family); font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  cursor: pointer; transition: all var(--transition-base); white-space: nowrap; line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn i { width: 18px; height: 18px; }

.btn-primary {
  background: var(--brand-gradient);
  color: #fff; box-shadow: var(--shadow-glow-primary);
}
.btn-primary:hover { background: var(--brand-gradient-hover); box-shadow: 0 0 30px var(--primary-glow); }

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: #fff; box-shadow: var(--shadow-glow-secondary);
}
.btn-secondary:hover { box-shadow: 0 0 30px var(--secondary-glow); }

.btn-outline {
  background: transparent; border-color: var(--border-default); color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary-light); background: rgba(123,47,190,.08); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--primary-light); background: rgba(123,47,190,.08); }

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

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

.btn-sm { padding: 6px 14px; font-size: var(--fs-xs); }
.btn-lg { padding: 14px 28px; font-size: var(--fs-md); }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

/* ---- Cards ---- */
.card {
  background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  padding: var(--space-6); transition: all var(--transition-base);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-lg); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-4); padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
}
.card-header h3 { font-size: var(--fs-lg); }
.card-body { flex: 1; }
.card-footer {
  margin-top: var(--space-4); padding-top: var(--space-4);
  border-top: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3);
}

/* ---- Inputs ---- */
.form-group { margin-bottom: var(--space-5); }
.form-label {
  display: block; margin-bottom: var(--space-2); font-size: var(--fs-sm);
  font-weight: var(--fw-medium); color: var(--text-secondary);
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px; background: var(--bg-input);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  color: var(--text-primary); font-family: var(--font-family); font-size: var(--fs-sm);
  transition: all var(--transition-fast);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-4); }
.form-hint { font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--space-1); }
.input-prefix {
  display: flex; align-items: center;
}
.input-prefix span {
  padding: 10px 12px; background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-right: none; border-radius: var(--radius-md) 0 0 var(--radius-md);
  color: var(--text-tertiary); font-size: var(--fs-sm); font-weight: var(--fw-medium);
}
.input-prefix .form-input {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ---- Badge ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: 0.02em;
}
.badge-primary { background: rgba(123,47,190,.18); color: var(--primary-light); }
.badge-secondary { background: rgba(26,10,140,.2); color: var(--secondary-light); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: rgba(148,163,184,.12); color: var(--text-secondary); }
.badge-dot::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: currentColor;
}

/* ---- Table ---- */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-default); }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 12px 16px; text-align: left; font-size: var(--fs-xs);
  font-weight: var(--fw-semibold); color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--bg-elevated); border-bottom: 1px solid var(--border-default);
}
.table td {
  padding: 14px 16px; font-size: var(--fs-sm); color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}
.table tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--bg-card-hover); }
.table tbody tr:last-child td { border-bottom: none; }

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop); display: none; align-items: center; justify-content: center;
  padding: var(--space-6); animation: fadeIn .2s ease;
}
.modal-backdrop.active { display: flex; }
.modal {
  background: var(--bg-dark); border: 1px solid var(--border-default);
  border-radius: var(--radius-xl); width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto; animation: scaleIn .25s ease;
  box-shadow: var(--shadow-xl);
}
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-6); border-bottom: 1px solid var(--border-default);
}
.modal-header h3 { font-size: var(--fs-lg); }
.modal-body { padding: var(--space-6); }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3);
  padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-default);
}

/* ---- Tabs ---- */
.tabs {
  display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--space-6);
}
.tab {
  padding: 10px 18px; font-size: var(--fs-sm); font-weight: var(--fw-medium);
  color: var(--text-tertiary); cursor: pointer; border-bottom: 2px solid transparent;
  transition: all var(--transition-fast); background: none; border-top: none;
  border-left: none; border-right: none; font-family: var(--font-family);
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- Toast ---- */
.toast-container {
  position: fixed; top: var(--space-6); right: var(--space-6);
  z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--space-3);
}
.toast {
  padding: 14px 20px; border-radius: var(--radius-md); min-width: 300px;
  display: flex; align-items: center; gap: var(--space-3);
  animation: slideInRight .3s ease; font-size: var(--fs-sm); font-weight: var(--fw-medium);
  box-shadow: var(--shadow-lg);
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-warning { background: var(--warning); color: var(--text-inverse); }
.toast-info { background: var(--info); color: #fff; }

/* ---- Stat Card ---- */
.stat-card {
  background: var(--glass-bg); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  padding: var(--space-5); position: relative; overflow: hidden;
  transition: all var(--transition-base);
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-3);
}
.stat-card .stat-value {
  font-size: var(--fs-3xl); font-weight: var(--fw-bold); color: var(--text-primary);
  line-height: 1.2; margin-bottom: var(--space-1);
}
.stat-card .stat-label {
  font-size: var(--fs-sm); color: var(--text-tertiary); font-weight: var(--fw-medium);
}
.stat-card .stat-trend {
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); margin-top: var(--space-2);
  display: flex; align-items: center; gap: 4px;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 120px; height: 120px; border-radius: 50%; opacity: .05;
  transform: translate(30%, -30%);
}

/* ---- Empty State ---- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-16) var(--space-8); text-align: center;
}
.empty-state-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(123,47,190,.1); display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-6); color: var(--primary);
}
.empty-state h4 { margin-bottom: var(--space-2); }
.empty-state p { max-width: 400px; margin-bottom: var(--space-6); }

/* ---- Search ---- */
.search-box {
  position: relative; flex: 1; max-width: 400px;
}
.search-box .form-input { padding-left: 40px; }
.search-box i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); width: 18px; height: 18px;
}

/* ---- Divider ---- */
.divider {
  height: 1px; background: var(--border-default); margin: var(--space-6) 0;
}

/* ---- Progress Bar ---- */
.progress-bar {
  width: 100%; height: 6px; background: var(--bg-elevated); border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: var(--radius-full); transition: width var(--transition-slow);
  background: var(--brand-gradient);
}

/* ---- Dropdown ---- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 4px); right: 0; min-width: 200px;
  background: var(--bg-dark); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: var(--space-2);
  box-shadow: var(--shadow-xl); z-index: var(--z-dropdown);
  display: none; animation: fadeInDown .15s ease;
}
.dropdown-menu.active { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: var(--fs-sm);
  color: var(--text-secondary); cursor: pointer; transition: all var(--transition-fast);
  border: none; background: none; width: 100%; font-family: var(--font-family);
}
.dropdown-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); }
