/* Modern Inventory Dashboard Styles */
@import url('common-theme.css');

/* Dashboard Specific Variables */
:root {
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #475569;
    --topbar-height: 64px;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
}

/* Page Management */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 48px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.9;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #6b7280;
    font-size: 14px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
    background: #ffffff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px;
}

.message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* DB Status Indicator */
.db-status-container {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.db-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s;
}

.db-status.connected {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
}

.db-status.disconnected {
    background: #fee2e2;
    border: 1px solid #fca5a5;
}

.db-status.checking {
    background: #fef3c7;
    border: 1px solid #fcd34d;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.db-status.connected .status-dot {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.db-status.disconnected .status-dot {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.db-status.checking .status-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.status-text {
    flex: 1;
    font-weight: 500;
}

.db-status.connected .status-text {
    color: #047857;
}

.db-status.disconnected .status-text {
    color: #991b1b;
}

.db-status.checking .status-text {
    color: #92400e;
}

.status-ping {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.5);
}

.db-status.connected .status-ping {
    color: #047857;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
    z-index: 1000;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    font-size: 32px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-title {
    display: none;
}

.sidebar-toggle {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent;
}

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

.nav-item.active {
    background: rgba(0, 120, 215, 0.1);
    color: white;
    border-left-color: var(--sidebar-active);
}

.nav-icon {
    font-size: 20px;
    min-width: 24px;
}

.nav-text {
    white-space: nowrap;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: white;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--sidebar-text);
}

.sidebar.collapsed .user-info {
    display: none;
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed~.main-wrapper {
    margin-left: var(--sidebar-collapsed);
}

/* ===== TOP BAR ===== */
.topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 32px;
    background: var(--background);
    min-height: 100vh;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

.topbar-btn {
    position: relative;
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-btn:hover {
    background: var(--bg);
}

.badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
}

.badge.badge-hidden {
    display: none;
}

/* ===== CONTENT WRAPPER ===== */
.content-wrapper {
    max-width: 1600px;
    margin: 0 auto;
}

/* ===== PAGE SECTIONS ===== */
.page-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.page-section-header {
    margin-bottom: var(--space-lg);
}

.page-section-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.page-section-description {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ===== QUICK ACTIONS ===== */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.quick-action-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    text-align: left;
    color: inherit;
    cursor: pointer;
    width: 100%;
    font: inherit;
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-action-card:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.15);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--surface-secondary);
    color: var(--primary);
}

.quick-action-content h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.quick-action-content p {
    margin: 4px 0 0;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

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

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.primary {
    background: rgba(0, 120, 215, 0.1);
}

.stat-icon.success {
    background: rgba(0, 168, 107, 0.1);
}

.stat-icon.danger {
    background: rgba(231, 76, 60, 0.1);
}

.stat-icon.warning {
    background: rgba(243, 156, 18, 0.1);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-trend {
    margin-top: 8px;
    font-size: 13px;
    color: var(--success);
}

.stat-trend.negative {
    color: var(--danger);
}

/* ===== TABLES ===== */
.data-table-wrapper {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
}

.table-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.table-filter__select {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--surface);
    min-width: 180px;
    transition: all var(--transition-base);
}

.table-filter__select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.1);
}

.table-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.table-summary {
    font-size: 13px;
    color: var(--text-secondary);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    width: 100%;
}

.page-actions .btn {
    flex: 1 1 200px;
    justify-content: center;
}

.page-actions__search {
    margin-left: auto;
    flex: 1 1 260px;
    display: flex;
    justify-content: flex-end;
}

.page-actions__search .input-search {
    width: 100%;
    max-width: 320px;
}

@media (max-width: 640px) {
    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions .btn {
        flex: 1 1 auto;
        width: 100%;
    }

    .page-actions__search {
        margin-left: 0;
        justify-content: flex-start;
    }

    .page-actions__search .input-search {
        max-width: none;
    }
}

.input-search {
    padding: 10px 14px 10px 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    min-width: 240px;
    transition: all var(--transition-base);
    background: var(--surface);
}

.input-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg);
}

thead th {
    padding: 12px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: var(--hover-bg);
}

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

