@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap');

:root {
    --primary:        #0d6efd;
    --primary-light:  #e8f2ff;
    --success:        #3aaf85;
    --success-light:  #d4f5ea;
    --warning:        #f5a623;
    --warning-light:  #fff3dc;
    --danger:         #dc3545;
    --danger-light:   #fde8ea;
    --info:           #17a2b8;
    --info-light:     #d1ecf1;
    --muted:          #6c757d;
    --sidebar-width:  260px;
    --topbar-height:  64px;
    --body-bg:        #f4f6f9;
    --card-shadow:    0 2px 18px rgba(0, 0, 0, 0.07);
    --card-radius:    12px;
}

/* -----------------------------------------------
   BASE
----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Nunito', sans-serif;
    background: var(--body-bg);
    margin: 0;
    padding: 0;
    color: #2d3748;
}

/* -----------------------------------------------
   SIDEBAR
----------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: #fff;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.28s ease;
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    height: var(--topbar-height);
    border-bottom: 1px solid #f0f2f5;
    flex-shrink: 0;
}

.sidebar-brand a {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.3px;
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
}

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-heading {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #adb5bd;
    padding: 0.6rem 1.5rem 0.2rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    margin: 2px 0.75rem;
    border-radius: 8px;
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.icon-blue    { background: #e8f2ff; color: #0d6efd; }
.icon-green   { background: #d4f5ea; color: #3aaf85; }
.icon-orange  { background: #fff3dc; color: #f5a623; }
.icon-red     { background: #fde8ea; color: #dc3545; }
.icon-teal    { background: #d1ecf1; color: #17a2b8; }
.icon-gray    { background: #f0f1f3; color: #6c757d; }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #f0f2f5;
    flex-shrink: 0;
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.55rem 1rem;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: 'Nunito', sans-serif;
}

.btn-logout:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger-light);
}

/* -----------------------------------------------
   SIDEBAR OVERLAY (mobile backdrop)
----------------------------------------------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 999;
}

.sidebar-overlay.show { display: block; }

/* -----------------------------------------------
   MAIN CONTENT AREA
----------------------------------------------- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* -----------------------------------------------
   TOPBAR
----------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    height: var(--topbar-height);
    padding: 0 1.5rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #4a5568;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.topbar-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a202c;
    flex: 1;
}

.topbar-user {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

/* -----------------------------------------------
   PAGE CONTENT
----------------------------------------------- */
.page-content {
    padding: 1.75rem;
    flex: 1;
}

/* -----------------------------------------------
   STAT CARDS
----------------------------------------------- */
.stat-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    height: 100%;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1;
}

/* -----------------------------------------------
   VOLT CARDS (general use)
----------------------------------------------- */
.volt-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    border: none;
}

.volt-card .card-header {
    background: transparent;
    border-bottom: 1px solid #f0f2f5;
    padding: 1rem 1.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a202c;
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    display: flex;
    align-items: center;
}

.volt-card .card-body {
    padding: 1.5rem;
}

/* -----------------------------------------------
   FORMS
----------------------------------------------- */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
    padding: 0.55rem 0.875rem;
    font-family: 'Nunito', sans-serif;
    transition: border-color 0.15s, box-shadow 0.15s;
    color: #2d3748;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
    outline: none;
}

.form-control::placeholder { color: #b0bec5; }

.form-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 0.3rem;
}

.form-control-sm, .form-select-sm {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    border-radius: 7px;
}

/* -----------------------------------------------
   BUTTONS
----------------------------------------------- */
.btn {
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    font-family: 'Nunito', sans-serif;
    transition: all 0.15s;
}

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

.btn-primary:hover {
    background: #0b5ed7;
    border-color: #0b5ed7;
}

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

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; border-radius: 6px; }

/* -----------------------------------------------
   TABLES
----------------------------------------------- */
.volt-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.volt-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}
.volt-table thead th.sortable:hover { color: var(--primary); }

