/* BikePharma Inventory - Professional Dark Theme */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #050505;
    color: #e5e7eb;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #050505 0%, #0a0a0a 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.login-card {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.brand-title {
    font-size: 32px;
    font-weight: 700;
    color: #facc15;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.brand-subtitle {
    font-size: 14px;
    color: #9ca3af;
    letter-spacing: 3px;
}

.error-message {
    background: #dc2626;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

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

.login-form input {
    width: 100%;
    padding: 12px 16px;
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 15px;
    transition: all 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: #facc15;
    background: #101010;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
    letter-spacing: 1px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(250, 204, 21, 0.3);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: #101010;
    border-right: 1px solid #1a1a1a;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #1a1a1a;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #facc15;
    letter-spacing: 1px;
}

.logo-subtitle {
    font-size: 11px;
    color: #6b7280;
    letter-spacing: 2px;
    padding-left: 40px;
}

.user-info {
    padding: 20px;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

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

.user-role {
    font-size: 12px;
    color: #6b7280;
}

.sidebar-nav {
    padding: 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #141414;
    color: #facc15;
}

.nav-item.active {
    background: #facc15;
    color: #000;
    border-left-color: #f59e0b;
    font-weight: 600;
}

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

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
    max-width: 1400px;
}

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

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #facc15;
}

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

.stat-card {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(250, 204, 21, 0.1);
}

.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(250, 204, 21, 0.1);
    border-radius: 10px;
}

.stat-label {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #facc15;
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 24px;
}

.chart-card h3 {
    font-size: 16px;
    color: #e5e7eb;
    margin-bottom: 20px;
}

/* Tables */
.table-card {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

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

.table-header h3 {
    font-size: 18px;
    color: #e5e7eb;
}

.table-responsive {
    overflow-x: auto;
}

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

.data-table thead tr {
    background: #0a0a0a;
    border-bottom: 2px solid #262626;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #1a1a1a;
    font-size: 14px;
    color: #e5e7eb;
}

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

.data-table tbody tr:hover {
    background: #0a0a0a;
}

/* Inventory Table */
.inventory-table {
    font-size: 12px;
}

.inventory-table th,
.inventory-table td {
    padding: 10px 8px;
}

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

.status-paid {
    background: #10b981;
    color: #000;
}

.status-pending {
    background: #f59e0b;
    color: #000;
}

.status-cancelled {
    background: #dc2626;
    color: #fff;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-warning, .btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(250, 204, 21, 0.3);
}

.btn-secondary {
    background: #262626;
    color: #e5e7eb;
}

.btn-secondary:hover {
    background: #404040;
}

.btn-warning {
    background: #f59e0b;
    color: #000;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

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

.btn-large {
    padding: 14px 32px;
    font-size: 15px;
}

/* Forms */
.form-card {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 32px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #facc15;
    background: #101010;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* Search Bar */
.search-bar {
    margin-bottom: 24px;
}

.search-bar form {
    display: flex;
    gap: 12px;
}

.search-bar input {
    flex: 1;
    padding: 12px 16px;
    background: #141414;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 14px;
}

.btn-search {
    padding: 12px 24px;
    background: #facc15;
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

/* Invoice Card */
.invoice-card {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 32px;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #262626;
}

.invoice-header h2 {
    color: #facc15;
    font-size: 24px;
    margin-bottom: 8px;
}

.customer-details {
    background: #0a0a0a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.customer-details h3 {
    color: #facc15;
    margin-bottom: 12px;
    font-size: 16px;
}

.status-select {
    padding: 8px 16px;
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 14px;
}

/* Footer */
.main-footer {
    margin-left: 260px;
    padding: 24px 32px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    border-top: 1px solid #1a1a1a;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #dc2626;
    color: white;
}

.alert-success {
    background: #10b981;
    color: white;
}

/* Badge */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-danger {
    background: #dc2626;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content,
    .main-footer {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}
/* Chart Container Fix */
.chart-card canvas {
    background: transparent !important;
    width: 100% !important;
    height: 300px !important;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 24px;
    min-height: 400px;
}

.chart-card h3 {
    font-size: 16px;
    color: #e5e7eb;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Ensure main content has proper width */
.main-content {
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
    max-width: calc(100vw - 260px);
    box-sizing: border-box;
}

/* Fix stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
/* ========== UPDATED SECTIONS FOR style.css ========== */

/* Login Logo Styling */
.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo img {
    max-width: 120px;
    height: auto;
}

/* Sidebar Logo - Clean Alignment */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #1a1a1a;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text-wrap {
    display: flex;
    flex-direction: column;
}

.logo-brand {
    font-size: 20px;
    font-weight: 700;
    color: #facc15;
    letter-spacing: 0.5px;
    line-height: 1;
}

.logo-tagline {
    font-size: 9px;
    color: #6b7280;
    letter-spacing: 2px;
    margin-top: 2px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: #facc15;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background: #000;
    display: block;
    border-radius: 2px;
}

/* Scanner Card for Ongoing Invoice */
.scanner-card {
    background: #141414;
    border: 2px solid #facc15;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.scanner-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scanner-input-group label {
    font-size: 16px;
    font-weight: 600;
    color: #facc15;
}

.scanner-input-group input {
    padding: 16px;
    font-size: 18px;
    background: #0a0a0a;
    border: 2px solid #262626;
    border-radius: 8px;
    color: #e5e7eb;
}

.scanner-input-group input:focus {
    outline: none;
    border-color: #facc15;
    background: #101010;
}

/* Invoice Info Card */
.invoice-info-card {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

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

.info-grid div {
    font-size: 14px;
    color: #9ca3af;
}

.info-grid strong {
    color: #e5e7eb;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: #facc15;
    color: #000;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Payment Card */
.payment-card {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 32px;
    margin-top: 24px;
}

.payment-card h3 {
    margin-bottom: 20px;
    color: #facc15;
}

.total-display {
    background: #0a0a0a;
    padding: 20px;
    border-radius: 8px;
    margin: 24px 0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 16px;
    color: #e5e7eb;
}

.total-row.final-total {
    border-top: 2px solid #facc15;
    margin-top: 12px;
    padding-top: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #facc15;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        z-index: 999;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100vw;
    }
    
    .main-footer {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .scanner-input-group {
        flex-direction: column;
    }
    
    .scanner-input-group input {
        width: 100%;
    }
}

/* Form Select Styling */
select {
    padding: 12px 16px;
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #facc15;
    background: #101010;
}