/* ============================================================
   ECBC Compliance Portal — Auditor Panel
   Light Theme — matches Figma builder/auditor screens
   ============================================================ */

:root {
    --au-blue: #2563EB;
    --au-blue-light: #3B82F6;
    --au-blue-dark: #1D4ED8;
    --au-blue-bg: #EFF6FF;
    --au-green: #16A34A;
    --au-green-bg: #F0FDF4;
    --au-red: #DC2626;
    --au-red-bg: #FEF2F2;
    --au-orange: #EA580C;
    --au-orange-bg: #FFF7ED;
    --au-dark: #111827;
    --au-text: #374151;
    --au-text-light: #6B7280;
    --au-text-muted: #9CA3AF;
    --au-border: #E5E7EB;
    --au-border-light: #F3F4F6;
    --au-bg: #F9FAFB;
    --au-white: #FFFFFF;
    --au-radius: 10px;
    --au-transition: 0.2s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--au-bg);
    color: var(--au-text);
    margin: 0;
    overflow-x: hidden;
}

a { text-decoration: none; color: var(--au-blue); }
a:hover { color: var(--au-blue-dark); }

/* ========================================
   TOP NAVBAR — slim, white
   ======================================== */
.au-topbar {
    background: var(--au-white);
    border-bottom: 1px solid var(--au-border);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.au-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.au-topbar-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.au-topbar-brand {
    font-size: 13px;
    font-weight: 700;
    color: var(--au-dark);
    line-height: 1.2;
}

.au-topbar-brand small {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: var(--au-text-muted);
}

/* Topbar nav links */
.au-topbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.au-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--au-text-light);
    transition: all var(--au-transition);
}

.au-nav-link i { font-size: 15px; }
.au-nav-link:hover { background: var(--au-bg); color: var(--au-text); text-decoration: none; }
.au-nav-link.active { background: var(--au-blue-bg); color: var(--au-blue); font-weight: 600; }

/* Mobile hamburger */
.au-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--au-border);
    border-radius: 8px;
    background: none;
    font-size: 18px;
    color: var(--au-text-light);
    cursor: pointer;
}

.au-mobile-toggle:hover { background: var(--au-bg); color: var(--au-blue); }

/* Mobile dropdown nav */
.au-mobile-nav {
    display: none;
    background: var(--au-white);
    border-bottom: 1px solid var(--au-border);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    padding: 8px;
}

.au-mobile-nav.show { display: flex; flex-direction: column; }

.au-mobile-nav .au-nav-link {
    display: flex;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
}

@media (max-width: 767.98px) {
    .au-mobile-toggle { display: flex; }
}

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

.au-topbar-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--au-border);
    background: var(--au-white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--au-text-light);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--au-transition);
    position: relative;
}

.au-topbar-icon:hover {
    background: var(--au-bg);
    color: var(--au-blue);
}

.au-topbar-icon .dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 6px;
    height: 6px;
    background: var(--au-red);
    border-radius: 50%;
    border: 1.5px solid #fff;
}

.au-topbar-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px 4px 4px;
    border-radius: 8px;
    transition: background var(--au-transition);
}

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

.au-topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--au-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.au-topbar-profile-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--au-dark);
}

.au-topbar-profile-role {
    font-size: 10px;
    color: var(--au-text-muted);
}

/* ========================================
   DASHBOARD LAYOUT
   ======================================== */
.au-dashboard {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.au-page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--au-dark);
    margin-bottom: 4px;
}

.au-page-subtitle {
    font-size: 13px;
    color: var(--au-text-muted);
    margin-bottom: 24px;
}

/* Stat cards */
.au-stat-card {
    background: var(--au-white);
    border: 1px solid var(--au-border-light);
    border-radius: var(--au-radius);
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow var(--au-transition);
}

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

.au-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.au-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--au-dark);
    margin-top: 10px;
    line-height: 1;
}

