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

/* Dhake & Associates Office ERP - Custom Styles */

:root {
  --primary: #4d4a86;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #464794;
  --header-bg: #ffffff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Layout */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 260px;
  background: var(--sidebar-bg);
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

#sidebar.collapsed {
  transform: translateX(-260px);
}

#main-content {
  margin-left: 260px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

#main-content.expanded {
  margin-left: 0;
}

/* Sidebar Brand */
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
}

.brand-name {
  color: white;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-sub {
  color: #475569;
  font-size: 11px;
  font-weight: 500;
}

/* Sidebar Nav */
.nav-section {
  padding: 10px 0;
}

.nav-section-title {
  padding: 8px 20px 4px;
  color: #334155;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  cursor: pointer;
  border-radius: 0;
  transition: all 0.2s;
  font-size: 13.5px;
  position: relative;
  border-left: 3px solid transparent;
  font-weight: 500;
}

.nav-item:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
  border-left-color: rgba(99, 102, 241, 0.4);
}

.nav-item.active {
  color: white;
  background: rgba(99, 102, 241, 0.18);
  border-left-color: var(--sidebar-active);
  font-weight: 600;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

/* Header */
#top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}

.page-subtitle {
  font-size: 12px;
  color: #94a3b8;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  position: relative;
  border: none;
  transition: all 0.2s;
}

.header-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* Page Content */
.page-content {
  padding: 24px;
}

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.25s;
  cursor: default;
}

.stat-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 12px;
  color: #64748b;
  margin-top: 5px;
  font-weight: 500;
}

.stat-change {
  font-size: 11px;
  margin-top: 7px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up {
  color: var(--success);
}

.stat-change.down {
  color: var(--danger);
}

/* Cards */
.card {
  background: white;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 4px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #e8edf2;
  color: #1e293b;
}

.btn-success {
  background: var(--success);
  color: white;
  border: none;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: white;
  border: none;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid #e2e8f0;
  color: #475569;
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

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

.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
  /* prevents table from getting too narrow */
}

thead th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  vertical-align: middle;
}

tbody tr:hover {
  background: #f8fafc;
}

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

/* Compact code/monospace cells — PAN, GSTIN, CIN, TAN */
td code,
td .code-cell {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 11.5px;
  background: #f1f5f9;
  color: #334155;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* Client table: fixed column widths to prevent GSTIN blowout */
#clients-table {
  table-layout: fixed;
}

#clients-table th:nth-child(1) {
  width: 100px;
}

/* Code */
#clients-table th:nth-child(2) {
  min-width: 160px;
}

/* Client Name */
#clients-table th:nth-child(3) {
  width: 140px;
}

/* Email */
#clients-table th:nth-child(4) {
  width: 100px;
}

/* PAN */
#clients-table th:nth-child(5) {
  width: 140px;
}

/* GSTIN */
#clients-table th:nth-child(6) {
  width: 90px;
}

/* City */
#clients-table th:nth-child(7) {
  width: 110px;
}

/* Manager */
#clients-table th:nth-child(8) {
  width: 80px;
}

/* Status */
#clients-table th:nth-child(9) {
  width: 90px;
}

/* Actions */

/* Truncate text in fixed-layout table cells */
#clients-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
  /* required for text-overflow on table-layout:fixed */
}