.volt-table thead th {
    background: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
    border: none;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.volt-table tbody tr {
    border-bottom: 1px solid #f0f4f8;
    transition: background 0.1s;
}

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

.volt-table tbody tr:hover { background: #f8fafc; }

.volt-table tbody td {
    padding: 0.8rem 1rem;
    font-size: 0.88rem;
    color: #4a5568;
    vertical-align: middle;
    border: none;
}

/* -----------------------------------------------
   BADGES
----------------------------------------------- */
.badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.35em 0.65em;
    border-radius: 6px;
    font-family: 'Nunito', sans-serif;
}

/* -----------------------------------------------
   SECTION DIVIDERS
----------------------------------------------- */
.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 1rem;
}

/* -----------------------------------------------
   TOPBAR BREADCRUMB (job detail page)
----------------------------------------------- */
.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
}
.topbar-breadcrumb a {
    font-size: 0.88rem;
    font-weight: 600;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s;
}
.topbar-breadcrumb a:hover { color: var(--primary); }
.topbar-breadcrumb .crumb-sep   { color: #d1d5db; font-size: 0.88rem; }
.topbar-breadcrumb .crumb-current {
    font-size: 1rem;
    font-weight: 700;
    color: #1a202c;
}

/* -----------------------------------------------
   JOB DETAIL — overview key/value rows
----------------------------------------------- */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f4f8;
    font-size: 0.875rem;
}
.info-row:last-child { border-bottom: none; }

.info-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    min-width: 100px;
}

.info-value {
    font-weight: 600;
    color: #2d3748;
    text-align: right;
    word-break: break-word;
}

/* -----------------------------------------------
   JOB DETAIL — list items (notes, services, docs, eta)
----------------------------------------------- */
.note-item,
.service-item,
.doc-item,
.eta-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.5rem;
}
.note-item:last-child,
.service-item:last-child,
.doc-item:last-child,
.eta-item:last-child { margin-bottom: 0; }

.note-text { font-size: 0.875rem; color: #2d3748; margin-bottom: 0.2rem; }
.note-time { font-size: 0.75rem; color: #9ca3af; }

.service-item { display: flex; align-items: flex-start; gap: 0.75rem; }

.doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.eta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    flex-wrap: wrap;
}
.eta-item .eta-changed {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
    margin-left: auto;
}

/* -----------------------------------------------
   JOB DETAIL — locked action display rows
----------------------------------------------- */
.action-locked-row {
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.action-locked-row .btn-link {
    color: #9ca3af;
    line-height: 1;
}

.action-locked-row .btn-link:hover {
    color: var(--primary);
}

/* -----------------------------------------------
   JOB DETAIL — action section headings
----------------------------------------------- */
.action-section-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #4a5568;
    margin-bottom: 0.65rem;
}

/* -----------------------------------------------
   TOAST NOTIFICATIONS
----------------------------------------------- */
#toastContainer {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 320px;
    pointer-events: none;
}

.volt-toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.13);
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
    border-left: 4px solid #e2e8f0;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: auto;
}

.volt-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.volt-toast-success { border-left-color: #3aaf85; }
.volt-toast-error   { border-left-color: #dc3545; }
.volt-toast-info    { border-left-color: #0d6efd; }

.volt-toast-success .volt-toast-icon { color: #3aaf85; }
.volt-toast-error   .volt-toast-icon { color: #dc3545; }
.volt-toast-info    .volt-toast-icon { color: #0d6efd; }

.volt-toast-icon { font-size: 1.05rem; flex-shrink: 0; }
.volt-toast-msg  { flex: 1; line-height: 1.4; }

.volt-toast-close {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.volt-toast-close:hover { color: #4a5568; }

/* -----------------------------------------------
   CONFIRM MODAL
----------------------------------------------- */
#confirmModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

#confirmModal.show { display: flex; }

.confirm-box {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.16);
}

.confirm-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* -----------------------------------------------
   RESPONSIVE — mobile sidebar
----------------------------------------------- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .sidebar-close-btn { display: block; }

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

    .topbar-toggle { display: block; }

    .page-content { padding: 1rem; }
}