tbody td {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--text);
}

tbody td:first-child {
    font-weight: 500;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

.table-actions {
    display: flex;
    gap: 12px;
}

.user-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.user-role-badge.role-admin {
    background: rgba(0, 120, 215, 0.12);
    color: var(--primary);
}

.user-role-badge.role-manager {
    background: rgba(0, 168, 107, 0.12);
    color: var(--success);
}

.user-role-badge.role-staff {
    background: rgba(243, 156, 18, 0.12);
    color: var(--warning);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 168, 107, 0.12);
    color: var(--success);
}

.status-chip::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-chip.inactive {
    background: rgba(231, 76, 60, 0.12);
    color: var(--danger);
}

.notification-grid {
    display: grid;
    gap: 24px;
    margin-top: 24px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.notification-preferences {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.notification-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.notification-toggle h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.notification-toggle p {
    font-size: 13px;
    color: var(--text-light);
    margin: 0;
}

/* ===== REPORTS PAGE ===== */
.chart-grid {
    display: grid;
    gap: 24px;
    margin-top: 32px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.chart-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.chart-card--compact {
    min-height: 320px;
}

.chart-card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 360px;
    overflow: hidden;
    transition: all var(--transition-slow);
    box-shadow: var(--shadow-sm);
}

.chart-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-light);
}

.chart-card__header {
    padding: 20px 24px 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(to bottom, rgba(67, 97, 238, 0.02), transparent);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.chart-card__header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-card__header p {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.4;
}

.chart-card__select {
    min-width: 140px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition-base);
}

.chart-card__select:hover {
    border-color: var(--primary);
}

.chart-card__select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.chart-card__body {
    position: relative;
    flex: 1 1 auto;
    padding: 0 16px 24px;
    min-height: 280px;
    background: linear-gradient(to bottom, transparent, rgba(67, 97, 238, 0.01));
}

.chart-card--compact .chart-card__body {
    min-height: 240px;
    padding-bottom: 16px;
}

.chart-card__body canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-size: 14px;
    color: var(--text-light);
    text-align: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.chart-empty__icon {
    font-size: 48px;
    opacity: 0.4;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

.chart-empty__text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.chart-empty__hint {
    font-size: 13px;
    color: var(--text-light);
    max-width: 280px;
}

.reports-overview {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 32px;
    animation: slideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.reports-stat {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.reports-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.reports-stat:hover::before {
    transform: translateX(100%);
}

.reports-stat:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    border-color: rgba(67, 97, 238, 0.2);
}

.reports-stat__icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    animation: iconFloat 3s ease-in-out infinite;
    color: #ffffff;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }
}

.reports-stat:nth-child(1) .reports-stat__icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.reports-stat:nth-child(2) .reports-stat__icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.reports-stat:nth-child(3) .reports-stat__icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.reports-stat__content {
    flex: 1;
}

.reports-stat__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.reports-stat__value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    background: none;
}

.reports-actions {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 28px;
    margin-top: 32px;
    animation: slideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

.reports-actions h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.reports-actions h3::before {
    content: '📊';
    font-size: 20px;
}

.reports-export-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.reports-export-grid .btn {
    height: 52px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), #5a7dee);
    border: none;
}

.reports-export-grid .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.reports-export-grid .btn:hover::before {
    width: 300px;
    height: 300px;
}

.reports-export-grid .btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

.reports-export-grid .btn:active {
    transform: translateY(-1px) scale(0.98);
}

.reports-export-grid .btn span {
    position: relative;
    z-index: 1;
}

.custom-chart-card {
    overflow: visible;
}

.custom-chart-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-lg) var(--space-xl);
}

.custom-chart-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.custom-chart-controls {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.custom-chart-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.custom-chart-control select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color var(--transition-base);
}

.custom-chart-control select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.1);
}

.custom-chart-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.custom-chart-preview {
    position: relative;
    height: 360px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    background: rgba(248, 250, 252, 0.6);
}

.custom-chart-preview canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {
    .custom-chart-preview {
        height: 320px;
    }
}

.restock-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: stretch;
    flex: 1 1 auto;
}

