/* ============================================================
   PAGES.CSS — Dashboard, Clients, Catalog, Revenue, Expenses, Admin
   ============================================================ */

/* ============================================================
   DASHBOARD
   ============================================================ */
.welcome-banner {
   background: linear-gradient(135deg, #1e3c72, #2a5298, var(--primary));
   border-radius: var(--radius-lg);
   padding: 28px 32px;
   margin-bottom: 24px;
   color: white;
   position: relative;
   overflow: hidden;
}

.welcome-banner::before {
   content: '';
   position: absolute;
   top: -40px;
   right: -40px;
   width: 200px;
   height: 200px;
   background: rgba(255, 255, 255, .05);
   border-radius: 50%;
}

.wb-greeting {
   font-size: 24px;
   font-weight: 900;
   margin-bottom: 4px;
}

.wb-sub {
   font-size: 14px;
   opacity: .8;
   margin-bottom: 16px;
}

.wb-quick-actions {
   display: flex;
   gap: 10px;
   flex-wrap: wrap;
}

.wb-btn {
   padding: 8px 16px;
   background: rgba(255, 255, 255, .15);
   border: 1.5px solid rgba(255, 255, 255, .3);
   color: white;
   border-radius: var(--radius-sm);
   font-size: 12px;
   font-weight: 700;
   cursor: pointer;
   transition: var(--transition);
   font-family: var(--font-body);
}

.wb-btn:hover {
   background: rgba(255, 255, 255, .25);
   transform: translateY(-2px);
}

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

.qs-card {
   background: white;
   border-radius: var(--radius-md);
   padding: 20px;
   box-shadow: var(--shadow-sm);
   border-left: 4px solid var(--accent);
   position: relative;
   overflow: hidden;
   transition: var(--transition);
}

.qs-card:hover {
   transform: translateY(-3px);
   box-shadow: var(--shadow-md);
}

.qs-card::after {
   content: '';
   position: absolute;
   bottom: -10px;
   right: -10px;
   width: 60px;
   height: 60px;
   background: var(--accent);
   opacity: .08;
   border-radius: 50%;
}

.qs-val {
   font-size: 26px;
   font-weight: 900;
   color: var(--accent);
   margin-bottom: 4px;
}

.qs-lbl {
   font-size: 12px;
   font-weight: 700;
   color: #64748b;
   text-transform: uppercase;
   letter-spacing: .5px;
}

.qs-trend {
   font-size: 11px;
   margin-top: 4px;
   font-weight: 600;
}

.qs-trend.up {
   color: var(--success);
}

.qs-trend.down {
   color: var(--danger);
}

/* ============================================================
   CLIENTS
   ============================================================ */
.client-card {
   display: flex;
   justify-content: space-between;
   align-items: flex-start;
   padding: 16px;
   background: #f9fafb;
   border-radius: 10px;
   margin-bottom: 10px;
   border: 1.5px solid #e5e7eb;
   transition: var(--transition);
}

.client-card:hover {
   border-color: var(--primary);
   background: white;
   box-shadow: 0 4px 12px rgba(126, 34, 206, .08);
}

.client-avatar {
   width: 42px;
   height: 42px;
   border-radius: 50%;
   background: linear-gradient(135deg, var(--primary), var(--primary-light));
   color: white;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 18px;
   font-weight: 900;
   flex-shrink: 0;
   margin-right: 12px;
}

.client-info {
   flex: 1;
}

.client-name {
   font-size: 14px;
   font-weight: 800;
   color: #1e293b;
   margin-bottom: 2px;
}

.client-meta {
   font-size: 12px;
   color: #64748b;
   line-height: 1.5;
}

.client-cat {
   display: inline-block;
   padding: 2px 8px;
   border-radius: 20px;
   font-size: 10px;
   font-weight: 800;
   margin-top: 4px;
}

.client-cat.VIP {
   background: #fef3c7;
   color: #92400e;
}

.client-cat.Corporate {
   background: #ede9fe;
   color: #6b21a8;
}

.client-cat.Government {
   background: #e0f2fe;
   color: #0369a1;
}

.client-cat.Retail {
   background: #dcfce7;
   color: #166534;
}

.client-actions {
   display: flex;
   gap: 6px;
   flex-wrap: wrap;
   margin-left: 12px;
}

/* ============================================================
   CATALOG
   ============================================================ */
.cat-stats-bar {
   display: grid;
   grid-template-columns: repeat(4, 1fr);
   gap: 14px;
   margin-bottom: 20px;
}

.cat-stat-card {
   background: white;
   border-radius: var(--radius-md);
   padding: 16px;
   text-align: center;
   box-shadow: var(--shadow-sm);
}

.cat-stat-val {
   font-size: 22px;
   font-weight: 900;
   color: var(--primary);
   margin-bottom: 4px;
}

.cat-stat-lbl {
   font-size: 11px;
   font-weight: 700;
   color: #64748b;
   text-transform: uppercase;
}

.catalog-item {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 14px 16px;
   background: #f9fafb;
   border-radius: 10px;
   margin-bottom: 8px;
   border: 1.5px solid #e5e7eb;
   transition: var(--transition);
}

.catalog-item:hover {
   border-color: var(--primary);
   background: white;
}

.cat-item-icon {
   width: 38px;
   height: 38px;
   border-radius: var(--radius-sm);
   background: linear-gradient(135deg, var(--primary), var(--primary-light));
   color: white;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 16px;
   margin-right: 12px;
   flex-shrink: 0;
}

.cat-item-info {
   flex: 1;
}

.cat-item-name {
   font-size: 14px;
   font-weight: 800;
   color: #1e293b;
}

.cat-item-meta {
   font-size: 12px;
   color: #64748b;
}

.cat-item-price {
   font-size: 15px;
   font-weight: 900;
   color: var(--success);
   margin-right: 12px;
}

.cat-type-badge {
   padding: 3px 8px;
   border-radius: 20px;
   font-size: 10px;
   font-weight: 800;
}

.cat-type-badge.Service {
   background: #ede9fe;
   color: #6b21a8;
}

.cat-type-badge.Product {
   background: #dcfce7;
   color: #166534;
}

.cat-type-badge.Consulting {
   background: #e0f2fe;
   color: #0369a1;
}

.cat-type-badge.Maintenance {
   background: #fef3c7;
   color: #92400e;
}

.cat-page-wrap {
   max-width: 960px;
   margin: 0 auto;
   padding: 0 10px 40px;
}

/* ============================================================
   REVENUE TRACKER
   ============================================================ */
.rt-page {
   max-width: 1200px;
}

.rt-banner {
   display: flex;
   justify-content: space-between;
   align-items: center;
   background: linear-gradient(135deg, #1e3c72, #2a5298, var(--primary));
   color: white;
   border-radius: var(--radius-lg);
   padding: 22px 28px;
   margin-bottom: 20px;
}

.rt-banner-title {
   font-size: 20px;
   font-weight: 900;
}

.rt-banner-sub {
   font-size: 13px;
   opacity: .75;
   margin-top: 2px;
}

.rt-year-selector {
   display: flex;
   align-items: center;
   gap: 8px;
   font-size: 13px;
   font-weight: 700;
}

.rt-year-selector label {
   opacity: .8;
}

.rt-year-selector select {
   padding: 6px 10px;
   border: none;
   border-radius: var(--radius-sm);
   font-size: 13px;
   font-weight: 700;
}

.rt-kpi-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
   gap: 14px;
   margin-bottom: 20px;
}

.rt-kpi {
   background: white;
   border-radius: var(--radius-md);
   padding: 16px;
   text-align: center;
   box-shadow: var(--shadow-sm);
   border-top: 3px solid var(--primary);
}

.rt-kpi-icon {
   font-size: 22px;
   margin-bottom: 6px;
}

.rt-kpi-val {
   font-size: 18px;
   font-weight: 900;
   color: var(--primary);
   margin-bottom: 2px;
}

.rt-kpi-lbl {
   font-size: 11px;
   font-weight: 700;
   color: #64748b;
   text-transform: uppercase;
}

.rt-kpi-change {
   font-size: 11px;
   margin-top: 4px;
   font-weight: 600;
}

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

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

.rt-charts-grid {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 20px;
   margin-bottom: 20px;
}

.rt-chart-card {
   background: white;
   border-radius: var(--radius-md);
   padding: 20px;
   box-shadow: var(--shadow-sm);
}

.rt-chart-card h4 {
   font-size: 14px;
   font-weight: 800;
   margin-bottom: 14px;
   display: flex;
   align-items: center;
   gap: 8px;
}

.rt-bar-chart {
   display: flex;
   align-items: flex-end;
   gap: 8px;
   height: 140px;
   padding: 0 4px;
}

.rt-bar-wrap {
   flex: 1;
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 4px;
}

.rt-bar {
   width: 100%;
   border-radius: 4px 4px 0 0;
   background: linear-gradient(180deg, var(--primary-light), var(--primary));
   min-height: 4px;
   transition: height .5s ease;
}

.rt-bar-lbl {
   font-size: 9px;
   color: #94a3b8;
   font-weight: 700;
}

.rt-bar-val {
   font-size: 9px;
   color: var(--primary);
   font-weight: 800;
}

.rt-donut-wrap {
   display: flex;
   align-items: center;
   gap: 20px;
}

.rt-donut {
   flex-shrink: 0;
}

.rt-legend {
   font-size: 12px;
   display: flex;
   flex-direction: column;
   gap: 6px;
}

.rt-legend-item {
   display: flex;
   align-items: center;
   gap: 8px;
}

.rt-legend-dot {
   width: 12px;
   height: 12px;
   border-radius: 50%;
   flex-shrink: 0;
}

.rt-month-grid {
   display: grid;
   grid-template-columns: repeat(6, 1fr);
   gap: 10px;
}

.rt-month-cell {
   background: #f8fafc;
   border-radius: var(--radius-sm);
   padding: 10px;
   text-align: center;
   border: 1.5px solid #e5e7eb;
   cursor: pointer;
   transition: var(--transition);
}

.rt-month-cell:hover {
   border-color: var(--primary);
   background: #ede9fe;
}

.rt-month-cell.active {
   border-color: var(--primary);
   background: linear-gradient(135deg, var(--primary), var(--primary-light));
   color: white;
}

.rt-month-name {
   font-size: 11px;
   font-weight: 800;
   text-transform: uppercase;
   margin-bottom: 3px;
}

.rt-month-val {
   font-size: 13px;
   font-weight: 900;
}

.rt-month-count {
   font-size: 10px;
   opacity: .7;
}

.rt-toolbar {
   display: flex;
   justify-content: space-between;
   align-items: center;
   gap: 12px;
   margin-bottom: 16px;
   flex-wrap: wrap;
}

.rt-toolbar-left {
   display: flex;
   gap: 8px;
   flex-wrap: wrap;
}

.rt-toolbar-right {
   display: flex;
   gap: 8px;
   flex-wrap: wrap;
}

.rt-search {
   padding: 8px 12px;
   border: 2px solid #e5e7eb;
   border-radius: var(--radius-sm);
   font-size: 13px;
   font-family: var(--font-body);
   min-width: 200px;
}

.rt-filter-select {
   padding: 8px 12px;
   border: 2px solid #e5e7eb;
   border-radius: var(--radius-sm);
   font-size: 13px;
   font-family: var(--font-body);
}

.rt-table-wrap {
   background: white;
   border-radius: var(--radius-md);
   box-shadow: var(--shadow-sm);
   overflow: hidden;
}

.rt-table-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 16px 20px;
   background: #f8fafc;
   border-bottom: 1.5px solid #e5e7eb;
}