/* Table card used in Workflows, Leave, etc. */
.table-card {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-pending {
  background: #fef3c7;
  color: #d97706;
}

.badge-in_process {
  background: #dbeafe;
  color: #2563eb;
}

.badge-filed {
  background: #e0e7ff;
  color: #5b21b6;
}

.badge-completed {
  background: #d1fae5;
  color: #059669;
}

.badge-na {
  background: #f3f4f6;
  color: #6b7280;
}

.badge-active {
  background: #d1fae5;
  color: #059669;
}

.badge-inactive {
  background: #fee2e2;
  color: #dc2626;
}

.badge-draft {
  background: #f3f4f6;
  color: #6b7280;
}

.badge-sent {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-paid {
  background: #d1fae5;
  color: #059669;
}

.badge-partially_paid {
  background: #fef3c7;
  color: #d97706;
}

.badge-overdue {
  background: #fee2e2;
  color: #dc2626;
}

.badge-low {
  background: #d1fae5;
  color: #059669;
}

.badge-medium {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-high {
  background: #fef3c7;
  color: #d97706;
}

.badge-urgent {
  background: #fee2e2;
  color: #dc2626;
}

.badge-todo {
  background: #f3f4f6;
  color: #6b7280;
}

.badge-in_progress {
  background: #dbeafe;
  color: #2563eb;
}

.badge-review {
  background: #ede9fe;
  color: #7c3aed;
}

.badge-cancelled {
  background: #fee2e2;
  color: #dc2626;
}

/* New color badges */
.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-green {
  background: #d1fae5;
  color: #059669;
}

.badge-red {
  background: #fee2e2;
  color: #dc2626;
}

.badge-yellow {
  background: #fef3c7;
  color: #d97706;
}

.badge-gray {
  background: #f3f4f6;
  color: #6b7280;
}

.badge-purple {
  background: #ede9fe;
  color: #7c3aed;
}

.badge-orange {
  background: #ffedd5;
  color: #c2410c;
}

.badge-teal {
  background: #ccfbf1;
  color: #0f766e;
}

.badge-pink {
  background: #fce7f3;
  color: #9d174d;
}

.badge-success {
  background: #d1fae5;
  color: #059669;
}

.badge-warning {
  background: #fef3c7;
  color: #d97706;
}

.badge-danger {
  background: #fee2e2;
  color: #dc2626;
}

.badge-info {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Tab active (both .active and .tab-active for compatibility) */
.tab-btn.tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* New page header utility */
.page-title-main {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 4px 0;
}

.page-subtitle-main {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

/* Extra button sizes (no overrides – defined in main .btn section above) */

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

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

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #1e293b;
  background: white;
  transition: all 0.2s;
  outline: none;
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}

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

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
  overflow-x: auto;
  gap: 0;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
}

.modal-sm {
  max-width: 480px;
}

.modal-md {
  max-width: 640px;
}

.modal-lg {
  max-width: 900px;
}

.modal-xl {
  max-width: 1100px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  border: none;
  cursor: pointer;
  color: #64748b;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #fee2e2;
  color: var(--danger);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  min-height: 400px;
}

.kanban-col {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
  min-width: 200px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  margin-bottom: 12px;
}

.kanban-col-title {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

.kanban-count {
  background: #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.kanban-card {
  background: white;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: box-shadow 0.2s;
}

.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.kanban-card.urgent {
  border-left-color: var(--danger);
}

.kanban-card.high {
  border-left-color: var(--warning);
}

.kanban-card.medium {
  border-left-color: var(--info);
}

.kanban-card.low {
  border-left-color: var(--success);
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
}

.search-bar input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: #1e293b;
  width: 200px;
}

.search-bar i {
  color: #94a3b8;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: white;
  border-radius: 10px;
  padding: 14px 18px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideInRight 0.3s ease;
  border-left: 4px solid;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.info {
  border-left-color: var(--info);
}

.toast-title {
  font-weight: 700;
  font-size: 13px;
  color: #1e293b;
}

.toast-msg {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.toast-icon {
  font-size: 18px;
  margin-top: 1px;
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error .toast-icon {
  color: var(--danger);
}

.toast.warning .toast-icon {
  color: var(--warning);
}

.toast.info .toast-icon {
  color: var(--info);
}

/* Login Page */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 75%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: slideUp 0.4s ease;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 128px;
  height: 82px;
  background: #ffffff;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.14);
}

@media (max-width: 520px) {
  .login-card {
    padding: 32px 22px;
  }

  .login-logo {
    flex-direction: column;
    text-align: center;
  }

  .login-logo-icon {
    width: 116px;
    height: 74px;
  }
}

/* Charts */
.chart-container {
  position: relative;
  height: 250px;
}

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

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
  animation: fadeIn 0.15s ease;
}

.dropdown-item {
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #374151;
}

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

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item.danger:hover {
  background: #fee2e2;
}

.dropdown-divider {
  border-top: 1px solid #f1f5f9;
  margin: 4px 0;
}

/* Compliance Status Colors */
.status-pending {
  color: #d97706;
}

.status-in_process {
  color: #2563eb;
}

.status-filed {
  color: #5b21b6;
}

.status-completed {
  color: #059669;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(80px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Responsive */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-260px);
  }

  #sidebar.mobile-open {
    transform: translateX(0);
  }

  #main-content {
    margin-left: 0;
  }

  .kanban-board {
    grid-template-columns: 1fr 1fr;
  }

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

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

@media (max-width: 480px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }

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

  .page-content {
    padding: 16px;
  }
}

/* Utility classes */
.text-primary {
  color: var(--primary);
}

.text-muted {
  color: #64748b;
}

.text-sm {
  font-size: 12px;
}

.text-center {
  text-align: center;
}

.font-bold {
  font-weight: 700;
}

.mt-0 {
  margin-top: 0;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-2 {
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
  display: block;
}

.empty-state p {
  font-size: 15px;
  margin: 0;
}

/* Clickable card (Finance reports, etc.) */
.clickable-card {
  cursor: pointer;
  transition: all 0.25s;
}

.clickable-card:hover {
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.12);
  transform: translateY(-3px);
  border-color: #c7d2fe;
}

/* ===== CLIENT PORTAL STYLES ===== */

/* Portal Layout (no sidebar by default, clean layout) */
.portal-layout {
  min-height: 100vh;
  background: #f0f4f8;
}

.portal-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 60%, #2563eb 100%);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.portal-brand-logo {
  width: 40px;
  height: 40px;
  background: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.portal-brand-name {
  color: white;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.portal-brand-sub {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.portal-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  white-space: nowrap;
}

.portal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.portal-nav-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 700;
}

.portal-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Portal Cards */
.portal-stat-card {
  background: white;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  border: 1px solid #e8f0fe;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.2s;
}

.portal-stat-card:hover {
  box-shadow: 0 6px 20px rgba(30, 64, 175, 0.1);
  transform: translateY(-1px);
}

.portal-stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.portal-stat-value {
  font-size: 30px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
}

.portal-stat-label {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
  font-weight: 500;
}

.portal-stat-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Task Progress */
.task-progress-card {
  background: white;
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid #e2e8f0;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.task-progress-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.task-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}

.task-meta {
  font-size: 12px;
  color: #64748b;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.task-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.progress-bar-wrapper {
  background: #f1f5f9;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s ease;
}

.progress-bar-fill.todo {
  background: #94a3b8;
  width: 0%;
}

.progress-bar-fill.in_progress {
  background: #3b82f6;
  width: 50%;
}

.progress-bar-fill.review {
  background: #8b5cf6;
  width: 80%;
}

.progress-bar-fill.completed {
  background: #10b981;
  width: 100%;
}

/* Invoice Card (Portal) */
.portal-invoice-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  margin-bottom: 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.portal-invoice-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: #c7d2fe;
}

.portal-invoice-number {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

.portal-invoice-date {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.portal-invoice-amount {
  font-size: 22px;
  font-weight: 800;
  color: #1e293b;
}

.portal-invoice-outstanding {
  font-size: 12px;
  color: #ef4444;
  font-weight: 600;
  margin-top: 2px;
}

.portal-invoice-paid {
  font-size: 12px;
  color: #10b981;
  font-weight: 600;
  margin-top: 2px;
}

/* Document Upload Area */
.upload-zone {
  border: 2px dashed #c7d2fe;
  border-radius: 14px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8f9ff;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}

.upload-zone i {
  font-size: 40px;
  color: #93c5fd;
  margin-bottom: 14px;
}

.upload-zone h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}

.upload-zone p {
  font-size: 13px;
  color: #64748b;
}

/* Document Grid */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.doc-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.09);
  border-color: #c7d2fe;
}