.restock-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 160px;
    flex: 1 1 160px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.restock-card__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
}

.restock-card__value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.restock-product {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.restock-product__name {
    font-weight: 600;
    font-size: 14px;
}

.restock-product__meta {
    font-size: 12px;
    color: var(--text-light);
}

.restock-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.restock-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5f5;
    transition: 0.2s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.switch input:checked+.slider {
    background-color: var(--primary);
}

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

.notification-feed tbody tr:hover {
    background: rgba(0, 120, 215, 0.05);
}

.notification-modal {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.notification-modal__heading {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.notification-modal__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.notification-modal__stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notification-modal__stat-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.notification-modal__stat-value {
    font-size: 20px;
    font-weight: 600;
}

.notification-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-modal__list li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-modal__item-primary {
    font-weight: 600;
    font-size: 14px;
}

.notification-modal__item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
}

.notification-modal__empty {
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    color: var(--text-light);
}

.empty-state {
    padding: 32px;
    text-align: center;
    color: var(--text-light);
}

.empty-state h4 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.stock-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(0, 168, 107, 0.12);
    color: var(--success);
}

.stock-pill.low {
    background: rgba(231, 76, 60, 0.12);
    color: var(--danger);
}

.data-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-light);
    text-transform: uppercase;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* ===== BUTTONS ===== */
.btn-secondary {
    background: var(--bg);
    color: var(--text);
}

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

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

.btn-success:hover {
    background: #00915e;
}

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

.btn-danger:hover {
    background: #c0392b;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
    }

    .sidebar-title,
    .nav-text,
    .user-info {
        display: none !important;
    }

    .content-wrapper {
        padding: 16px;
    }

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

.hidden {
    display: none !important;
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1200;
    padding: 20px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    max-width: 640px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: modalSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlide {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--hover-bg);
    color: var(--text);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.modal-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.modal-details__item {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
}

.modal-details__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 6px;
}

.modal-details__value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

.modal-details__status {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 600;
}

.modal-details__status.ok {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.modal-details__status.low {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.modal-details__note {
    margin-top: 4px;
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: rgba(0, 120, 215, 0.04);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

.modal-details__note strong {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
}

.modal-details__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-light);
}

.modal-details__meta span {
    .modal-details__actions {
        margin-top: 20px;
        display: flex;
        justify-content: flex-end;
    }

    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.12);
}

.label-modal {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(260px, 1fr);
    gap: 24px;
}

.label-modal__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.label-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.label-modal__options {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
}

.checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.label-preview-panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.label-preview-title {
    font-size: 15px;
    font-weight: 600;
}

.label-preview-area {
    min-height: 220px;
    border: 1px dashed #cbd5f5;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    overflow: auto;
}

.label-preview-placeholder {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
    padding: 12px;
}

.label-preview-error {
    color: var(--danger);
    text-align: center;
    font-size: 13px;
    padding: 12px;
}