.rt-table-header h3 {
   font-size: 14px;
   font-weight: 800;
   color: #1e293b;
}

.rt-table-scroll {
   overflow-x: auto;
}

.rt-excel {
   width: 100%;
   border-collapse: collapse;
   font-size: 12px;
}

.rt-excel th {
   background: #1e293b;
   color: white;
   padding: 10px 12px;
   text-align: left;
   font-size: 11px;
   font-weight: 800;
   text-transform: uppercase;
   white-space: nowrap;
   cursor: pointer;
}

.rt-excel th:hover {
   background: #334155;
}

.rt-excel td {
   padding: 9px 12px;
   border-bottom: 1px solid #f1f5f9;
   vertical-align: middle;
}

.rt-excel tr:hover td {
   background: #f8f9ff;
}

.rt-excel tr.grand-row td {
   background: linear-gradient(135deg, #f0f4ff, #ede9fe);
   font-weight: 900;
}

.sort-icon {
   font-size: 10px;
   opacity: .5;
}

.rt-status-pill {
   padding: 3px 8px;
   border-radius: 20px;
   font-size: 10px;
   font-weight: 800;
   display: inline-block;
}

.rt-status-pill.paid {
   background: #dcfce7;
   color: #166534;
}

.rt-status-pill.pending {
   background: #fef3c7;
   color: #92400e;
}

.rt-status-pill.overdue {
   background: #fee2e2;
   color: #991b1b;
}

.rt-status-pill.partial {
   background: #e0f2fe;
   color: #0369a1;
}

.rt-status-pill.cancelled {
   background: #f1f5f9;
   color: #475569;
}

/* ============================================================
   EXPENSES
   ============================================================ */
.exp-stats-grid {
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   gap: 14px;
   margin-bottom: 20px;
}

.exp-stat-card {
   background: white;
   border-radius: var(--radius-md);
   padding: 16px;
   text-align: center;
   box-shadow: var(--shadow-sm);
}

.exp-cat-badge {
   padding: 3px 8px;
   border-radius: 20px;
   font-size: 10px;
   font-weight: 800;
   background: #fee2e2;
   color: #991b1b;
}

.expense-row {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 12px;
   background: #f9fafb;
   border-radius: 8px;
   margin-bottom: 8px;
   border: 1.5px solid #e5e7eb;
   transition: var(--transition);
}

.expense-row:hover {
   border-color: var(--danger);
   background: white;
}

/* PO document preview */
.po-doc {
   padding: 32px;
   font-family: var(--font-body);
   background: white;
   color: #1e293b;
}

.po-doc-header {
   display: flex;
   justify-content: space-between;
   align-items: flex-start;
   margin-bottom: 28px;
   padding-bottom: 16px;
   border-bottom: 3px solid var(--success);
}

.po-doc-title {
   font-size: 38px;
   font-weight: 900;
   color: #065f46;
}

.po-doc-badge {
   background: linear-gradient(135deg, #065f46, #10b981);
   color: white;
   padding: 5px 14px;
   border-radius: 7px;
   font-size: 13px;
   font-weight: 800;
   display: inline-block;
   margin-top: 8px;
}

.po-doc-meta {
   background: #f0fdf4;
   border: 1.5px solid #bbf7d0;
   border-radius: 8px;
   padding: 10px 14px;
   font-size: 12px;
   text-align: right;
}

.po-doc-parties {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 20px;
   margin-bottom: 24px;
   padding: 16px;
   border: 1.5px solid #e5e7eb;
   border-radius: 10px;
}

.po-doc-party {
   padding-left: 10px;
   border-left: 4px solid var(--success);
}

.po-doc-party h4 {
   font-size: 10px;
   font-weight: 800;
   text-transform: uppercase;
   color: var(--success);
   margin-bottom: 8px;
}

.po-doc-table {
   width: 100%;
   border-collapse: collapse;
   margin-bottom: 20px;
}

.po-doc-table thead {
   background: #065f46;
}

.po-doc-table th {
   padding: 10px 12px;
   color: white;
   text-align: left;
   font-size: 11px;
   font-weight: 800;
   text-transform: uppercase;
}

.po-doc-table td {
   padding: 9px 12px;
   font-size: 12px;
   border-bottom: 1px solid #e5e7eb;
}

.po-doc-table tr:nth-child(even) td {
   background: #f0fdf4;
}

.po-doc-totals {
   display: flex;
   justify-content: flex-end;
   margin-bottom: 24px;
}

.po-doc-totals-inner {
   width: 280px;
}

.po-doc-total-row {
   display: flex;
   justify-content: space-between;
   padding: 8px 12px;
   border-bottom: 1px solid #e5e7eb;
   font-size: 13px;
}

.po-doc-total-row.grand-total {
   background: #065f46;
   color: white;
   font-weight: 900;
   font-size: 15px;
   border-radius: 8px;
   border: none;
   padding: 12px 14px;
}

.po-doc-terms {
   background: #f0fdf4;
   border: 1.5px solid #86efac;
   border-radius: 10px;
   padding: 16px;
   margin-bottom: 20px;
   font-size: 12px;
}

.po-doc-approval {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 20px;
   margin-bottom: 20px;
}

.po-doc-sig-box {
   border-top: 2px solid #1e293b;
   padding-top: 8px;
   text-align: center;
   font-size: 11px;
   color: #64748b;
}

.po-doc-footer {
   text-align: center;
   padding-top: 16px;
   border-top: 1px solid #e5e7eb;
   color: #94a3b8;
   font-size: 10px;
}

/* ============================================================
   ADMIN
   ============================================================ */
.admin-hero {
   background: linear-gradient(135deg, #991b1b, #dc2626, #ef4444);
   border-radius: var(--radius-lg);
   padding: 24px 28px;
   color: white;
   margin-bottom: 24px;
}

.admin-hero h2 {
   font-size: 22px;
   font-weight: 900;
   margin-bottom: 4px;
}

.admin-hero p {
   opacity: .8;
   font-size: 13px;
}

.admin-grid {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 20px;
   margin-bottom: 24px;
}

.admin-card {
   background: white;
   border-radius: var(--radius-md);
   padding: 20px;
   box-shadow: var(--shadow-sm);
   border: 1.5px solid #fee2e2;
}

.admin-card h3 {
   font-size: 14px;
   font-weight: 800;
   color: var(--danger);
   margin-bottom: 14px;
   text-transform: uppercase;
   letter-spacing: .5px;
}

.billing-kpi-grid {
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   gap: 12px;
   margin-bottom: 20px;
}

.billing-kpi-card {
   background: linear-gradient(135deg, var(--primary), var(--primary-light));
   color: white;
   padding: 16px;
   border-radius: var(--radius-md);
   text-align: center;
}

.billing-kpi-card.success {
   background: linear-gradient(135deg, var(--success), #059669);
}

.billing-kpi-card.warning {
   background: linear-gradient(135deg, var(--warning), #d97706);
}

.billing-kpi-val {
   font-size: 22px;
   font-weight: 900;
   margin-bottom: 3px;
}

.billing-kpi-lbl {
   font-size: 10px;
   font-weight: 700;
   text-transform: uppercase;
   opacity: .9;
}