/**
 * NaviPos Online - CRM Style Design System
 * Exact clone of the CRM interface
 */

/* ===========================
   RESET & BASE
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ===========================
   ENHANCED DATA TABLE COMPONENT
   =========================== */
.filters-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-item label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.filters-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-primary);
}

.table-info {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
}

.pagination-info span {
    font-size: 0.875rem;
    color: #000000;
    font-weight: 500;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    color: #000000;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.pagination-btn.active {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-color: var(--btn-primary-bg);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0.5rem 0.75rem;
    color: #000000;
    font-size: 0.875rem;
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-jump .form-input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    font-size: 0.875rem;
    text-align: center;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Enhanced Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    transition: all 0.2s ease;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.stat-icon-wrapper.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon-wrapper.primary {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-icon-wrapper.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-icon-wrapper.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-icon-wrapper.info {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
}

.stat-change.positive {
    color: #22c55e;
}

.stat-change.negative {
    color: #ef4444;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge.status-paid {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-badge.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-badge.status-voided {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.action-buttons .btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 2.5rem;
    height: 2.5rem;
}

.action-buttons .btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-color: var(--btn-primary-bg);
}

.action-buttons .btn-primary:hover {
    background: var(--btn-primary-hover);
    border-color: var(--btn-primary-hover);
}

.action-buttons .btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border-color: var(--btn-secondary-bg);
}

.action-buttons .btn-secondary:hover {
    background: var(--btn-secondary-hover);
    border-color: var(--btn-secondary-hover);
}

/* Enhanced Active Filters */
.active-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--status-info-bg);
    color: var(--status-info-text);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--brand-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }

    .pagination-wrapper {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

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

    .table-info {
        font-size: 0.75rem;
    }

    .pagination-btn {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .filters-actions {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===========================
   SIDEBAR - EXACT CRM STYLE
   =========================== */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

/* User Profile in Sidebar */
.sidebar-user {
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--sidebar-border);
    background: var(--sidebar-section-bg);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
}

.sidebar-user-info h3 {
    color: var(--sidebar-section-text);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.sidebar-user-info p {
    color: var(--sidebar-text-secondary);
    font-size: 0.75rem;
}

.sidebar-user-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--sidebar-text-secondary);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    text-decoration: none;
    margin-left: auto;
}

.sidebar-user-logout:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Company Info Header */
.sidebar-company-header {
    padding: 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
    text-align: center;
}

/* Company Logo */
.company-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.75rem;
    min-height: 60px;
}

.company-logo img {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

.company-logo-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.75rem;
    margin: 0 auto 0.75rem;
}

.sidebar-company-header .company-name {
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    white-space: normal;
    word-wrap: break-word;
}

.sidebar-company-header .company-address,
.sidebar-company-header .company-phone,
.sidebar-company-header .company-email,
.sidebar-company-header .company-business-type {
    color: var(--sidebar-text-secondary);
    font-size: 0.75rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-company-header .company-business-type {
    margin-top: 8px;
    padding: 4px 8px;
    background: var(--sidebar-hover);
    border-radius: 4px;
    font-weight: 500;
    color: var(--sidebar-text);
    display: inline-flex;
}

.sidebar-company-header .company-business-type i {
    color: var(--primary-color);
}

.sidebar-company-header i {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Navigation Menu */
.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    margin: 0.25rem 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* ===========================
   TOP NAVBAR - DARK STYLE
   =========================== */
.main-content {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-navbar {
    background: #1f2937;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-search {
    flex: 1;
    max-width: 500px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
}

.search-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input-wrapper input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

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

.navbar-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    font-weight: 600;
}

/* ===========================
   CONTENT AREA
   =========================== */
.page-container {
    flex: 1;
    padding: 2rem;
}

/* Page Header */
.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #000000 !important;
    font-weight: 500;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #0891b2;
}

.page-breadcrumb a {
    color: #0891b2;
    text-decoration: none;
}

.page-breadcrumb a:hover {
    text-decoration: underline;
}

.page-breadcrumb i {
    font-size: 0.75rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.stat-highlight {
    color: #ef4444;
}

/* Action Bar */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #1f2937;
    color: white;
}

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

.btn-secondary {
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-icon {
    padding: 0.625rem;
    width: 36px;
    height: 36px;
}

/* Content Card */
.content-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #000000;
}

.card-body {
    padding: 1.5rem;
}

.card-header-responsive {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

.card-controls-top {
    width: 100%;
}

.card-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.card-controls select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

.filter-button {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-button:hover {
    background: #f9fafb;
}

/* Table Responsive Wrapper */
.table-responsive-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border: 1px solid var(--border-primary);
    border-radius: 0 0 0.5rem 0.5rem;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.data-table thead {
    background: var(--table-header-bg);
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--table-header-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--table-border);
    white-space: nowrap;
}

.data-table th:first-child {
    width: auto;
}

.data-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: var(--table-text);
    border-bottom: 1px solid var(--table-border);
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.data-table td small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
}

.data-table tbody tr {
    transition: background-color 0.15s;
}

.data-table tbody tr:hover {
    background: var(--table-row-hover);
}

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

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: #3b82f6;
}

