/* ═══════════════════════════════════════════════════
   PRIME HOUSE TECHNOLOGY — CRM STYLESHEET
   Design: Zoho CRM inspired, dark navy sidebar
═══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-bg:      #1a2435;
  --sidebar-hover:   #243347;
  --sidebar-active:  #2563eb;
  --sidebar-text:    #94a3b8;
  --sidebar-label:   #4a6080;
  --sidebar-width:   240px;
  --topbar-h:        56px;
  --breadcrumb-h:    36px;
  --bg:              #f1f5f9;
  --card:            #ffffff;
  --border:          #e2e8f0;
  --text:            #1e293b;
  --text-muted:      #64748b;
  --primary:         #2563eb;
  --primary-hover:   #1d4ed8;
  --success:         #10b981;
  --warning:         #f59e0b;
  --danger:          #ef4444;
  --info:            #06b6d4;
  --shadow-sm:       0 1px 3px rgba(0,0,0,.08);
  --shadow:          0 4px 12px rgba(0,0,0,.08);
  --radius:          8px;
  --radius-sm:       6px;
  --font:            -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body { height: 100%; font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); }
a { text-decoration: none; color: inherit; cursor: pointer; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }

/* ─── SCROLLBARS ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ═══════════════════════════════════════════════════
   LOGIN
═══════════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f1923 0%, #1a2d4a 100%);
}
.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.logo-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--primary); color: #fff;
  font-size: 22px; font-weight: 800; letter-spacing: 1px;
  margin-bottom: 16px;
}
.login-logo h1 { font-size: 20px; font-weight: 700; color: var(--text); }
.login-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.login-version { text-align: center; font-size: 11px; color: #94a3b8; margin-top: 20px; }

/* ═══════════════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════════════ */
.app {
  display: flex; height: 100vh; overflow: hidden;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  transition: width .2s ease, min-width .2s ease;
  z-index: 200;
  overflow: hidden;
}
.sidebar.collapsed { width: 64px; min-width: 64px; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-logo-wrap { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.sidebar-logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-company-name {
  color: #fff; font-weight: 600; font-size: 15px;
  white-space: nowrap; overflow: hidden;
  transition: opacity .2s;
}
.sidebar.collapsed .sidebar-company-name { opacity: 0; width: 0; }

.sidebar-collapse-btn {
  background: none; border: none; color: var(--sidebar-text); cursor: pointer;
  font-size: 12px; padding: 4px; border-radius: 4px; flex-shrink: 0;
  transition: background .15s;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,.08); }
.sidebar.collapsed .sidebar-collapse-btn { transform: rotate(180deg); }

.sidebar-scroll {
  flex: 1; overflow-y: auto; padding: 8px 0 24px;
  overflow-x: hidden;
}

.nav-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: var(--sidebar-label); padding: 16px 16px 4px;
  white-space: nowrap; overflow: hidden;
  transition: opacity .2s;
}
.sidebar.collapsed .nav-group-label { opacity: 0; height: 0; padding: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; cursor: pointer;
  color: var(--sidebar-text); transition: background .15s, color .15s;
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-item.active {
  background: rgba(37,99,235,.15); color: #93c5fd;
  border-left-color: var(--sidebar-active);
}
.ni { font-size: 15px; flex-shrink: 0; width: 20px; text-align: center; }
.nl { font-size: 13px; font-weight: 500; transition: opacity .2s; }
.sidebar.collapsed .nl { opacity: 0; width: 0; overflow: hidden; }

/* ─── MAIN WRAPPER ─── */
.main-wrapper {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  min-width: 0;
}

/* ─── TOP BAR ─── */
.topbar {
  height: var(--topbar-h);
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; gap: 16px; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.topbar-menu-btn {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 18px; padding: 4px; border-radius: 4px; flex-shrink: 0;
}
.topbar-menu-btn:hover { background: var(--bg); }
.search-wrap { position: relative; flex: 1; max-width: 420px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; }
#global-search {
  width: 100%; padding: 7px 10px 7px 32px;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--bg); outline: none; transition: border .15s;
}
#global-search:focus { border-color: var(--primary); background: #fff; }
.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); z-index: 300; max-height: 300px; overflow-y: auto;
}
.search-result-item {
  padding: 10px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px;
}
.search-result-item:hover { background: var(--bg); }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: none; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.topbar-icon-btn:hover { background: var(--bg); }
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: #fff;
  border-radius: 10px; font-size: 10px; font-weight: 700;
  padding: 0 4px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
}
.user-profile {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 8px; border-radius: var(--radius-sm);
  position: relative; transition: background .15s;
}
.user-profile:hover { background: var(--bg); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; }
.user-name  { font-size: 13px; font-weight: 600; }
.user-role  { font-size: 11px; color: var(--text-muted); }
.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 160px; z-index: 300; display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown a {
  display: block; padding: 10px 16px; font-size: 13px;
  color: var(--text); transition: background .15s;
}
.user-dropdown a:hover { background: var(--bg); }