.doc-icon {
  font-size: 28px;
}

.doc-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  word-break: break-word;
  line-height: 1.4;
}

.doc-meta {
  font-size: 11px;
  color: #94a3b8;
}

.doc-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
}

.doc-cat-gst {
  background: #e0e7ff;
  color: #4338ca;
}

.doc-cat-income_tax {
  background: #d1fae5;
  color: #065f46;
}

.doc-cat-roc {
  background: #fef3c7;
  color: #92400e;
}

.doc-cat-trust {
  background: #ede9fe;
  color: #6d28d9;
}

.doc-cat-kyc {
  background: #fee2e2;
  color: #991b1b;
}

.doc-cat-billing {
  background: #dbeafe;
  color: #1d4ed8;
}

.doc-cat-general {
  background: #f1f5f9;
  color: #475569;
}

/* Compliance Timeline */
.compliance-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}

.compliance-item:last-child {
  border-bottom: none;
}

.compliance-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.compliance-dot.completed {
  background: #10b981;
}

.compliance-dot.filed {
  background: #8b5cf6;
}

.compliance-dot.in_process {
  background: #3b82f6;
}

.compliance-dot.pending {
  background: #f59e0b;
}

.compliance-dot.na {
  background: #94a3b8;
}

/* Billing restriction notice */
.billing-restricted {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fbbf24;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #92400e;
  font-size: 13px;
}