input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

/* Search Bar */
.search-bar {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-bar input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

.search-bar input:focus {
    outline: none;
    border-color: #0891b2;
}

/* ===========================
   ALERTS
   =========================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.alert i {
    font-size: 1.25rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

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

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

@media (max-width: 768px) {
    .page-container {
        padding: 1rem;
    }

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

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .navbar-search {
        max-width: 100%;
    }
}

/* ===========================
   DASHBOARD - CRM STYLE
   =========================== */

/* Top Stats Row with Progress Bars */
.dashboard-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1rem;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.stat-icon-wrapper.success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.stat-icon-wrapper.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.stat-icon-wrapper.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.stat-content {
    flex: 1;
}

.stat-title {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-count {
    margin-bottom: 0.75rem;
}

.count-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.count-total {
    font-size: 1.25rem;
    color: #6b7280;
    font-weight: 400;
}

.stat-progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

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

.progress-bar.danger {
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
}

.progress-bar.success {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.progress-bar.warning {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.progress-bar.primary {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

/* Overview Cards Row */
.dashboard-overview-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.overview-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.overview-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.overview-header i {
    font-size: 1.25rem;
    color: #0891b2;
}

.overview-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.overview-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.overview-stat-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.stat-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-count-small {
    font-size: 1.125rem;
    font-weight: 700;
    min-width: 40px;
}

.stat-count-small.success {
    color: #10b981;
}

.stat-count-small.danger {
    color: #dc2626;
}

.stat-count-small.warning {
    color: #f59e0b;
}

.stat-count-small.primary {
    color: #3b82f6;
}

.stat-count-small.secondary {
    color: #6b7280;
}

.stat-label-small {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.stat-percentage {
    font-size: 0.875rem;
    color: #9ca3af;
    font-weight: 500;
}

.stat-progress-small {
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    min-width: 120px;
}

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

.progress-bar-small.success {
    background: #10b981;
}

.progress-bar-small.danger {
    background: #dc2626;
}

.progress-bar-small.warning {
    background: #f59e0b;
}

.progress-bar-small.primary {
    background: #3b82f6;
}

.progress-bar-small.secondary {
    background: #6b7280;
}

/* Alert Items */
.alert-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 4px solid #f59e0b;
}

.alert-item i {
    font-size: 1.25rem;
    color: #f59e0b;
}

.alert-content {
    flex: 1;
}

.alert-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #1f2937;
}

.alert-content p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

/* Dashboard Main Content with Sidebar */
.dashboard-main-row {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-main-content {
    min-width: 0;
}

.dashboard-sidebar {
    position: relative;
}

/* To-Do List Styling */
.todo-list {
    max-height: 500px;
    overflow-y: auto;
}

.todo-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.todo-item:hover {
    background: #f9fafb;
}

.todo-checkbox {
    flex-shrink: 0;
    width: 20px;
    padding-top: 0.25rem;
}

.todo-checkbox i {
    font-size: 1.125rem;
    color: #9ca3af;
    cursor: pointer;
}

.todo-checkbox i:hover {
    color: #10b981;
}

.todo-content {
    flex: 1;
    min-width: 0;
}

.todo-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #1f2937;
    font-size: 0.9375rem;
}

.todo-content p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.todo-content small {
    font-size: 0.8125rem;
}

.todo-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: #1f2937;
}

.latest-todo-badge {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.latest-todo-badge i {
    font-size: 1rem;
}

/* Chart Section */
.dashboard-chart-section {
    margin-bottom: 2rem;
}

.dashboard-chart-section .card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Clickable Overview Cards */
.overview-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.overview-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.overview-card-link:hover .overview-card {
    border-color: #0891b2;
}

/* Clickable Stat Cards */
.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card-link:hover .dashboard-stat-card {
    border-color: #0891b2;
}

.dashboard-stat-card {
    transition: border-color 0.2s, transform 0.2s;
}

.overview-arrow {
    font-size: 0.875rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.overview-card-link:hover .overview-arrow {
    opacity: 1;
    transform: translateX(2px);
}

.overview-card {
    transition: border-color 0.2s;
}

/* Filter Styles */
.active-filters {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.filter-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.filter-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.page-actions {
    display: flex;
    align-items: center;
}

/* Widget Styles */
.widget-container {
    padding: 1rem;
}

.widget-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.widget-stat {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.widget-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.widget-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.widget-stat-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.widget-content {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.widget-empty {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

.widget-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.widget-filters {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.widget-filter-info {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Payment Methods Widget */
.payment-methods-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.payment-method-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.payment-method-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.payment-method-name {
    font-weight: 500;
    color: var(--text-primary);
}

.payment-method-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.payment-method-amount {
    font-weight: 600;
    color: #22c55e;
}

.payment-method-bar {
    width: 100%;
    height: 4px;
    background: var(--border-primary);
    border-radius: 2px;
    margin-top: 0.5rem;
}

.payment-method-progress {
    height: 100%;
    background: var(--brand-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Server Performance Widget */
.server-performance-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.server-performance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.server-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.server-name {
    font-weight: 500;
    color: var(--text-primary);
}

.server-orders {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.server-amount {
    font-weight: 600;
    color: #22c55e;
}

.server-bar {
    width: 100%;
    height: 4px;
    background: var(--border-primary);
    border-radius: 2px;
    margin-top: 0.5rem;
}

.server-progress {
    height: 100%;
    background: #22c55e;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Per Page Control */
.per-page-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.per-page-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.per-page-control .per-page-select {
    min-width: 60px;
    padding: 0.375rem 0.5rem !important;
    font-size: 0.875rem !important;
    border: 1px solid var(--form-border) !important;
    border-radius: 6px !important;
    background: var(--form-bg) !important;
    color: var(--form-text) !important;
    cursor: pointer !important;
    height: auto !important;
    line-height: 1.5 !important;
}

.per-page-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Dashboard Activity Row */
.dashboard-activity-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.activity-card .card {
    height: 100%;
}

/* Activity List */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

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

.activity-item:hover {
    background: #f9fafb;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.activity-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s;
}

.activity-title a:hover {
    color: #0891b2;
}

.activity-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.activity-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.activity-amount {
    font-size: 1.125rem;
    color: #10b981;
    flex-shrink: 0;
}

/* Top Items List */
.top-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: #f9fafb;
    border-radius: 10px;
    transition: all 0.2s;
}

.top-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.top-item-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.top-item-content {
    flex: 1;
    min-width: 0;
}

.top-item-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.top-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.top-item-revenue {
    font-weight: 700;
    color: #10b981;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9375rem;
    margin: 0;
}

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

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

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

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

@media (max-width: 768px) {
    .dashboard-stats-row {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   ADMIN DASHBOARD - CRM STYLE
   =========================== */

/* Admin Charts Row */
.dashboard-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card-large .card,
.chart-card-small .card {
    height: 100%;
}

/* Admin Recent Organizations */
.admin-recent-section {
    margin-bottom: 2rem;
}

.admin-org-list {
    max-height: 500px;
    overflow-y: auto;
}

.admin-org-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

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

.admin-org-item:hover {
    background: #f9fafb;
}

.org-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.org-content {
    flex: 1;
    min-width: 0;
}

.org-title {
    margin-bottom: 0.25rem;
}

.org-title a {
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s;
}

.org-title a:hover {
    color: #0891b2;
}

.org-title small {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 0.125rem;
}

.org-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.org-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.org-meta i {
    font-size: 0.8125rem;
}

.org-info {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    align-items: flex-end;
}

.org-date {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.org-actions {
    display: flex;
    gap: 0.5rem;
}

/* ===========================
   UTILITY CLASSES FOR TEXT
   =========================== */
.text-muted {
    color: #000000 !important;
}

.text-secondary {
    color: #4b5563 !important;
}

.text-primary {
    color: #000000 !important;
}

.text-light {
    color: #6b7280 !important;
}

/* Responsive Admin Dashboard */
@media (max-width: 1200px) {
    .dashboard-charts-row {
        grid-template-columns: 1fr;
    }

    .admin-org-item {
        flex-wrap: wrap;
    }

    .org-info,
    .org-date,
    .org-actions {
        flex: 0 0 auto;
    }
}

@media (max-width: 768px) {
    .admin-org-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .org-info {
        align-items: flex-start;
    }
}