/* ─── BREADCRUMB ─── */
.breadcrumb-bar {
  height: var(--breadcrumb-h);
  background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px;
  font-size: 13px; color: var(--text-muted); flex-shrink: 0;
}
#breadcrumb-module { font-weight: 600; color: var(--text); }

/* ─── MAIN CONTENT ─── */
.main-content {
  flex: 1; overflow-y: auto; padding: 24px;
  background: var(--bg);
}

/* ═══════════════════════════════════════════════════
   LOADING & STATES
═══════════════════════════════════════════════════ */
.page-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px; padding: 80px 0; color: var(--text-muted);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid #e2e8f0; border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }

/* ═══════════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-header-left h2 { font-size: 22px; font-weight: 700; color: var(--text); }
.page-header-left p  { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-header-right { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════ */
.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* ─── KPI GRID ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.kpi-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  padding: 20px; display: flex; flex-direction: column; gap: 8px;
}
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--text); }
.kpi-change { font-size: 12px; display: flex; align-items: center; gap: 4px; }
.kpi-change.up   { color: var(--success); }
.kpi-change.down { color: var(--danger); }
.kpi-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 4px;
}

/* ─── CHART GRID ─── */
.chart-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.chart-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); }
.chart-card-header { padding: 16px 20px 0; }
.chart-card-header h4 { font-size: 14px; font-weight: 600; }
.chart-card-header p  { font-size: 12px; color: var(--text-muted); }
.chart-body { padding: 16px 20px 20px; position: relative; height: 240px; }

/* ═══════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 10px 14px; text-align: left;
  background: #f8fafc; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px; border-bottom: 1px solid #f1f5f9;
  color: var(--text); vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .actions { display: flex; gap: 6px; }

/* ─── TOOLBAR ─── */
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-search {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 6px;
  outline: none; width: 220px; transition: border .15s;
}
.table-search:focus { border-color: var(--primary); }
.table-filter-select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; outline: none;
}
.record-count { font-size: 12px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm); border: none;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #dc2626; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-ghost     { background: transparent; color: var(--text-muted); border: none; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm); }