.label-preview-item {
    background: var(--surface);
    border-radius: 4px;
    border: 1px solid var(--border);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.label-preview-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.label-preview-name {
    font-weight: 600;
    font-size: 13px;
    color: #111827;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.label-preview-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.label-preview-chip {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 3px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.label-preview-code {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: #fafafa;
    border-radius: 3px;
    padding: 8px;
    min-height: 80px;
    align-self: center;
}

.label-preview-code--barcode {
    padding: 6px 10px;
}

.label-preview-code--barcode canvas {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.label-preview-code--qr {
    padding: 10px;
}

.label-preview-code--qr canvas {
    max-width: 85%;
    max-height: 85%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.label-preview-code-caption {
    font-size: 9px;
    color: #6b7280;
    margin-top: 6px;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.label-preview-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 9px;
    color: #6b7280;
    text-align: center;
    line-height: 1.4;
}

.label-preview-info span {
    font-weight: 400;
}

@media (max-width: 900px) {
    .label-modal {
        grid-template-columns: 1fr;
    }

    .label-preview-area {
        min-height: 180px;
    }
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.modal-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== TOASTS ===== */
#toastContainer {
    position: fixed;
    top: 80px;
    right: 24px;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3000;
    min-width: 300px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

#toastContainer.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.toast-success {
    background: rgba(16, 185, 129, 0.95);
}

.toast-error {
    background: rgba(239, 68, 68, 0.95);
}

.toast-info {
    background: rgba(37, 99, 235, 0.95);
}

.toast-warning {
    background: rgba(245, 158, 11, 0.95);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

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

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .topbar {
        padding: 0 20px;
    }

    .page-title {
        font-size: 18px;
    }

    .main-content {
        padding: 20px;
    }

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

    .card {
        padding: 16px;
    }

    .modal {
        max-width: 100%;
        margin: 0;
    }

    .modal-body {
        max-height: 50vh;
    }

    thead th,
    tbody td {
        padding: 12px 16px;
        font-size: 13px;
    }

    .table-actions {
        flex-direction: column;
        width: 100%;
    }

    .table-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 0;
    }

    .main-content {
        padding: 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .card-actions {
        width: 100%;
        justify-content: stretch;
    }

    .card-actions .btn {
        flex: 1;
    }

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

    #toastContainer {
        right: 16px;
        left: 16px;
        min-width: auto;
    }
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}

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

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 32px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 32px;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

.gap-3 {
    gap: 24px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.justify-between {
    justify-content: space-between;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* ===== AUDIT LOGS ===== */
.audit-log-header {
    margin-bottom: 24px;
}

.audit-log-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.audit-log-subtitle {
    color: var(--text-light);
    font-size: 14px;
}

.audit-filters {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

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

.audit-stats.audit-stats--empty .stat-card {
    opacity: 0.65;
}

.audit-stats .stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.audit-stats .stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.audit-stats .stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.audit-stats .stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.audit-stats .stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.audit-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.insight-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}

.insight-card h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text);
}

.insight-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.insight-label {
    font-weight: 600;
    color: var(--text);
}

.insight-value {
    font-size: 13px;
    color: var(--primary);
}

.insight-empty {
    color: var(--text-light);
    font-size: 13px;
}

.audit-table {
    font-size: 13px;
}

.audit-log-row:hover {
    background-color: #f8fafc;
}

.log-timestamp {
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
}

.log-time-ago {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.log-username {
    font-weight: 600;
    color: #1e40af;
}

.action-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-login {
    background: #dbeafe;
    color: #1e40af;
}

.action-logout {
    background: #fee2e2;
    color: #991b1b;
}

.action-stock_updated {
    background: #d1fae5;
    color: #065f46;
}

.action-sale_recorded {
    background: #fef3c7;
    color: #92400e;
}

.action-item_created,
.action-user_created,
.action-supplier_created {
    background: #d1fae5;
    color: #065f46;
}

.action-item_updated,
.action-user_updated,
.action-supplier_updated {
    background: #e0e7ff;
    color: #3730a3;
}

.action-item_deleted,
.action-user_deleted,
.action-supplier_deleted {
    background: #fee2e2;
    color: #991b1b;
}

.action-csv_import,
.action-csv_export {
    background: #fce7f3;
    color: #831843;
}

.action-user_activated {
    background: #d1fae5;
    color: #065f46;
}

.action-user_deactivated {
    background: #fef3c7;
    color: #92400e;
}

.resource-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.resource-user {
    background: #dbeafe;
    color: #1e40af;
}

.resource-item {
    background: #e0e7ff;
    color: #3730a3;
}

.resource-sale {
    background: #fef3c7;
    color: #92400e;
}

.resource-supplier {
    background: #fce7f3;
    color: #831843;
}

.resource-system {
    background: #f3f4f6;
    color: #374151;
}

.log-description {
    color: var(--text);
    line-height: 1.5;
}

.log-metadata {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-light);
    font-style: italic;
}

.metadata-item {
    margin-right: 8px;
}

.log-ip {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}

.pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pagination-info {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

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

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

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

    .audit-table {
        font-size: 12px;
    }

    .audit-log-header h2 {
        font-size: 22px;
    }
}

/* ===== STAFF REPORTS ===== */
.staff-reports-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.staff-reports-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.staff-reports-subtitle {
    color: var(--text-light);
    font-size: 13px;
    font-weight: 400;
}

.report-controls {
    background: #fafafa;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
    border: 1px solid #e5e7eb;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-group label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.staff-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.summary-card {
    background: #ffffff;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: box-shadow 0.2s;
}

.summary-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.summary-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 8px;
    flex-shrink: 0;
}

.summary-card:nth-child(1) .summary-icon {
    background: #dbeafe;
    color: #1e40af;
}

.summary-card:nth-child(2) .summary-icon {
    background: #dcfce7;
    color: #15803d;
}

.summary-card:nth-child(3) .summary-icon {
    background: #fef3c7;
    color: #a16207;
}

.summary-card:nth-child(4) .summary-icon {
    background: #f3e8ff;
    color: #6b21a8;
}

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

.summary-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    letter-spacing: -0.02em;
}