/* Portal Welcome Banner */
.portal-welcome {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  border-radius: 16px;
  padding: 28px 32px;
  color: white;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.portal-welcome h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.portal-welcome p {
  font-size: 14px;
  opacity: 0.85;
}

/* Mobile Portal Nav */
@media (max-width: 640px) {
  .portal-nav {
    gap: 0;
  }

  .portal-nav-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .portal-nav-btn span {
    display: none;
  }

  .portal-nav-btn i {
    font-size: 16px;
  }

  .portal-content {
    padding: 16px;
  }

  .portal-welcome {
    padding: 20px;
  }
}

/* Role badge */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-super_admin {
  background: #1e40af;
  color: white;
}

.role-partner {
  background: #7c3aed;
  color: white;
}

.role-manager {
  background: #0891b2;
  color: white;
}

.role-article {
  background: #059669;
  color: white;
}

.role-accountant {
  background: #d97706;
  color: white;
}

.role-client {
  background: #e11d48;
  color: white;
}

/* SOP portal, adapted from the supplied Dhake & Associates design. */
.sop-portal{color:#17343d}
.sop-heading{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:20px}
.sop-heading h2{font-size:26px;font-weight:700}
.sop-portal p{color:#637b82;margin:8px 0 16px}
.sop-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:20px}
.sop-stats>div,.sop-panel{background:white;border:1px solid #dce5e7;border-radius:14px;padding:20px}
.sop-stats strong{display:block;font-size:28px;color:#0d6f69}
.sop-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}
.sop-filters{display:flex;gap:12px;margin-bottom:18px}
.sop-filters input{flex:2}
.sop-filters select{flex:1}
.sop-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:22px;align-items:start}
.sop-panel h3{font-size:20px;font-weight:700;margin-bottom:12px}
.sop-row{display:flex;flex-direction:column;gap:5px;width:100%;text-align:left;padding:15px;border:1px solid #dce5e7;border-radius:10px;margin:10px 0;background:#f8fbfb}
.sop-row:hover,.sop-row:focus{border-color:#0d7771;background:#edf7f5}
.sop-row small,.sop-row span{font-size:12px;color:#587178}
.sop-meta{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0}
.sop-meta span{background:#f3f7f8;padding:12px;border-radius:8px;font-size:12px}
.sop-meta strong{display:block;margin-top:4px}
.sop-step{display:flex;gap:12px;align-items:start;padding:14px;border:1px solid #dce5e7;border-radius:8px;margin:10px 0;cursor:pointer}
.sop-step input{margin-top:4px;accent-color:#0d7771}
.sop-step:has(input:checked){background:#edf7f5}
.sop-portal progress{accent-color:#0d7771}
.sop-portal .btn-primary{background:#0d5966}
.sop-panel{margin-bottom:16px}
@media(max-width:900px){.sop-grid{grid-template-columns:1fr}
.sop-stats{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:480px){.sop-heading,.sop-filters{flex-direction:column;align-items:stretch}
.sop-stats{gap:8px}
.sop-stats>div{padding:12px}
}


.sop-portal progress { height: 8px; border: 0; border-radius: 8px; overflow: hidden; }
.sop-portal progress::-webkit-progress-bar { background: #e3eaeb; }
.sop-portal progress::-webkit-progress-value { background: #0d7771; }
