/* ============================================
   ZIIDI ERP - Dark Blue & Orange Theme
   Primary: #1a2744 (Navy Blue)
   Accent:  #f47920 (Orange)
   ============================================ */

:root {
  --navy: #1a2744;
  --navy-light: #243356;
  --navy-dark: #111b30;
  --orange: #f47920;
  --orange-light: #f7954a;
  --orange-dark: #e06810;
  --bg-light: #f5f7fb;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #e0edf5;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0,0,0,0.12);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1030;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 1.5rem 1.5rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand {
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand i {
  font-size: 1.8rem;
  color: var(--orange);
  filter: drop-shadow(0 2px 4px rgba(244, 121, 32, 0.3));
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 0.8rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

.nav-item-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.7rem 1rem;
  margin-bottom: 0.2rem;
  border-radius: 10px;
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.nav-item-custom::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--orange);
  border-radius: 0 3px 3px 0;
  transition: height 0.25s ease;
}

.nav-item-custom:hover {
  background: rgba(255,255,255,0.06);
  color: white;
  transform: translateX(2px);
}

.nav-item-custom:hover::before { height: 60%; }

.nav-item-custom.active {
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(244, 121, 32, 0.3);
}

.nav-item-custom.active::before { height: 70%; background: white; }

.nav-item-custom i {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  transition: transform 0.2s ease;
}

.nav-item-custom:hover i { transform: scale(1.1); }
.nav-item-custom.active i { color: white; }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem;
  color: #94a3b8;
  background: rgba(0,0,0,0.15);
}

/* ========== MAIN CONTENT ========== */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 1.8rem 2rem;
  transition: margin 0.3s ease;
  min-height: 100vh;
  background: linear-gradient(180deg, #f8fafc 0%, var(--bg-light) 100%);
}

