/* =======================================================
   Variables matching KAMWALLE Main Theme
   ======================================================= */
:root {
    --primary: #0f62fe;
    --primary-dark: #0043ce;
    --primary-light: #4589ff;
    --primary-alpha: rgba(15, 98, 254, 0.1);

    --secondary: #001d6c;
    --accent: #ff832b;

    --bg-body: #f4f4f4;
    --bg-surface: #ffffff;

    --text-main: #161616;
    --text-muted: #525252;
    --text-light: #f4f4f4;

    --border: #e0e0e0;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);

    --border-radius: 8px;
    --border-radius-lg: 16px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
}

.hidden {
    display: none !important;
}

/* =======================================================
   Buttons & Inputs
   ======================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

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

.btn-full {
    width: 100%;
    display: flex;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-sync {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    transition: all 0.3s ease;
}

.btn-sync:hover {
    background: #16a34a;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

/* =======================================================
   Login Screen
   ======================================================= */
.login-wrapper {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-body), var(--primary-alpha));
}

.login-box {
    background: var(--bg-surface);
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 450px;
    text-align: center;
    border: 1px solid var(--border);
}

.logo-circle {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 0 8px var(--primary-alpha);
}

.login-box h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.login-box p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.admin-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg-body);
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 1.5rem;
    outline: none;
    transition: all 0.2s;
}

.admin-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.1);
}

.error-msg {
    margin-top: 1.5rem;
    color: #ef4444;
    background: #fef2f2;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* =======================================================
   Admin Dashboard
   ======================================================= */
/* =======================================================
   Admin Dashboard Layout (Sidebar + Content)
   ======================================================= */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling */
.admin-sidebar {
    width: 280px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.admin-sidebar .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    text-decoration: none;
    cursor: default;
}

.admin-sidebar .logo span {
    color: var(--primary);
}

.admin-sidebar .logo i {
    color: var(--primary);
    font-size: 1.8rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.nav-item i {
    font-size: 1.4rem;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--primary-alpha);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(15, 98, 254, 0.25);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.btn-logout-sidebar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
    padding: 0.85rem;
    justify-content: center;
    border-radius: 10px;
    font-weight: 600;
}

.btn-logout-sidebar:hover {
    background: #ef4444;
    color: white;
}

/* Content Area Styling */
.admin-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-body);
}

.admin-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle-btn, .close-sidebar-btn {
    background: var(--bg-body);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}

.header-title-mobile {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
}

.admin-main {
    padding: 2rem;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
}

.admin-top {
    margin-bottom: 2.5rem;
}

.page-title h2 {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.page-title p {
    color: var(--text-muted);
    font-size: 1rem;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-alpha);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--secondary);
    font-family: var(--font-heading);
}

/* Table Design */
.table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background: var(--bg-body);
    padding: 1.25rem 1.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

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

.admin-table tbody tr:hover {
    background: #f9fafb;
}

.td-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.td-name {
    font-size: 1.1rem;
    color: var(--secondary);
}

.td-contact {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.postal-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.btn-delete {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fca5a5;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--bg-surface);
    border: 1px dashed var(--border);
    border-radius: var(--border-radius-lg);
    margin-top: 2rem;
}

.empty-icon {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
}

/* Responsive Sidebar Logic */
.mobile-only {
    display: none;
}

@media (max-width: 1024px) {
    .admin-sidebar {
        position: fixed;
        left: -280px;
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
    }
    .admin-sidebar.active {
        left: 0;
    }
    .mobile-only {
        display: flex;
    }
    .desktop-only {
        display: none;
    }
    .admin-main {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }
    .page-title h2 {
        font-size: 1.5rem;
    }
}

/* Booking specific tags */
.amount-tag {
    color: #059669;
    font-size: 1rem;
}

.payment-id-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #f0f9ff;
    color: var(--primary);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: monospace;
    word-break: break-all;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-paid {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.status-pending {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

/* =======================================================
   Custom Modals (Success/Confirm/Alert)
   ======================================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-surface);
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-content--alert {
    padding: 3rem 2rem;
}

.modal:not(.hidden) .modal-content {
    transform: translateY(0);
}

.modal-icon {
    width: 70px;
    height: 70px;
    background: var(--primary-alpha);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
}

.modal-body h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--secondary);
}

.modal-body p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Modal Body (Scrollable part) */
.modal-body-scroll {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid var(--border);
}

.modal-footer button {
    min-width: 100px;
}

/* Form Helper Classes */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* View Modal Specific Styles */
.view-data {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-box {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    gap: 1rem;
}

.view-box i {
    color: var(--accent);
    font-size: 1.4rem;
    margin-top: 2px;
}

.view-box--notes {
    background: #fffbeb;
    border-color: #fef3c7;
    color: #92400e;
    position: relative;
}

.view-box--notes i {
    color: #92400e;
    opacity: 0.2;
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
}

.assigned-worker-card {
    background: linear-gradient(135deg, #ffffff, #fff7ed);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid #fed7aa;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.worker-avatar {
    background: #ffedd5;
    color: #f97316;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.worker-details {
    flex: 1;
}

.worker-name {
    font-weight: 700;
    color: var(--secondary);
    font-size: 1rem;
}

.worker-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.worker-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* Modals with Headers (e.g. Add Review) */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--primary);
}

/* =======================================================
   Customer Details Premium UI Enhancements
   ======================================================= */
.truncate-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

#tab-customers .admin-table tr {
    transition: all 0.2s ease;
}

#tab-customers .admin-table tr:hover {
    background-color: rgba(15, 98, 254, 0.02);
    transform: scale(1.001);
}

.stat-card--customers {
    background: linear-gradient(135deg, #ffffff, #f5f3ff) !important;
    border-color: #ddd6fe !important;
}

/* Modal Specific Profile Styles */
.info-group label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#viewCustomerModal .modal-content {
    box-shadow: 0 20px 50px rgba(0,0,0,0.15) !important;
    border: 1px solid #e2e8f0;
}

#viewCustomerModal .close-btn:hover {
    background: #f1f5f9 !important;
    color: #ef4444 !important;
}

#editCustomerModal input:focus, 
#editCustomerModal textarea:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-alpha);
    background: #fff;
}

#editCustomerModal .btn-secondary:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

/* =======================================================
   Workers Tab Specific Styles
   ======================================================= */
.stat-card--workers {
    background: linear-gradient(135deg, #ffffff, #fff7ed) !important;
    border-color: #fed7aa !important;
}

.service-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #fdf2f8;
    color: #db2777;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exp-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}
.assigned-customer-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.assigned-customer-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.assigned-customer-item:hover {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.assigned-customer-item .cust-info {
    flex: 1;
}

.assigned-customer-item .cust-name {
    font-weight: 700;
    color: var(--secondary);
    font-size: 0.95rem;
}

.assigned-customer-item .cust-phone {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

@media (max-width: 640px) {
    .assigned-customer-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .assigned-customer-item button {
        width: 100%;
    }
}

/* Verification Badges */
.verification-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.verification-badge.verified {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.verification-badge.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.verification-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.verification-badge.idle {
    background: rgba(107, 114, 128, 0.1);
    color: #4b5563;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

#verificationMsgBox {
    transition: all 0.3s ease;
}

#verificationMsgBox.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

#verificationMsgBox.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Spinner for Re-verify button */
.ph-spin {
    animation: ph-spin 2s infinite linear;
}

@keyframes ph-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

