/* ============================================
   Studio Financial - Minimal B&W Stylesheet
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  background: #fff;
  color: #000;
  line-height: 1.6;
  direction: rtl;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* --- Layout --- */
.app {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: 240px;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  transition: width 0.2s ease;
}

.sidebar.collapsed {
  width: 64px;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-header h2 {
  display: none;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: #999;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.sidebar-nav a:hover {
  color: #fff;
  background: #111;
}

.sidebar-nav a.active {
  color: #fff;
  background: #1a1a1a;
}

.sidebar-nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.sidebar.collapsed .sidebar-nav a span {
  display: none;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #222;
}

/* --- Main Content --- */
.main {
  flex: 1;
  margin-right: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed ~ .main {
  margin-right: 64px;
}

.topbar {
  height: 56px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.content {
  flex: 1;
  padding: 24px;
}

/* --- Cards --- */
.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
}

/* --- Dashboard Stats --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 20px;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.stat-card .stat-change {
  font-size: 0.75rem;
  color: #666;
  margin-top: 4px;
}

/* --- Grid System --- */
.grid { display: grid; gap: 16px; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Tables --- */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
}

thead th {
  text-align: right;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  border-bottom: 1px solid #e0e0e0;
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

tbody tr:hover {
  background: #fafafa;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #000;
  background: #fff;
  transition: border-color 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #000;
}

.form-input::placeholder {
  color: #aaa;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-hint {
  font-size: 0.75rem;
  color: #888;
  margin-top: 4px;
}

.form-error {
  font-size: 0.75rem;
  color: #000;
  margin-top: 4px;
  font-weight: 600;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary {
  background: #000;
  color: #fff;
}

.btn-primary:hover {
  background: #222;
}

.btn-secondary {
  background: #fff;
  color: #000;
  border-color: #e0e0e0;
}

.btn-secondary:hover {
  background: #f5f5f5;
}

.btn-danger {
  background: #fff;
  color: #000;
  border-color: #e0e0e0;
}

.btn-danger:hover {
  background: #000;
  color: #fff;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 4px;
  background: transparent;
  color: #666;
}

.btn-icon:hover {
  background: #f0f0f0;
  color: #000;
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(8px);
  transition: transform 0.2s;
}

.modal.modal-lg {
  max-width: 950px;
  width: 95%;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid #e0e0e0;
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #000;
  color: #fff;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.2s ease;
  min-width: 280px;
}

.toast.success { border-right: 3px solid #fff; }
.toast.error { border-right: 3px solid #888; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Chart Container --- */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 280px;
  padding: 16px 0;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
}

.login-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
}

.login-title {
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 24px;
  color: #333;
}

/* --- Invoice / Print --- */
.invoice-preview {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.invoice-table th {
  background: #fafafa;
}

.invoice-total {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

.invoice-total-row {
  display: flex;
  justify-content: space-between;
  width: 260px;
  padding: 6px 0;
  font-size: 0.9rem;
}

.invoice-total-row.grand {
  font-weight: 700;
  font-size: 1rem;
  border-top: 1px solid #e0e0e0;
  padding-top: 10px;
  margin-top: 4px;
}

@media print {
  @page {
    margin: 0;
    size: A4;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
  }

  .sidebar, .topbar, .no-print, .modal-footer, .modal-header {
    display: none !important;
  }

  .main {
    margin: 0 !important;
  }

  .content {
    padding: 0 !important;
  }

  .modal-overlay {
    position: static !important;
    background: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }

  .modal {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    overflow: visible !important;
  }

  .modal-body {
    padding: 0 !important;
  }

  .invoice-preview {
    border: none;
    border-radius: 0;
    padding: 20px;
    box-shadow: none;
    max-width: 100%;
  }

  body {
    background: #fff;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 3px;
  letter-spacing: 0.3px;
}

.badge-success {
  background: #f0f0f0;
  color: #000;
}

.badge-warning {
  background: #f5f5f5;
  color: #333;
}

.badge-danger {
  background: #000;
  color: #fff;
}

.badge-info {
  background: #e8e8e8;
  color: #333;
}

/* --- Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #333;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.pagination button:hover {
  background: #f5f5f5;
}

.pagination button.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* --- Dropdown --- */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 4px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all 0.15s;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #333;
  border-radius: 3px;
  cursor: pointer;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 20px;
}

.tab {
  padding: 10px 16px;
  font-size: 0.85rem;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: #000;
}

.tab.active {
  color: #000;
  border-bottom-color: #000;
  font-weight: 500;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: #ccc;
  fill: none;
  stroke-width: 1;
  margin: 0 auto 16px;
}

.empty-state h3 {
  font-size: 1rem;
  color: #333;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: #888; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }
.text-lg { font-size: 1.1rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }

.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.ml-8 { margin-left: 8px; }
.mr-8 { margin-right: 8px; }

.p-0 { padding: 0; }
.p-8 { padding: 8px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.py-8 { padding-top: 8px; padding-bottom: 8px; }
.px-16 { padding-left: 16px; padding-right: 16px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.border-b { border-bottom: 1px solid #e0e0e0; }
.border-t { border-top: 1px solid #e0e0e0; }

.rounded { border-radius: 4px; }
.rounded-lg { border-radius: 8px; }

.pointer { cursor: pointer; }
.select-none { user-select: none; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 64px;
  }

  .sidebar .sidebar-header h2,
  .sidebar .sidebar-nav a span {
    display: none;
  }

  .sidebar .sidebar-nav a {
    justify-content: center;
    padding: 12px;
  }

  .main {
    margin-right: 64px;
  }

  .content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .invoice-header {
    flex-direction: column;
    gap: 16px;
  }

  .modal {
    width: 95%;
    margin: 16px;
  }

  .topbar {
    padding: 0 16px;
  }

  .table-wrapper {
    margin: 0 -16px;
    padding: 0 16px;
  }

  .invoice-total-row {
    width: 100%;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13px;
  }

  .sidebar {
    display: flex;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: -4px 0 12px rgba(0,0,0,0.15);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .mobile-menu-btn {
    display: flex !important;
  }

  .main {
    margin-right: 0;
  }

  .login-card {
    padding: 24px;
    margin: 16px;
  }

  .stat-card .stat-value {
    font-size: 1.3rem;
  }

  .invoice-preview {
    padding: 20px;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .stats-grid {
    overflow: hidden;
  }

  .content {
    overflow-x: hidden;
    padding: 12px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: transparent;
  color: #333;
  cursor: pointer;
  font-size: 1.3rem;
}

.mobile-menu-btn:hover {
  background: #f0f0f0;
}

@media (min-width: 769px) {
  .sidebar-backdrop {
    display: none !important;
  }
}

/* --- Loading --- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: #888;
  font-size: 0.9rem;
}

/* --- Form Input Color --- */
.form-input[type="color"] {
  height: 42px;
  padding: 4px;
  cursor: pointer;
}

/* --- Login extras --- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 16px;
}

.login-box {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 40px;
}

.login-logos {
  display: flex;
  justify-content: center;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-logo.noqteh {
  font-size: 36px;
  line-height: 1;
}

.brand-logo.plaak {
  font-size: 24px;
  letter-spacing: 4px;
}

.login-box h1 {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.error-msg {
  text-align: center;
  color: #000;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding: 8px;
  background: #f5f5f5;
  border-radius: 4px;
}

.btn-full {
  width: 100%;
}

/* --- Brand indicators --- */
.brand-indicators {
  display: flex;
  gap: 8px;
  align-items: center;
}

.brand-dot {
  font-size: 18px;
  line-height: 1;
}

.brand-rect {
  font-size: 14px;
  letter-spacing: 2px;
}

/* --- Sidebar toggle --- */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #222;
}

.sidebar-header h2 {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  color: #fff;
}

.sidebar.collapsed .sidebar-header h2 {
  display: none;
}

/* --- Sidebar nav active icon color fix --- */
.sidebar-nav a.active svg {
  stroke: #fff;
}

.sidebar-nav a svg {
  stroke: #666;
}

/* --- Balance hidden state --- */
.balance-value {
  transition: opacity 0.15s;
}

/* --- Smooth page transitions --- */
.content {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Responsive sidebar collapse --- */
@media (max-width: 768px) {
  .sidebar.collapsed .sidebar-header h2 {
    display: none;
  }
}

.sidebar.collapsed .sidebar-nav a span {
  display: none;
}

.sidebar.collapsed .sidebar-header h2 {
  display: none;
}

.sidebar.collapsed .sidebar-footer .text-sm {
  display: none;
}

/* --- Topbar responsive --- */
@media (max-width: 768px) {
  .topbar {
    padding: 0 16px;
  }
  .content {
    padding: 16px;
  }
}

/* --- Global Hide Button (Eye icon in sidebar) --- */
#globalHideBtn {
  background: none;
  border: none;
  color: #999;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  transition: color 0.15s;
}

#globalHideBtn:hover {
  color: #fff;
}

.sidebar.collapsed #globalHideBtn {
  margin: 0 auto;
}

/* --- Month Selector in Topbar --- */
.month-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-selector select {
  min-width: 160px;
  padding: 6px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #000;
  background: #fff;
}

/* --- Stats Grid Extended --- */
.stats-grid > .stat-card[style*="grid-column"] {
  grid-column: span 1;
}

.stats-grid .stat-value {
  word-break: break-word;
}

.chart-container canvas {
  max-width: 100%;
}

/* --- Balance Value --- */
.balance-value[data-hidden="1"] {
  color: #aaa;
}

/* --- Invoice Bank Info --- */
#invoiceBankInfo .p-16 {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

/* --- Settings Brand Cards --- */
#settingsBrands .grid-2 > .card {
  border: 1px solid #e0e0e0;
}

/* --- Loan Payment Modal --- */
#loanPaymentForm .form-input {
  width: 100%;
}

/* --- Brand Logo Upload --- */
#settingsBrands input[type="file"] {
  font-size: 0.75rem;
}

/* --- Month Display --- */
#currentMonthDisplay {
  font-weight: 500;
  color: #333;
}

/* --- Glassmorphism & Premium UI Polish --- */
.card, .stat-card {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s;
}

.card:hover, .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

.sidebar {
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.05);
}

.topbar {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.015);
}

/* Custom Scrollbar for a premium look */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* --- Dark Theme Overrides --- */
body.dark-theme {
  background: #121212 !important;
  color: #e0e0e0 !important;
}

body.dark-theme .topbar,
body.dark-theme .card,
body.dark-theme .stat-card,
body.dark-theme .modal,
body.dark-theme .form-input,
body.dark-theme .form-select,
body.dark-theme .form-textarea,
body.dark-theme tbody tr:hover,
body.dark-theme #invoiceBankInfo .p-16 {
  background: #1e1e1e !important;
  color: #e0e0e0 !important;
  border-color: #333 !important;
}

body.dark-theme thead th {
  color: #aaa !important;
  border-bottom-color: #333 !important;
  background: #181818 !important;
}

body.dark-theme tbody td {
  border-bottom-color: #2a2a2a !important;
}

body.dark-theme .sidebar {
  background: #181818 !important;
  border-left: 1px solid #2a2a2a !important;
}

body.dark-theme .sidebar-header {
  border-bottom: 1px solid #2a2a2a !important;
}

body.dark-theme .btn-secondary {
  background: #2a2a2a !important;
  color: #e0e0e0 !important;
  border-color: #444 !important;
}

body.dark-theme .btn-secondary:hover {
  background: #3a3a3a !important;
}

body.dark-theme .btn-primary {
  background: #e0e0e0 !important;
  color: #121212 !important;
}

body.dark-theme .btn-primary:hover {
  background: #ffffff !important;
}

body.dark-theme .btn-icon {
  color: #aaa !important;
}

body.dark-theme .btn-icon:hover {
  background: #2a2a2a !important;
  color: #fff !important;
}

body.dark-theme .modal-header,
body.dark-theme .modal-footer {
  border-color: #333 !important;
}

body.dark-theme .stat-card[style*="border-right"] {
  background: #1e1e1e !important;
}

