/* assets/css/dashboard.css */

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

/* ============ THEME TOKENS ============ */
:root{
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;

  /* Light (default like your earlier look) */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fbfbfc;  /* headers in cards */
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --hover: #f8fafc;

  --chip: #f3f4f6;

  --active-bg: #eef6ff;
  --active-border: #bfdbfe;
  --active-bar: #3b82f6;
}

/* Dark */
html[data-theme="dark"]{
  --bg: #0b1220;
  --surface: #0f172a;
  --surface-2: #111c33;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: rgba(255,255,255,0.10);
  --hover: rgba(255,255,255,0.06);

  --chip: rgba(255,255,255,0.06);

  --active-bg: rgba(59,130,246,0.16);
  --active-border: rgba(59,130,246,0.35);
  --active-bar: #60a5fa;
}

/* ============ BASE ============ */
html, body{ height: 100%; }

body{
  margin:0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main */
.app-main{
  padding: 16px 20px;
  background: var(--bg);
  min-width: 0;
  overflow-x: auto;
}

/* Header */
.app-header{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
}

.app-page-title{
  margin:0;
  font-size: 20px;     /* Zoho/Razorpay-ish */
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.header-sub{
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

/* Content */
.app-content{
  display:grid;
  gap: 14px;
}

/* Advisors */
.advisors-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.advisors-grid{
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  text-align: center;
}

/* Subtle hover highlight (professional) */
.advisor{
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--surface);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.advisor:hover{
  background: var(--hover);
  border-color: var(--line);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.advisor img{
  width: 52px;
  height: 52px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  border: 1px solid rgba(17,24,39,0.10);
  transition: transform 140ms ease;
}
.advisor:hover img{ transform: scale(1.03); }

.advisor p{
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}
.advisor p a{
  color: #2563eb;
  text-decoration: none;
}
html[data-theme="dark"] .advisor p a{ color: #60a5fa; }
.advisor p a:hover{ text-decoration: underline; }

/* Section title */
.services-section h2,
#business-services h2{
  margin: 6px 0 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Table card */
.dashboard-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

/* Table */
.table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th{
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.table tbody td{
  padding: 12px;
  border-bottom: 1px solid rgba(148,163,184,0.18);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
html[data-theme="dark"] .table tbody td{
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.table tbody tr:hover td{ background: rgba(148,163,184,0.10); }
html[data-theme="dark"] .table tbody tr:hover td{ background: rgba(255,255,255,0.04); }

.table a{
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
}
html[data-theme="dark"] .table a{ color: #60a5fa; }
.table a:hover{ text-decoration: underline; }

/* Footer */
.app-footer{
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 16px 0 6px;
}

/* Responsive */
@media (max-width:1100px){
  .advisors-grid{ grid-template-columns: repeat(4, 1fr); }
}
@media (max-width:900px){
  .app-main{ padding: 14px; }
  .advisors-grid{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width:520px){
  .advisors-grid{ grid-template-columns: repeat(2, 1fr); }
}



/* 2-column grid (left stacked, right single) */
.apply-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.apply-stack{
  display: grid;
  gap: 12px;
}
@media (max-width:900px){
  .apply-grid{ grid-template-columns: 1fr; }
}

/* inner cards */
.svc-wrap{
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.svc-head{
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.svc-title{
  margin: 0;
  font-size: 12.5px;
  font-weight: 900;
  color: var(--text);
}

/* compact table spacing for apply list */
.table-compact thead th,
.table-compact tbody td{
  padding: 10px 12px;
}

.tight{ width: 1%; white-space: nowrap; }
.t-center{ text-align: center; }
.svc-name{ text-align: left; font-weight: 800; }
.svc-desc{ font-weight: 600; color: var(--muted); }

.btn-apply{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 800;
  text-decoration: none;
}
.btn-apply:hover{
  background: var(--hover);
  text-decoration: none;
}

/* alerts */
.alert{
  border: 1px solid rgba(239,68,68,.25);
  background: rgba(239,68,68,.06);
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.alert-title{ font-weight: 900; margin-bottom: 6px; }
.alert ul{ margin: 0; padding-left: 18px; }

.linkcell a{ font-weight: 800; text-decoration: underline; }

/* ============================
   Accounting-specific additions
   ============================ */

/* Summary stat cards */
.stats-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width:700px){
  .stats-grid{ grid-template-columns: 1fr; }
}

.stat-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-label{
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.stat-value{
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1;
}
.stat-icon{
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon svg{ width: 20px; height: 20px; }
.stat-icon.blue{ background: #eef6ff; color: #2563eb; }
.stat-icon.green{ background: #ecfdf5; color: #059669; }
.stat-icon.purple{ background: #f5f3ff; color: #7c3aed; }
.stat-icon.orange{ background: #fff7ed; color: #ea580c; }
html[data-theme="dark"] .stat-icon.blue{ background: rgba(37,99,235,0.15); }
html[data-theme="dark"] .stat-icon.green{ background: rgba(5,150,105,0.15); }
html[data-theme="dark"] .stat-icon.purple{ background: rgba(124,58,237,0.15); }
html[data-theme="dark"] .stat-icon.orange{ background: rgba(234,88,12,0.15); }

/* Voucher type quick-links */
.vtype-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width:700px){
  .vtype-grid{ grid-template-columns: repeat(2, 1fr); }
}

.vtype-card{
  display: block;
  text-align: center;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.vtype-card:hover{
  background: var(--hover);
  border-color: var(--active-border);
  box-shadow: 0 4px 12px rgba(15,23,42,0.06);
  text-decoration: none;
}
.vtype-sub{
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}

/* Card head with title */
.card-head{
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title{
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

/* Form elements */
.form-group{ margin-bottom: 14px; }
.form-label{
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.form-label .req{ color: #ef4444; }

.form-input,
.form-select{
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
}
.form-input:focus,
.form-select:focus{
  border-color: var(--active-border);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease;
  text-decoration: none;
}
.btn-primary{
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.btn-primary:hover{ background: #1d4ed8; }

.btn-secondary{
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}
.btn-secondary:hover{ background: var(--hover); }

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

/* Grid layouts */
.grid-2{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width:600px){
  .grid-2{ grid-template-columns: 1fr; }
}

/* Chip / Badge */
.badge{
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge-blue{ background: #eef6ff; color: #2563eb; }
.badge-red{ background: #fef2f2; color: #dc2626; }
.badge-green{ background: #ecfdf5; color: #059669; }
.badge-orange{ background: #fff7ed; color: #ea580c; }
.badge-purple{ background: #f3f0ff; color: #7c3aed; }

/* Text alignment helpers */
.text-right{ text-align: right; }
.text-center{ text-align: center; }
.text-left{ text-align: left; }
.text-muted{ color: var(--muted); }
.font-bold{ font-weight: 700; }
.font-medium{ font-weight: 500; }
.mt-4{ margin-top: 14px; }
.mb-4{ margin-bottom: 14px; }
.mb-2{ margin-bottom: 8px; }
.pt-4{ padding-top: 14px; }

/* Back link */
.back-link{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 14px;
}
.back-link:hover{ color: #2563eb; }
.back-link svg{ width: 16px; height: 16px; }

/* Filter bar */
.filter-bar{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.filter-bar .form-input,
.filter-bar .form-select{
  width: auto;
  min-width: 140px;
  padding: 7px 10px;
}

/* Pagination */
.pagination{
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

/* Alert variations */
.alert-success{
  border-color: rgba(5,150,105,0.25);
  background: rgba(5,150,105,0.06);
  color: #065f46;
}
.alert-error{
  border-color: rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.06);
  color: #991b1b;
}

/* Balance indicator */
.balance-ok{
  font-size: 12px;
  font-weight: 700;
  color: #059669;
}
.balance-err{
  font-size: 12px;
  font-weight: 700;
  color: #dc2626;
}

/* Entry table for voucher create */
.entry-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.entry-table thead th{
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.entry-table tbody td{
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.entry-table .form-input,
.entry-table .form-select{
  padding: 7px 8px;
  border-radius: 8px;
}

/* Remove row button */
.btn-remove{
  background: none;
  border: none;
  color: #ef4444;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.btn-remove:hover{ color: #dc2626; }

/* Add row link */
.btn-add-row{
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.btn-add-row:hover{ text-decoration: underline; }

/* Totals row */
.total-row td{
  border-top: 2px solid var(--text);
  font-weight: 800;
  padding: 10px 12px;
}

/* Narration block */
.narration-block{
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.narration-label{
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.narration-text{
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* Mobile hamburger */
.mobile-toggle{
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}
@media (max-width:900px){
  .mobile-toggle{ display: inline-flex; }
}

/* ============ BOOTSTRAP OVERRIDES ============ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}
.app-shell > .app-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  max-width: var(--sidebar-w);
}
.app-main {
  min-width: 0;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}
.app-sidebar .app-menu-link {
  color: var(--sb-ink, var(--text));
}
.app-sidebar .app-menu-link:hover {
  color: var(--sb-ink, var(--text));
}
.app-sidebar .menu-summary {
  color: var(--sb-muted, var(--muted));
}
.app-sidebar a:focus,
.app-sidebar button:focus {
  box-shadow: none;
}
.btn-primary {
  background-color: #2563eb;
  border-color: #2563eb;
}
.btn-primary:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}
.btn-success {
  background-color: #059669;
  border-color: #059669;
}
.btn-success:hover {
  background-color: #047857;
  border-color: #047857;
}
.btn-danger {
  background-color: #dc2626;
  border-color: #dc2626;
}
.btn-danger:hover {
  background-color: #b91c1c;
  border-color: #b91c1c;
}
.card {
  border-radius: 12px;
  border-color: var(--line);
  background: var(--surface);
}
.card-header.bg-dark {
  background-color: #1e293b !important;
  border-bottom-color: var(--line);
}
.form-control,
.form-select {
  border-color: var(--line);
  background-color: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--active-border);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  background-color: var(--surface);
  color: var(--text);
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.input-group-text {
  border-color: var(--line);
  background-color: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}
.table {
  color: var(--text);
}
.table > thead > tr > th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom-color: var(--line);
}
.table > tbody > tr > td {
  border-bottom-color: var(--line);
  font-size: 13px;
  vertical-align: middle;
}
.table > tbody > tr:hover > td {
  background: var(--hover);
}
.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: var(--surface-2);
  color: var(--text);
}
.container-fluid {
  color: var(--text);
}
.alert {
  border-radius: 10px;
  font-size: 13px;
}
.font-monospace {
  font-family: 'Courier New', Courier, monospace !important;
  font-size: 12px !important;
}