/* ========== TOP BAR ========== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
  background: white;
  padding: 1.2rem 1.5rem;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  border: 1px solid var(--border-color);
}

.page-title {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--navy);
  letter-spacing: -0.3px;
}

/* ========== CARDS ========== */
.card-ziidi {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.02);
  border: 1px solid var(--border-color);
  margin-bottom: 0;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card-ziidi::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--orange));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-ziidi:hover {
  box-shadow: 0 8px 25px rgba(26, 39, 68, 0.08), 0 2px 8px rgba(0,0,0,0.04);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.card-ziidi:hover::after { opacity: 1; }

.card-icon-bg {
  position: absolute;
  top: -15px;
  right: -15px;
  font-size: 5rem;
  color: #f0f4f8;
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.card-ziidi:hover .card-icon-bg { opacity: 0.55; transform: scale(1.05); }

.card-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ========== BADGES ========== */
.badge-etims {
  background: var(--navy);
  color: white;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: 30px;
  font-size: 0.75rem;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(26, 39, 68, 0.2);
}

.digitax-badge {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #1e40af;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #c7d2fe;
}

.bg-primary-subtle { background-color: #eff6ff !important; color: #1e40af !important; }
.bg-success-subtle { background-color: #f0fdf4 !important; color: #166534 !important; }
.bg-warning-subtle { background-color: #fffbeb !important; color: #92400e !important; }
.bg-info-subtle { background-color: #f0f9ff !important; color: #075985 !important; }
.bg-danger-subtle { background-color: #fef2f2 !important; color: #991b1b !important; }
.bg-secondary-subtle { background-color: #f1f5f9 !important; color: #475569 !important; }
.bg-navy-subtle { background-color: #e8ecf2 !important; color: var(--navy) !important; }
.bg-orange-subtle { background-color: #fff4eb !important; color: var(--orange) !important; }

.text-navy { color: var(--navy) !important; }
.text-orange { color: var(--orange) !important; }

/* ========== BUTTONS ========== */
.btn-ziidi {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border: none;
  color: white;
  font-weight: 500;
  padding: 0.55rem 1.3rem;
  border-radius: 12px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(26, 39, 68, 0.2);
}

.btn-ziidi:hover {
  background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy) 100%);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 39, 68, 0.3);
}

.btn-outline-ziidi {
  border: 1.5px solid var(--navy);
  color: var(--navy);
  background: transparent;
  border-radius: 12px;
  padding: 0.55rem 1.3rem;
  font-weight: 500;
  transition: all 0.25s ease;
}

.btn-outline-ziidi:hover {
  background: var(--navy);
  color: white;
  transform: translateY(-1px);
}

.btn-orange {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-light) 100%);
  border: none;
  color: white;
  font-weight: 500;
  padding: 0.55rem 1.3rem;
  border-radius: 12px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(244, 121, 32, 0.2);
}

.btn-orange:hover {
  background: linear-gradient(135deg, var(--orange-dark) 0%, var(--orange) 100%);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 121, 32, 0.3);
}

/* ========== TABLES ========== */
.table-ziidi { margin-bottom: 0; border-collapse: separate; border-spacing: 0; }

.table-ziidi th {
  background: var(--navy);
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
  border: none;
}

.table-ziidi td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}

.table-ziidi tbody tr { transition: background-color 0.2s ease; }
.table-ziidi tbody tr:hover { background-color: #f8fafc; }
.table-ziidi tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background-color: #f1f5f9 !important; }

/* ========== QUICK STATS ========== */
.quick-stat {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -0.5px;
}

/* ========== PROGRESS BARS ========== */
.progress { background-color: #e9ecef; border-radius: 10px; overflow: hidden; height: 6px; }
.progress-bar { transition: width 0.6s ease; border-radius: 10px; background: linear-gradient(90deg, var(--orange), var(--orange-light)) !important; }

/* ========== PAGINATION ========== */
.pagination .page-link { color: var(--navy); border-color: var(--border-color); padding: 0.5rem 0.85rem; font-size: 0.85rem; }
.pagination .page-item.active .page-link { background: var(--navy); border-color: var(--navy); color: white; }
.pagination .page-link:hover { background-color: #f1f5f9; border-color: #cbd5e1; color: var(--orange); }

/* ========== MOBILE TOGGLE ========== */
.menu-toggler { display: none; background: var(--navy); border: none; color: white; font-size: 1.5rem; border-radius: 10px; padding: 0.35rem 0.75rem; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.menu-toggler:hover { background: var(--navy-light); }

/* ========== SECTION PANELS ========== */
.section-panel { display: none; animation: fadeInUp 0.4s ease; }
.section-panel.active { display: block; }

/* ========== BUTTON GROUPS ========== */
.btn-group .btn.active { background: var(--navy); color: white; border-color: var(--navy); }

/* ========== FORM CONTROLS ========== */
.form-control, .form-select { border: 1.5px solid var(--border-color); border-radius: 10px; padding: 0.6rem 1rem; font-size: 0.9rem; }
.form-control:focus, .form-select:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26, 39, 68, 0.1); outline: none; }

/* ========== MODALS ========== */
.modal-header.bg-success { background: linear-gradient(135deg, #15803d, #16a34a) !important; }
.modal-header.bg-info { background: linear-gradient(135deg, var(--navy), var(--navy-light)) !important; }

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: -468px 0; } 100% { background-position: 468px 0; } }

.skeleton { background: linear-gradient(to right, #f6f7f8 8%, #edeef1 18%, #f6f7f8 33%); background-size: 800px 104px; animation: shimmer 1.5s infinite linear; border-radius: 8px; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange); }

/* ========== UTILITIES ========== */
.text-gradient { background: linear-gradient(135deg, var(--navy), var(--orange)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important; }
.shadow-md { box-shadow: 0 4px 6px rgba(0,0,0,0.07) !important; }
.rounded-xl { border-radius: 16px !important; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) { .main-content { padding: 1.5rem; } .card-ziidi { padding: 1.25rem; } }

@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); box-shadow: 4px 0 25px rgba(0,0,0,0.2); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggler { display: inline-block; }
  .page-title { font-size: 1.4rem; }
}

@media (max-width: 768px) {
  .card-ziidi { padding: 1.15rem; border-radius: 12px; }
  .quick-stat { font-size: 1.5rem; }
  .card-icon-bg { font-size: 3.5rem; top: -10px; right: -10px; }
  .table-ziidi th, .table-ziidi td { padding: 0.6rem; font-size: 0.8rem; }
}

@media (max-width: 576px) {
  .main-content { padding: 1rem; }
  .page-title { font-size: 1.2rem; }
  .card-ziidi { padding: 1rem; }
}

/* ========== PRINT ========== */
@media print {
  .sidebar, .menu-toggler, .btn-ziidi, .btn-outline-ziidi, .btn-orange { display: none !important; }
  .main-content { margin-left: 0; padding: 0; }
  .card-ziidi { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}