.au-stat-label {
    font-size: 12px;
    color: var(--au-text-light);
    margin-top: 3px;
}

/* Content card */
.au-card {
    background: var(--au-white);
    border: 1px solid var(--au-border-light);
    border-radius: var(--au-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

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

.au-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--au-dark);
    margin: 0;
}

.au-card-body {
    padding: 18px;
}

/* Table */
.au-table {
    font-size: 13px;
    width: 100%;
}

.au-table thead th {
    background: var(--au-bg);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--au-text-light);
    padding: 10px 14px;
    border-bottom: 1px solid var(--au-border);
}

.au-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--au-border-light);
    vertical-align: middle;
}

.au-table tbody tr:hover { background: #FAFBFC; }
.au-table tbody tr:last-child td { border-bottom: none; }

/* Status badge */
.au-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.au-badge.pending { background: #FEF3C7; color: #92400E; }
.au-badge.in-progress { background: var(--au-blue-bg); color: var(--au-blue); }
.au-badge.completed { background: var(--au-green-bg); color: #15803D; }
.au-badge.review { background: #FFF7ED; color: #C2410C; }

/* Button */
.au-btn {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--au-transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.au-btn-blue { background: var(--au-blue); color: #fff; }
.au-btn-blue:hover { background: var(--au-blue-dark); color: #fff; }

.au-btn-green { background: var(--au-green); color: #fff; }
.au-btn-green:hover { background: #15803D; color: #fff; }

.au-btn-outline {
    background: transparent;
    border: 1.5px solid var(--au-border);
    color: var(--au-text);
}
.au-btn-outline:hover { border-color: var(--au-blue); color: var(--au-blue); }

.au-btn-red { background: transparent; color: var(--au-red); border: none; font-weight: 600; }
.au-btn-red:hover { color: #991B1B; }

/* ========================================
   PROJECT DETAIL — header + tabs
   ======================================== */
.au-project-header {
    background: var(--au-white);
    border-bottom: 1px solid var(--au-border);
    padding: 20px 24px 0;
}

.au-back-link {
    font-size: 12px;
    color: var(--au-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
}

.au-back-link:hover { color: var(--au-blue); }

.au-project-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--au-dark);
    margin-bottom: 4px;
}

.au-project-meta {
    font-size: 12.5px;
    color: var(--au-text-light);
    margin-bottom: 4px;
}

.au-project-meta span {
    margin-right: 6px;
}

.au-project-tabs {
    display: flex;
    gap: 0;
    margin-top: 16px;
}

.au-project-tab {
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--au-text-light);
    border-bottom: 2.5px solid transparent;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    cursor: pointer;
    transition: all var(--au-transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.au-project-tab:hover { color: var(--au-text); }

.au-project-tab.active {
    color: var(--au-blue);
    border-bottom-color: var(--au-blue);
    font-weight: 600;
}

.au-project-tab i { font-size: 14px; }

.au-exit-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--au-red);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.au-exit-btn:hover { color: #991B1B; }

/* ========================================
   PROJECT DETAIL — stepper + content
   ======================================== */
.au-project-body {
    display: flex;
    min-height: calc(100vh - 180px);
}

/* Left stepper */
.au-stepper {
    width: 220px;
    min-width: 220px;
    background: var(--au-white);
    border-right: 1px solid var(--au-border);
    padding: 24px 18px;
}

.au-stepper-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--au-dark);
    margin-bottom: 3px;
}

.au-stepper-subtitle {
    font-size: 11px;
    color: var(--au-text-muted);
    margin-bottom: 20px;
}

.au-step-group {
    position: relative;
    padding-left: 28px;
    margin-bottom: 8px;
}

/* Vertical line between steps */
.au-step-group::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 28px;
    bottom: 0;
    width: 2px;
    background: var(--au-border);
}

.au-step-group:last-child::before {
    display: none;
}

.au-step {
    position: relative;
    padding-bottom: 20px;
}

.au-step-circle {
    position: absolute;
    left: -28px;
    top: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #D1D5DB;
    z-index: 1;
}

.au-step-circle.completed { background: var(--au-green); }
.au-step-circle.active { background: var(--au-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.au-step-circle.error { background: var(--au-red); }

.au-step-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--au-dark);
    padding-top: 3px;
}

.au-step-status {
    font-size: 11px;
    font-weight: 500;
    margin-top: 1px;
}

.au-step-status.completed { color: var(--au-green); }
.au-step-status.in-progress { color: var(--au-blue); }
.au-step-status.locked { color: var(--au-text-muted); }
.au-step-status.error { color: var(--au-red); }

/* Stage separators */
.au-stage-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--au-text-muted);
}

.au-stage-label i { font-size: 14px; }

/* Right content */
.au-project-content {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
}

.au-content-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--au-dark);
    margin-bottom: 6px;
}

.au-content-subtitle {
    font-size: 13px;
    color: var(--au-text-muted);
    margin-bottom: 24px;
}

/* Info box (blue tinted) */
.au-info-box {
    background: var(--au-blue-bg);
    border: 1px solid #DBEAFE;
    border-radius: var(--au-radius);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.au-info-box-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.au-info-box-icon.blue { background: var(--au-blue); color: #fff; }
.au-info-box-icon.orange { background: #F59E0B; color: #fff; }
.au-info-box-icon.green { background: var(--au-green); color: #fff; }
.au-info-box-icon.red { background: var(--au-red); color: #fff; }

.au-info-box h6 {
    font-size: 14px;
    font-weight: 700;
    color: var(--au-dark);
    margin-bottom: 4px;
}

.au-info-box p {
    font-size: 12.5px;
    color: var(--au-text-light);
    margin: 0;
    line-height: 1.5;
}

/* Warning box (orange/yellow tinted) */
.au-warning-box {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--au-radius);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

/* Success box */
.au-success-box {
    background: var(--au-green-bg);
    border: 1px solid #BBF7D0;
    border-radius: var(--au-radius);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

/* Error box (red tinted) */
.au-error-box {
    background: var(--au-red-bg);
    border: 1px solid #FECACA;
    border-radius: var(--au-radius);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

/* Assigned auditor card */
.au-auditor-card {
    background: var(--au-white);
    border: 1px solid var(--au-border);
    border-radius: var(--au-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.au-auditor-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    background: #E5E7EB;
    flex-shrink: 0;
}

.au-auditor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Detail grid */
.au-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.au-detail-label {
    font-size: 11px;
    color: var(--au-text-muted);
    margin-bottom: 2px;
}

.au-detail-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--au-dark);
}

/* Deviation table */
.au-deviation-table {
    width: 100%;
    font-size: 12.5px;
    border-collapse: collapse;
}

.au-deviation-table th {
    background: var(--au-bg);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--au-text-light);
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--au-border);
}

.au-deviation-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--au-border-light);
    color: var(--au-text);
    vertical-align: top;
}

/* Download box */
.au-download-box {
    background: var(--au-white);
    border: 1px solid var(--au-border);
    border-radius: var(--au-radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.au-download-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.au-btn-download {
    background: var(--au-green);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background var(--au-transition);
}

.au-btn-download:hover { background: #15803D; }

/* Grievance box at bottom */
.au-grievance {
    padding: 16px 18px;
    border-top: 1px solid var(--au-border);
    margin-top: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--au-text-light);
}

.au-grievance-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--au-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.au-grievance a { font-weight: 600; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 991.98px) {
    .au-project-body { flex-direction: column; }
    .au-stepper { width: 100%; min-width: auto; border-right: none; border-bottom: 1px solid var(--au-border); padding: 16px; }
    .au-project-content { padding: 20px; }
}

@media (max-width: 575.98px) {
    .au-dashboard { padding: 16px; }
    .au-project-header { padding: 14px 16px 0; }
    .au-project-title { font-size: 18px; }
}
