/* ============================================
   SUPER POWER - Solar Inverter Repairing Lab
   Exact Color Scheme from Design
============================================ */

:root {
    --primary: #1a56db;
    --primary-dark: #1e3a8a;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #1a56db;
    --card-blue: #3b82f6;
    --card-green: #22c55e;
    --card-orange: #f97316;
    --card-purple: #a855f7;
    --card-red: #ef4444;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --info: #0ea5e9;
    --bg-light: #f1f5f9;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
}

.job-details-card { border: 1px solid #dbe3ef; box-shadow: 0 5px 16px rgba(15,23,42,.06); }
.job-details-card .card-header { background: linear-gradient(90deg, #f8fbff, #ffffff); }
.job-details-card .card-header h2 { font-size: 20px; letter-spacing: .2px; color: #0f3d8f; }
.job-details-body strong { color: #163b73; font-weight: 700; }
.job-details-body div { margin-bottom: 2px; }
@media (max-width: 600px) { .job-details-body { font-size: 15px !important; padding: 16px !important; } }

/* ========== LOGIN PAGE ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(15,23,42,0.7), rgba(30,58,138,0.6)),
                url('https://images.unsplash.com/photo-1509391366360-2e959784a276?w=1600') center/cover no-repeat;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    text-align: center;
}

.login-logo {
    margin-bottom: 12px;
    background: #061a3a;
    border-radius: 12px;
    padding: 8px;
}

.login-brand-image {
    display: block;
    width: 360px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.login-logo .sp-logo {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -2px;
}

.login-logo .sp-logo .s { color: #1a56db; }
.login-logo .sp-logo .p { color: #ef4444; }

.login-logo h2 {
    font-size: 18px;
    color: var(--text-dark);
    margin-top: 4px;
    font-weight: 700;
}

.login-logo p {
    font-size: 13px;
    color: var(--text-muted);
}

.login-card h3 {
    margin: 12px 0 6px;
    font-size: 22px;
    color: var(--text-dark);
}

.login-card .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: #f8fafc;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0 24px;
    font-size: 13px;
}

.form-row a {
    color: var(--primary);
    text-decoration: none;
}

.form-row a:hover {
    text-decoration: underline;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

.btn-secondary {
    background: #64748b;
    color: white;
}

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

.login-footer {
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== LAYOUT ========== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo {
    padding: 20px;
    background: #061a3a;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .sp-mini {
    font-size: 28px;
    font-weight: 900;
}

.sidebar-logo .sp-mini .s { color: #3b82f6; }
.sidebar-logo .sp-mini .p { color: #ef4444; }

.sidebar-logo .site-logo-image { width: 190px; height: 92px; object-fit: contain; border-radius: 10px; background: #061a3a; padding: 2px; }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: white;
}

.nav-item i, .nav-item .icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: var(--white);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-search {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 8px 14px;
    width: 320px;
}

.topbar-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 100%;
    margin-left: 8px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.page-content {
    padding: 28px;
    flex: 1;
}

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

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.page-header h1 span {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
}

/* ========== DASHBOARD CARDS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

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

.stat-icon.blue { background: var(--card-blue); }
.stat-icon.green { background: var(--card-green); }
.stat-icon.orange { background: var(--card-orange); }
.stat-icon.purple { background: var(--card-purple); }

.stat-info h3 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ========== TABLES ========== */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 0;
}

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

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

table th, table td {
    padding: 14px 20px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

table tr:hover {
    background: #f8fafc;
}

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

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-completed {
    background: #dcfce7;
    color: #166534;
}

.badge-progress {
    background: #dbeafe;
    color: #1e40af;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 6px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-edit {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-edit:hover {
    background: #bfdbfe;
}

.btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-delete:hover {
    background: #fecaca;
}

/* ========== FORMS ========== */
.form-card {
    background: var(--white);
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--shadow);
    max-width: 700px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

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

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

.search-bar {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 20px;
    max-width: 400px;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    margin-left: 8px;
    font-size: 14px;
}

/* ========== REPORTS ========== */
.report-filters {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.report-filters .form-group {
    margin-bottom: 0;
}

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

.report-stat {
    background: var(--white);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    box-shadow: var(--shadow);
}

.report-stat h3 {
    font-size: 22px;
    font-weight: 700;
}

.report-stat p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.report-stat.blue h3 { color: var(--card-blue); }
.report-stat.green h3 { color: var(--card-green); }
.report-stat.orange h3 { color: var(--card-orange); }
.report-stat.purple h3 { color: var(--card-purple); }

/* ========== SETTINGS ========== */
.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.settings-tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.settings-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ========== RECEIPT ========== */
.receipt-page {
    background: #e2e8f0;
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

.receipt-box {
    background: white;
    width: 100%;
    max-width: 480px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
}

.receipt-toolbar {
    background: #1e293b;
    padding: 12px 16px;
    display: flex;
    gap: 10px;
}

.receipt-body {
    padding: 32px 28px;
}

.receipt-logo {
    text-align: center;
    margin-bottom: 20px;
}

.receipt-logo .sp-logo {
    font-size: 36px;
    font-weight: 900;
}

.receipt-logo .sp-logo .s { color: #1a56db; }
.receipt-logo .sp-logo .p { color: #ef4444; }

.receipt-logo h3 {
    font-size: 14px;
    margin-top: 4px;
}

.receipt-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin: 16px 0 24px;
    border-bottom: 2px dashed #cbd5e1;
    padding-bottom: 12px;
}

.receipt-info {
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.receipt-info strong {
    display: inline-block;
    width: 120px;
}

.receipt-table {
    width: 100%;
    margin: 16px 0;
    font-size: 13px;
}

.receipt-table th {
    background: #f1f5f9;
    padding: 10px;
    text-align: left;
}

.receipt-table td {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.receipt-total {
    text-align: right;
    font-size: 14px;
    margin-top: 12px;
}

.receipt-total .grand {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 6px;
}

.receipt-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 2px dashed #cbd5e1;
    padding-top: 16px;
}

/* ========== FINAL INTERFACE (Home) ========== */
.home-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    border-radius: 16px;
    padding: 40px;
    color: white;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.home-hero-content h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.home-hero-content p {
    font-size: 15px;
    opacity: 0.85;
}

.home-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.home-action-card {
    background: var(--white);
    border-radius: 14px;
    padding: 28px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.25s;
}

.home-action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0,0,0,0.15);
}

.home-action-card .icon-box {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 28px;
    color: white;
}

.home-action-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.home-action-card p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-btns {
    display: flex;
    gap: 6px;
}

.pagination-btns button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.pagination-btns button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Utilities */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.w-100 { width: 100%; }

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid, .report-stats, .home-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid, .report-stats, .home-actions, .form-grid {
        grid-template-columns: 1fr;
    }
}
/* ========== TOAST ========== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 22px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
    max-width: 360px;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast-success { background: #16a34a; }
.toast-error   { background: #dc2626; }
.toast-warning { background: #f59e0b; }
.toast-info    { background: #0ea5e9; }

/* Role badge */
.role-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #475569;
}

/* ========== CHAPTER 02 - Mobile & Role Polish ========== */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    margin-left: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    background: #1e293b;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-user-info strong {
    font-size: 13px;
    color: white;
}

.nav-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    padding: 16px 14px 6px;
    font-weight: 600;
}

.nav-logout {
    margin-top: 20px !important;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 16px !important;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text-dark);
}

.topbar-role {
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    margin-right: 8px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        z-index: 100;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .topbar {
        gap: 12px;
    }
    
    .topbar-search {
        flex: 1;
        width: auto;
        max-width: none;
    }
    
    .topbar-user span:last-child {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .page-content {
        padding: 16px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

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