/* ═══════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em;
}
.form-control {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); outline: none; transition: border .15s;
  background: #fff; color: var(--text);
}
.form-control:focus { border-color: var(--primary); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.error-msg { background: #fef2f2; color: var(--danger); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }

/* ═══════════════════════════════════════════════════
   BADGES & STATUS
═══════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #e0f2fe; color: #075985; }
.badge-primary { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: #f1f5f9; color: #475569; }
.badge-purple  { background: #ede9fe; color: #5b21b6; }

/* ═══════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal-box {
  background: #fff; border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%; max-width: 640px; max-height: 90vh;
  display: flex; flex-direction: column;
}
.modal-box.modal-lg { max-width: 900px; }
.modal-box.modal-xl { max-width: 1100px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; padding: 4px; border-radius: 4px;
}
.modal-close-btn:hover { background: var(--bg); }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }

/* ═══════════════════════════════════════════════════
   TOASTS
═══════════════════════════════════════════════════ */
.toast-stack {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 2000;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  background: #1e293b; color: #fff; min-width: 280px;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  animation: slide-in .2s ease;
}
.toast.toast-success { background: #065f46; }
.toast.toast-error   { background: #991b1b; }
.toast.toast-warning { background: #92400e; }
.toast-icon { font-size: 16px; }
.toast-msg  { flex: 1; font-size: 13px; }
@keyframes slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ═══════════════════════════════════════════════════
   INVOICE / DOCUMENT STYLES
═══════════════════════════════════════════════════ */
.invoice-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.invoice-company h2 { font-size: 24px; font-weight: 800; color: var(--primary); }
.invoice-title-block { text-align: right; }
.invoice-title-block h1 { font-size: 28px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; }
.invoice-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.invoice-meta-section label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 4px; }
.invoice-meta-section p { font-size: 14px; color: var(--text); }
.invoice-meta-section strong { font-size: 15px; }
.invoice-table-wrap { margin: 20px 0; }
.invoice-table th { background: var(--primary); color: #fff; font-size: 12px; }
.invoice-totals { display: flex; justify-content: flex-end; margin-top: 16px; }
.invoice-totals-box { min-width: 280px; }
.invoice-total-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); }
.invoice-total-row.grand { font-size: 16px; font-weight: 700; color: var(--primary); border-bottom: none; padding-top: 10px; }

/* ─── Line Item Editor ─── */
.line-items-table { width: 100%; border-collapse: collapse; }
.line-items-table th { padding: 8px 10px; background: #f8fafc; font-size: 11px; font-weight: 700; color: var(--text-muted); text-align: left; border-bottom: 1px solid var(--border); }
.line-items-table td { padding: 6px 6px; border-bottom: 1px solid #f1f5f9; }
.line-items-table input, .line-items-table select { width: 100%; border: 1px solid var(--border); border-radius: 4px; padding: 5px 8px; }
.line-items-table input:focus { outline: none; border-color: var(--primary); }

/* ═══════════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════════ */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-item {
  padding: 10px 16px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all .15s;
}
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-item:hover { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ═══════════════════════════════════════════════════
   PIPELINE / KANBAN
═══════════════════════════════════════════════════ */
.pipeline-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.pipeline-col { min-width: 240px; background: #f8fafc; border-radius: var(--radius); border: 1px solid var(--border); }
.pipeline-col-header { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.pipeline-col-header h4 { font-size: 13px; font-weight: 600; }
.pipeline-count { background: var(--border); color: var(--text-muted); border-radius: 20px; padding: 1px 8px; font-size: 12px; }
.pipeline-col-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.deal-card { background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--border); padding: 12px; cursor: pointer; transition: box-shadow .15s; }
.deal-card:hover { box-shadow: var(--shadow); }
.deal-card-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.deal-card-meta { font-size: 12px; color: var(--text-muted); }
.deal-card-value { font-size: 14px; font-weight: 700; color: var(--primary); margin-top: 6px; }

/* ═══════════════════════════════════════════════════
   DETAIL VIEW
═══════════════════════════════════════════════════ */
.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.detail-main .card { margin-bottom: 16px; }
.detail-side .card { margin-bottom: 16px; }
.field-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.field-row:last-child { border-bottom: none; }
.field-label { color: var(--text-muted); font-weight: 500; }
.field-value { font-weight: 500; text-align: right; max-width: 60%; }

/* ═══════════════════════════════════════════════════
   STATS / SUMMARY STRIPS
═══════════════════════════════════════════════════ */
.summary-strip {
  display: flex; gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 20px;
}
.summary-item { flex: 1; background: #fff; padding: 16px 20px; }
.summary-item label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 4px; }
.summary-item .val { font-size: 20px; font-weight: 700; }

/* ═══════════════════════════════════════════════════
   FINANCIAL REPORTS
═══════════════════════════════════════════════════ */
.report-section { margin-bottom: 8px; }
.report-section-header { background: #f1f5f9; padding: 10px 16px; font-weight: 700; font-size: 13px; }
.report-row { display: flex; justify-content: space-between; padding: 8px 16px; font-size: 13px; border-bottom: 1px solid #f8fafc; }
.report-row:hover { background: #f8fafc; cursor: pointer; }
.report-row.subtotal { font-weight: 700; background: #f8fafc; }
.report-row.total { font-weight: 800; font-size: 15px; background: #e0e7ef; padding: 12px 16px; }
.report-row.profit { background: #d1fae5; color: #065f46; font-weight: 800; }
.report-row.loss   { background: #fee2e2; color: #991b1b; font-weight: 800; }
.report-indent { padding-left: 32px; }

/* ═══════════════════════════════════════════════════
   AGING TABLE
═══════════════════════════════════════════════════ */
.aging-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 12px; margin-bottom: 16px; }
.aging-col { text-align: center; }
.aging-col label { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; display: block; margin-bottom: 4px; }
.aging-col .aging-val { font-size: 18px; font-weight: 700; }
.aging-col.overdue .aging-val { color: var(--danger); }

/* ═══════════════════════════════════════════════════
   TIMELINE / ACTIVITY
═══════════════════════════════════════════════════ */
.timeline { padding: 8px 0; }
.timeline-item { display: flex; gap: 12px; padding: 8px 0; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex-shrink: 0; }
.timeline-content .tl-time { font-size: 11px; color: var(--text-muted); }
.timeline-content .tl-text { font-size: 13px; margin-top: 2px; }

/* ═══════════════════════════════════════════════════
   QUICK ADD MENU
═══════════════════════════════════════════════════ */
.quick-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-add-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); cursor: pointer; transition: all .15s;
}
.quick-add-item:hover { background: var(--bg); border-color: var(--primary); }
.quick-add-item span.qa-icon { font-size: 18px; }
.quick-add-item span.qa-label { font-size: 13px; font-weight: 500; }

/* ═══════════════════════════════════════════════════
   NOTIFICATIONS PANEL
═══════════════════════════════════════════════════ */
.notif-item { padding: 12px 0; border-bottom: 1px solid #f1f5f9; display: flex; gap: 10px; }
.notif-item:last-child { border-bottom: none; }
.notif-item-icon { font-size: 18px; }
.notif-item-text { flex: 1; }
.notif-item-title { font-size: 13px; font-weight: 600; }
.notif-item-time  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -240px; top: 0; height: 100%; transition: left .25s; }
  .sidebar.mobile-open { left: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .modal-box { margin: 10px; max-width: calc(100vw - 20px); }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
}

/* ═══════════════════════════════════════════════════
   PRINT
═══════════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .breadcrumb-bar, .page-header-right, .btn, .table-toolbar { display: none !important; }
  .main-wrapper { margin: 0; }
  .main-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
