/* Maxwell InfoTech - Custom Styles */

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { scroll-behavior: smooth; }
body { font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11'; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.3); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.5); }
.dark ::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.25); }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-in { animation: slideInRight 0.3s ease-out; }

/* Sidebar nav */
.nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.875rem; border-radius: 0.625rem;
  color: rgb(71 85 105); font-size: 0.875rem; font-weight: 500;
  transition: all 0.18s ease;
}
.nav-link:hover { background: rgb(241 245 249); color: rgb(15 23 42); }
.dark .nav-link { color: rgb(148 163 184); }
.dark .nav-link:hover { background: rgb(30 41 59); color: white; }
.nav-link.active {
  background: linear-gradient(135deg, rgb(99 102 241), rgb(79 70 229));
  color: white; box-shadow: 0 4px 12px -4px rgba(99, 102, 241, 0.5);
}
.nav-link.active i { color: white; }
.nav-link i { width: 18px; text-align: center; color: rgb(100 116 139); }
.dark .nav-link i { color: rgb(148 163 184); }
.nav-link:hover i, .nav-link.active i { color: inherit; }

/* Cards */
.card {
  background: white; border-radius: 0.875rem;
  border: 1px solid rgb(226 232 240);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.dark .card { background: rgb(15 23 42); border-color: rgb(30 41 59); }

.stat-card {
  position: relative; overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -8px rgba(0,0,0,0.12); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent, #6366f1), transparent);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 0.5rem; font-weight: 500; font-size: 0.875rem;
  transition: all 0.15s ease; cursor: pointer; border: 1px solid transparent;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, rgb(99 102 241), rgb(79 70 229)); color: white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 12px -4px rgba(99,102,241,0.4);
}
.btn-primary:hover { box-shadow: 0 8px 16px -4px rgba(99,102,241,0.5); transform: translateY(-1px); }
.btn-secondary { background: white; color: rgb(51 65 85); border-color: rgb(226 232 240); }
.btn-secondary:hover { background: rgb(248 250 252); border-color: rgb(203 213 225); }
.dark .btn-secondary { background: rgb(30 41 59); color: rgb(226 232 240); border-color: rgb(51 65 85); }
.dark .btn-secondary:hover { background: rgb(51 65 85); }
.btn-danger { background: rgb(239 68 68); color: white; }
.btn-danger:hover { background: rgb(220 38 38); }
.btn-success { background: rgb(34 197 94); color: white; }
.btn-success:hover { background: rgb(22 163 74); }
.btn-ghost { background: transparent; color: rgb(71 85 105); }
.btn-ghost:hover { background: rgb(241 245 249); }
.dark .btn-ghost { color: rgb(148 163 184); }
.dark .btn-ghost:hover { background: rgb(30 41 59); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-icon { padding: 0.5rem; width: 36px; height: 36px; }

/* Input */
.input, .select, .textarea {
  width: 100%; padding: 0.5rem 0.75rem; border-radius: 0.5rem;
  border: 1px solid rgb(226 232 240); background: white; color: rgb(15 23 42);
  font-size: 0.875rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: rgb(99 102 241);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.dark .input, .dark .select, .dark .textarea {
  background: rgb(15 23 42); border-color: rgb(51 65 85); color: rgb(226 232 240);
}
.dark .input:focus, .dark .select:focus, .dark .textarea:focus {
  border-color: rgb(99 102 241);
}
.label { display: block; font-size: 0.8125rem; font-weight: 500; margin-bottom: 0.375rem; color: rgb(51 65 85); }
.dark .label { color: rgb(203 213 225); }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.125rem 0.5rem; border-radius: 9999px;
  font-size: 0.6875rem; font-weight: 600; line-height: 1.2;
}
.badge-success { background: rgb(220 252 231); color: rgb(22 101 52); }
.badge-warning { background: rgb(254 243 199); color: rgb(133 77 14); }
.badge-danger { background: rgb(254 226 226); color: rgb(153 27 27); }
.badge-info    { background: rgb(219 234 254); color: rgb(30 64 175); }
.badge-neutral { background: rgb(241 245 249); color: rgb(51 65 85); }
.badge-purple  { background: rgb(243 232 255); color: rgb(107 33 168); }
.dark .badge-success { background: rgb(20 83 45 / 0.4); color: rgb(134 239 172); }
.dark .badge-warning { background: rgb(120 53 15 / 0.4); color: rgb(253 224 71); }
.dark .badge-danger  { background: rgb(127 29 29 / 0.4); color: rgb(252 165 165); }
.dark .badge-info    { background: rgb(30 58 138 / 0.4); color: rgb(147 197 253); }
.dark .badge-neutral { background: rgb(30 41 59); color: rgb(203 213 225); }
.dark .badge-purple  { background: rgb(88 28 135 / 0.4); color: rgb(216 180 254); }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 0.625rem 1rem; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; color: rgb(100 116 139); letter-spacing: 0.04em;
  border-bottom: 1px solid rgb(226 232 240); background: rgb(248 250 252);
}
.dark .table th { background: rgb(15 23 42); border-color: rgb(30 41 59); color: rgb(148 163 184); }
.table td { padding: 0.875rem 1rem; font-size: 0.875rem; border-bottom: 1px solid rgb(241 245 249); }
.dark .table td { border-color: rgb(30 41 59); }
.table tbody tr:hover { background: rgb(248 250 252); }
.dark .table tbody tr:hover { background: rgb(30 41 59 / 0.5); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}
.modal-content {
  background: white; border-radius: 1rem; max-width: 720px; width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px -10px rgba(0,0,0,0.3);
  animation: fadeIn 0.25s ease-out;
}
.dark .modal-content { background: rgb(15 23 42); }
.modal-content.lg { max-width: 980px; }
.modal-content.xl { max-width: 1200px; }

/* Toast */
.toast {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; border-radius: 0.625rem;
  background: white; border: 1px solid rgb(226 232 240);
  box-shadow: 0 8px 30px -8px rgba(0,0,0,0.15);
  min-width: 280px; max-width: 380px;
  animation: slideInRight 0.25s ease-out;
}
.dark .toast { background: rgb(30 41 59); border-color: rgb(51 65 85); }
.toast-success { border-left: 4px solid rgb(34 197 94); }
.toast-error   { border-left: 4px solid rgb(239 68 68); }
.toast-info    { border-left: 4px solid rgb(99 102 241); }

/* Kanban column */
.kanban-col {
  background: rgb(241 245 249); border-radius: 0.875rem;
  padding: 0.875rem; min-width: 280px;
}
.dark .kanban-col { background: rgb(15 23 42 / 0.6); }
.kanban-card {
  background: white; padding: 0.75rem; border-radius: 0.625rem;
  border: 1px solid rgb(226 232 240);
  margin-bottom: 0.625rem; cursor: pointer;
  transition: all 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.kanban-card:hover { border-color: rgb(99 102 241); transform: translateY(-1px); box-shadow: 0 4px 12px -2px rgba(0,0,0,0.08); }
.dark .kanban-card { background: rgb(30 41 59); border-color: rgb(51 65 85); }
.dark .kanban-card:hover { border-color: rgb(99 102 241); }

/* Login page background */
.login-bg {
  background:
    radial-gradient(circle at 20% 30%, rgba(99,102,241,0.18), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(168,85,247,0.18), transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(59,130,246,0.12), transparent 50%);
}

/* Print styles for invoice */
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; top: 0; left: 0; width: 100%; }
  .no-print { display: none !important; }
}

/* line-clamp utility for older browsers */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