.summary-label {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
}

.report-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #f9fafb;
    padding: 4px;
    border-radius: 6px;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text);
    background: #ffffff;
}

.tab-btn.active {
    color: var(--primary);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-content {
    background: #ffffff;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.report-tab {
    display: none;
}

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

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.chart-container {
    background: #fafafa;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-container h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.chart-container canvas {
    max-height: 280px !important;
    height: 280px !important;
}

.chart-container.full-width canvas {
    max-height: 320px !important;
    height: 320px !important;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-success {
    background: #dcfce7;
    color: #15803d;
}

.status-warning {
    background: #fef3c7;
    color: #a16207;
}

.status-danger {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 768px) {
    .report-controls {
        grid-template-columns: 1fr;
    }

    .staff-summary-cards {
        grid-template-columns: 1fr;
    }

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

    .staff-reports-header h2 {
        font-size: 20px;
    }

    .report-tabs {
        gap: 2px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .chart-container canvas {
        max-height: 240px !important;
        height: 240px !important;
    }
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-success {
    background: #d1fae5;
    color: #065f46;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-danger {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 768px) {
    .report-controls {
        grid-template-columns: 1fr;
    }

    .staff-summary-cards {
        grid-template-columns: 1fr;
    }

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

    .staff-reports-header h2 {
        font-size: 22px;
    }

    .report-tabs {
        gap: 4px;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Active Staff Widget Styles */
.active-staff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

#activeStaffTable tbody tr td:first-child {
    min-width: 140px;
}

#activeStaffTable tbody tr td:nth-child(2),
#activeStaffTable tbody tr td:nth-child(3) {
    white-space: nowrap;
}

.status-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ============================================
   CONTAINER AND ALIGNMENT FIXES
   ============================================ */

/* Ensure all page sections have proper background */
.user-management-section,
.inventory-section,
.sales-section,
.reports-section,
.analytics-section,
.logs-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

/* Form containers */
.form-container,
.user-form-container,
.add-user-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

/* Table containers */
.table-section,
.users-table-section,
.items-table-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-top: var(--space-lg);
}

/* Ensure proper alignment for all containers */
.content-wrapper>* {
    width: 100%;
}

/* Fix form layouts */
form {
    width: 100%;
}

form .form-group {
    width: 100%;
}

/* Fix button groups alignment */
.button-group,
.btn-group,
.form-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
}

/* Ensure inputs and selects are properly aligned */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: var(--font-size-base);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.08);
}

/* Grid layouts for forms */
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.form-full-width {
    grid-column: 1 / -1;
}

/* Ensure cards stack properly on mobile */
@media (max-width: 768px) {

    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .user-management-section,
    .inventory-section,
    .sales-section,
    .reports-section {
        padding: var(--space-lg);
    }
}

@media (max-width: 1200px) {
    .active-staff-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    #activeStaffTable thead tr th:nth-child(3),
    #activeStaffTable tbody tr td:nth-child(3) {
        display: none;
    }
}


/* Active Staff Widget Styles */
.status-info {
    background: #dbeafe;
    color: #1e40af;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 4px 10px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #16a34a;
    border-radius: 50%;
    animation: pulse-live 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.live-text {
    font-size: 10px;
}

@keyframes pulse-live {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

@media (max-width: 1200px) {
    .active-staff-grid {
        grid-template-columns: 1fr;
    }
}