/* ================================================================
   VistorIA Pro — Design System v2.0
   Modern Professional Dashboard
   ================================================================ */

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary:        #2563eb;
    --primary-dark:   #1d4ed8;
    --primary-light:  #eff6ff;
    --primary-muted:  #bfdbfe;
    --success:        #059669;
    --success-light:  #d1fae5;
    --danger:         #dc2626;
    --danger-light:   #fee2e2;
    --warning:        #d97706;
    --warning-light:  #fef3c7;

    --gray-50:  #f8fafc; --gray-100: #f1f5f9; --gray-200: #e2e8f0;
    --gray-300: #cbd5e1; --gray-400: #94a3b8; --gray-500: #64748b;
    --gray-600: #475569; --gray-700: #334155; --gray-800: #1e293b;
    --gray-900: #0f172a;

    --sidebar-bg:     #080d1a;
    --sidebar-border: rgba(255,255,255,0.07);
    --sidebar-hover:  rgba(255,255,255,0.06);
    --sidebar-active: rgba(37,99,235,0.18);
    --sidebar-text:   #8899b4;
    --sidebar-width:  248px;

    --bg:      #f0f4f8;
    --surface: #ffffff;

    --radius-sm: 6px; --radius: 10px; --radius-lg: 14px; --radius-xl: 22px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:    0 4px 8px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-md: 0 10px 20px -3px rgba(0,0,0,0.09), 0 4px 8px -4px rgba(0,0,0,0.04);
    --shadow-lg: 0 24px 48px -5px rgba(0,0,0,0.12), 0 8px 16px -6px rgba(0,0,0,0.06);

    --transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
    position: fixed; left: 0; top: 0;
    width: var(--sidebar-width); height: 100vh;
    background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    z-index: 200; border-right: 1px solid var(--sidebar-border);
}

.sidebar-logo {
    padding: 20px 18px 18px; border-bottom: 1px solid var(--sidebar-border);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-logo i { font-size: 21px; color: #60a5fa; filter: drop-shadow(0 0 10px rgba(96,165,250,0.4)); }
.sidebar-logo span {
    font-size: 17px; font-weight: 800; letter-spacing: -0.4px;
    background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 60%, #818cf8 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.sidebar-logo strong { -webkit-text-fill-color: transparent; }

.sidebar-user {
    padding: 13px 16px; border-bottom: 1px solid var(--sidebar-border);
    display: flex; align-items: center; gap: 10px;
}
.user-avatar {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, #60a5fa, #818cf8);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: white; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: #e2e8f0; line-height: 1.3; }
.user-role { font-size: 11px; color: var(--sidebar-text); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 10px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; color: var(--sidebar-text); text-decoration: none;
    font-size: 13.5px; font-weight: 500; border-radius: var(--radius);
    margin-bottom: 2px; transition: var(--transition); cursor: pointer; position: relative;
}
.nav-link:hover { color: #e2e8f0; background: var(--sidebar-hover); }
.nav-link.active { color: #fff; background: var(--sidebar-active); font-weight: 600; }
.nav-link.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 55%; background: var(--primary); border-radius: 0 3px 3px 0;
}
.nav-link i { width: 18px; text-align: center; font-size: 14px; opacity: 0.75; }
.nav-link.active i { opacity: 1; color: #60a5fa; }
.nav-link .badge { margin-left: auto; background: var(--primary); color: white; font-size: 10px; padding: 2px 7px; border-radius: 10px; }

.sidebar-bottom { padding: 10px; border-top: 1px solid var(--sidebar-border); }
.sidebar-footer { padding: 10px; border-top: 1px solid var(--sidebar-border); }

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content { margin-left: var(--sidebar-width); min-height: 100vh; padding: 32px 36px; }

.page { display: none; }
.page.active { display: block; }

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1.5px solid var(--gray-200);
}
.page-header h1 { font-size: 22px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.4px; display: flex; align-items: center; gap: 10px; }
.page-header h1 i { color: var(--primary); font-size: 19px; }
.page-header p { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--gray-200); padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar h2 { font-size: 20px; font-weight: 700; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.page-content { padding: 32px; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border: none; border-radius: var(--radius);
    font-family: inherit; font-size: 13.5px; font-weight: 600;
    cursor: pointer; transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; box-shadow: 0 1px 3px rgba(37,99,235,0.3), inset 0 1px 0 rgba(255,255,255,0.08); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(37,99,235,0.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: var(--surface); color: var(--gray-700); border: 1.5px solid var(--gray-200); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #047857; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--surface); border: 1.5px solid var(--gray-200); cursor: pointer; color: var(--gray-600); transition: var(--transition); }
.btn-icon:hover { background: var(--gray-100); color: var(--gray-800); }
.btn-close { width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--gray-100); border: none; font-size: 18px; color: var(--gray-500); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); line-height: 1; }
.btn-close:hover { background: var(--gray-200); color: var(--gray-700); }

/* ================================================================
   CARDS
   ================================================================ */
.card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 20px; }
.card h3 { font-size: 14px; font-weight: 700; color: var(--gray-700); padding: 16px 20px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--gray-100); }
.card h3 i { color: var(--primary); }
.card-header { padding: 16px 22px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { padding: 0; border: none; font-size: 15px; }
.card-body { padding: 22px; }

/* ================================================================
   DASHBOARD
   ================================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--surface); border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200); padding: 22px;
    box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 18px; transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-info { flex: 1; min-width: 0; }
.stat-number, .stat-value { font-size: 32px; font-weight: 800; color: var(--gray-900); line-height: 1; letter-spacing: -1.5px; }
.stat-label { font-size: 12.5px; color: var(--gray-500); margin-top: 5px; font-weight: 500; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.recent-list { }
.recent-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--gray-100); transition: var(--transition); gap: 12px; }
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: var(--gray-50); }
.recent-item strong { font-size: 13.5px; font-weight: 600; color: var(--gray-800); display: block; }
.recent-item small { font-size: 12px; color: var(--gray-500); margin-top: 2px; display: block; }

/* ================================================================
   STATUS BADGES
   ================================================================ */
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.status-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-badge.pending, .status-badge.status-pending { background: var(--warning-light); color: #92400e; }
.status-badge.in-progress, .status-badge.status-in_progress { background: var(--primary-light); color: var(--primary-dark); }
.status-badge.completed, .status-badge.status-completed { background: var(--success-light); color: #065f46; }
.status-badge.signed { background: #ede9fe; color: #5b21b6; }

/* ================================================================
   TEMPLATES
   ================================================================ */
.templates-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(290px,1fr)); gap: 16px; }
.template-card { background: var(--surface); border: 1.5px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.template-card:hover { border-color: var(--primary-muted); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.template-card-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.template-card-header h3 { font-size: 15px; font-weight: 700; color: var(--gray-900); border: none; padding: 0; flex: 1; }
.template-badge { background: var(--primary-light); color: var(--primary); font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.template-card > p { padding: 10px 20px; font-size: 13px; color: var(--gray-500); border-bottom: 1px solid var(--gray-100); min-height: 42px; }
.template-sections { padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-height: 54px; }
.section-tag { background: var(--gray-100); color: var(--gray-600); font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; }
.template-actions { padding: 12px 20px; border-top: 1px solid var(--gray-100); display: flex; gap: 6px; background: var(--gray-50); }
.template-card .template-info { font-size: 13px; color: var(--gray-500); display: flex; align-items: center; gap: 6px; }
.template-section-edit { background: var(--gray-50); border: 1.5px solid var(--gray-200); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.mockup-badge { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg,#fbbf24,#f59e0b); color: #78350f; padding: 4px 12px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ================================================================
   TABLE
   ================================================================ */
.table-container { overflow-x: auto; }
table, .data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; padding: 11px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--gray-500); background: var(--gray-50); border-bottom: 1.5px solid var(--gray-200); }
td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbff; }
.action-btns { display: flex; gap: 6px; }

/* ================================================================
   FORMS
   ================================================================ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-input, .form-control { width: 100%; padding: 9px 13px; border: 1.5px solid var(--gray-300); border-radius: var(--radius); font-family: inherit; font-size: 14px; color: var(--gray-800); background: white; transition: var(--transition); outline: none; }
.form-input:focus, .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
textarea.form-input, textarea.form-control { resize: vertical; min-height: 80px; }
select.form-input, select.form-control { cursor: pointer; }
.item-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.item-row .form-input { flex: 1; }

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(8,13,26,0.65); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(6px); padding: 20px; }
.modal-overlay:not(.hidden) { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-xl); width: 100%; max-width: 680px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); border: 1px solid var(--gray-200); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface); z-index: 1; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--gray-900); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 10px; background: var(--gray-50); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }

/* ================================================================
   CHECKLIST BUILDER
   ================================================================ */
.checklist-section { border: 1.5px solid var(--gray-200); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.checklist-section-header { background: var(--gray-50); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.checklist-section-header h4 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.checklist-item { padding: 10px 16px; border-top: 1px solid var(--gray-100); display: flex; align-items: center; gap: 12px; font-size: 14px; }
.checklist-item input[type="text"] { flex: 1; border: none; background: transparent; font-size: 14px; font-family: inherit; outline: none; padding: 4px 0; }
.add-item-btn { display: flex; align-items: center; gap: 8px; padding: 8px 16px; color: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer; border: none; background: none; width: 100%; border-top: 1px solid var(--gray-100); }
.add-item-btn:hover { background: var(--primary-light); }

/* ================================================================
   INSPECTION EXECUTION
   ================================================================ */
.section-env-header { background: linear-gradient(135deg,var(--primary) 0%,var(--primary-dark) 100%); color: white; padding: 13px 18px; border-radius: var(--radius) var(--radius) 0 0; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 10px; margin-top: 20px; box-shadow: 0 2px 8px rgba(37,99,235,0.2); }
.env-items-container { border: 1.5px solid var(--gray-200); border-top: none; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; margin-bottom: 8px; }
.exec-item { padding: 16px; border-bottom: 1px solid var(--gray-100); transition: var(--transition); background: white; }
.exec-item:last-child { border-bottom: none; }
.exec-item.ok    { background: #f0fdf6; border-left: 3px solid var(--success); }
.exec-item.issue { background: #fff5f5; border-left: 3px solid var(--danger); }
.exec-item.na    { background: var(--gray-50); border-left: 3px solid var(--gray-300); opacity: 0.8; }
.exec-item-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.exec-item-header .item-label { flex: 1; font-weight: 600; font-size: 13.5px; color: var(--gray-800); }
.exec-status-btns { display: flex; gap: 5px; flex-shrink: 0; }
.exec-status-btns button { padding: 5px 12px; border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm); font-size: 11.5px; font-weight: 700; cursor: pointer; background: white; color: var(--gray-600); transition: var(--transition); font-family: inherit; }
.exec-status-btns button:hover { border-color: var(--gray-400); }
.exec-status-btns button.active-ok    { background: var(--success); color: white; border-color: var(--success); }
.exec-status-btns button.active-issue { background: var(--danger); color: white; border-color: var(--danger); }
.exec-status-btns button.active-na    { background: var(--gray-400); color: white; border-color: var(--gray-400); }
.exec-details { margin-top: 10px; }
.exec-details textarea { width: 100%; padding: 8px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-family: inherit; font-size: 13px; resize: vertical; min-height: 60px; outline: none; transition: var(--transition); }
.exec-details textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.exec-progress-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; padding: 16px 20px; background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); }
.exec-progress-bar .progress-bar { flex: 1; }
.exec-progress-text { font-size: 13px; font-weight: 700; color: var(--gray-700); min-width: 110px; text-align: right; }
.progress-bar { width: 100%; height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.progress-bar .fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.progress-bar .fill.green { background: linear-gradient(90deg,var(--success),#10b981); }
.progress-bar .fill.blue  { background: linear-gradient(90deg,var(--primary),#60a5fa); }
.photo-upload-area { margin-top: 10px; border: 2px dashed var(--gray-300); border-radius: var(--radius); padding: 14px; text-align: center; cursor: pointer; transition: var(--transition); position: relative; font-size: 13px; color: var(--gray-500); }
.photo-upload-area:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.photo-upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photo-thumb { width: 76px; height: 76px; border-radius: var(--radius); object-fit: cover; border: 2px solid var(--gray-200); cursor: pointer; transition: var(--transition); }
.photo-thumb:hover { border-color: var(--primary); transform: scale(1.06); }
.photo-count { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* ================================================================
   SIGNATURES
   ================================================================ */
.signatures-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.signature-box { background: white; border: 1.5px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px; }
.signature-box h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--gray-700); }
.signature-box canvas { width: 100%; height: 150px; display: block; border: 1.5px solid var(--gray-200); border-radius: var(--radius); cursor: crosshair; background: var(--gray-50); }
.signature-box p { font-size: 12px; color: var(--gray-500); margin-top: 8px; text-align: center; }
.signature-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.signature-section { background: var(--gray-50); border-radius: var(--radius-lg); padding: 24px; margin-top: 24px; border: 1px solid var(--gray-200); }
.signature-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.signature-section p { font-size: 13px; color: var(--gray-500); margin-bottom: 16px; }
.sig-row { display: flex; gap: 20px; flex-wrap: wrap; }
.sig-box { flex: 1; min-width: 260px; }
.sig-box label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--gray-700); }
.sig-canvas-wrap { border: 2px solid var(--gray-300); border-radius: var(--radius); background: white; overflow: hidden; position: relative; }
.sig-canvas-wrap canvas { width: 100%; height: 150px; display: block; cursor: crosshair; }
.sig-clear { position: absolute; top: 8px; right: 8px; background: white; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); padding: 4px 10px; font-size: 12px; cursor: pointer; font-weight: 600; color: var(--gray-600); transition: var(--transition); }
.sig-clear:hover { background: var(--danger); color: white; border-color: var(--danger); }
.signature-display { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 12px; text-align: center; background: var(--gray-50); }
.signature-display img { max-height: 90px; }
.signature-display p { font-size: 12px; color: var(--gray-500); margin-top: 6px; }
.signature-pad-container { border: 2px solid var(--gray-300); border-radius: var(--radius); background: white; padding: 8px; margin: 16px 0; }
.signature-pad-container canvas { width: 100%; height: 200px; border-radius: var(--radius-sm); cursor: crosshair; display: block; }

/* ================================================================
   REPORTS
   ================================================================ */
.report-card { background: var(--surface); border-radius: var(--radius-lg); border: 1.5px solid var(--gray-200); padding: 20px 24px; margin-bottom: 14px; box-shadow: var(--shadow-sm); cursor: pointer; transition: var(--transition); }
.report-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-muted); transform: translateY(-2px); }
.report-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 8px; color: var(--gray-900); }
.report-meta { display: flex; gap: 14px; flex-wrap: wrap; }
.report-meta span { font-size: 12.5px; color: var(--gray-500); display: flex; align-items: center; gap: 5px; }
.report-meta i { color: var(--gray-400); }
.detail-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--gray-200); }
.detail-header h2 { font-size: 22px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.4px; }
.detail-header .meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.detail-header .meta span { font-size: 13px; color: var(--gray-500); display: flex; align-items: center; gap: 5px; }
.detail-section { margin-bottom: 28px; }
.detail-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; color: var(--gray-800); }
.detail-section h3 i { color: var(--primary); }
.item-result { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; border-radius: var(--radius); margin-bottom: 6px; font-size: 13.5px; }
.item-result.ok    { background: #f0fdf6; }
.item-result.issue { background: #fff5f5; }
.item-result.na    { background: var(--gray-50); }
.result-icon { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; margin-top: 1px; }
.result-icon.ok    { background: var(--success); color: white; }
.result-icon.issue { background: var(--danger); color: white; }
.result-icon.na    { background: var(--gray-400); color: white; }
.item-name { flex: 1; font-weight: 500; color: var(--gray-800); }
.item-note { font-size: 12px; color: var(--gray-500); margin-top: 3px; display: block; }

/* ================================================================
   COMMENTS
   ================================================================ */
.comment-box { border: 1.5px solid var(--gray-200); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 10px; background: var(--surface); transition: var(--transition); }
.comment-box:hover { border-color: var(--gray-300); }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-avatar { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg,var(--primary),#818cf8); color: white; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.comment-author { font-size: 13px; font-weight: 700; color: var(--gray-800); }
.comment-date { font-size: 11.5px; color: var(--gray-400); margin-left: auto; }
.comment-text { font-size: 13.5px; color: var(--gray-700); line-height: 1.6; }

/* ================================================================
   CLIENT PORTAL
   ================================================================ */
.client-portal-wrap { min-height: 100vh; background: var(--bg); }
.client-topbar { background: linear-gradient(135deg,#0a0f1e 0%,#1a2f5a 100%); color: white; padding: 18px 32px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 24px rgba(0,0,0,0.25); }
.client-topbar h1 { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.client-topbar p { font-size: 12.5px; opacity: 0.65; margin-top: 2px; }
.client-topbar .back-btn { color: white; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); padding: 7px 14px; border-radius: var(--radius); cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; transition: var(--transition); }
.client-topbar .back-btn:hover { background: rgba(255,255,255,0.2); }
.client-body { max-width: 880px; margin: 0 auto; padding: 32px 20px; }
.client-header { background: linear-gradient(135deg,var(--primary),var(--primary-dark)); color: white; padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; border-radius: var(--radius-lg); margin-bottom: 24px; box-shadow: 0 4px 20px rgba(37,99,235,0.3); }
.client-header h1 { font-size: 22px; font-weight: 800; }
.client-header p { opacity: 0.8; margin-top: 4px; font-size: 13px; }

/* ================================================================
   UTILITIES
   ================================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 24px; }
.tab { padding: 10px 20px; font-size: 13.5px; font-weight: 600; color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: var(--transition); }
.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.empty-state { text-align: center; padding: 56px 20px; color: var(--gray-400); }
.empty-state i { font-size: 44px; margin-bottom: 14px; opacity: 0.35; display: block; }
.empty-state h3 { font-size: 17px; color: var(--gray-600); margin-bottom: 6px; font-weight: 700; }
.empty-state p { font-size: 13.5px; max-width: 360px; margin: 0 auto; line-height: 1.6; }
td.empty-state { padding: 40px; color: var(--gray-500); font-style: italic; }
.error-state { text-align: center; padding: 48px 20px; }
.error-state i { font-size: 40px; color: var(--danger); margin-bottom: 14px; display: block; opacity: 0.6; }
.error-state p { font-size: 14px; color: var(--gray-600); }
.error-state a { color: var(--primary); cursor: pointer; font-weight: 600; }
.error-state a:hover { text-decoration: underline; }

/* ================================================================
   TOAST
   ================================================================ */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--gray-900); color: white; padding: 13px 18px; border-radius: var(--radius-lg); font-size: 13.5px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-lg); animation: slideIn 0.25s cubic-bezier(0.34,1.56,0.64,1); min-width: 270px; max-width: 370px; border: 1px solid rgba(255,255,255,0.07); }
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--primary); }
@keyframes slideIn { from { transform: translateX(110%) scale(0.9); opacity: 0; } to { transform: translateX(0) scale(1); opacity: 1; } }

/* ================================================================
   AUTH SCREEN
   ================================================================ */
.auth-fullscreen {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 70% 30%, #0d2150 0%, #050a16 60%, #080d1e 100%);
    padding: 20px; position: relative; overflow: hidden;
}
.auth-fullscreen::before { content: ''; position: absolute; width: 700px; height: 700px; background: radial-gradient(circle,rgba(37,99,235,0.1) 0%,transparent 65%); top: -150px; right: -150px; pointer-events: none; }
.auth-fullscreen::after  { content: ''; position: absolute; width: 500px; height: 500px; background: radial-gradient(circle,rgba(129,140,248,0.07) 0%,transparent 65%); bottom: -80px; left: -80px; pointer-events: none; }
.auth-card { background: rgba(255,255,255,0.98); backdrop-filter: blur(20px); border-radius: var(--radius-xl); padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 40px 80px rgba(0,0,0,0.55); position: relative; z-index: 1; border: 1px solid rgba(255,255,255,0.95); }
.auth-logo { text-align: center; font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 6px; letter-spacing: -0.5px; }
.auth-logo i { margin-right: 8px; }
.auth-subtitle { text-align: center; color: var(--gray-500); font-size: 13px; margin-bottom: 28px; }
.auth-tabs { display: flex; border: 1.5px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; background: var(--gray-50); padding: 3px; gap: 3px; }
.auth-tab { flex: 1; padding: 9px 8px; text-align: center; font-size: 13px; font-weight: 600; cursor: pointer; background: transparent; border: none; color: var(--gray-500); transition: var(--transition); font-family: inherit; border-radius: var(--radius-sm); }
.auth-tab:hover { color: var(--gray-700); background: white; }
.auth-tab.active { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(37,99,235,0.3); }
.auth-tab i { margin-right: 5px; }
.auth-link { text-align: center; margin-top: 16px; font-size: 13px; color: var(--primary); cursor: pointer; font-weight: 500; }
.auth-link:hover { text-decoration: underline; }

/* ================================================================
   LOADING & SKELETON
   ================================================================ */
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.82); z-index: 9999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.loading-spinner { width: 44px; height: 44px; border: 4px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-skeleton { }
.skeleton-header, .skeleton-card { background: linear-gradient(90deg,var(--gray-100) 25%,var(--gray-200) 50%,var(--gray-100) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); margin-bottom: 14px; }
.skeleton-header { height: 52px; width: 48%; }
.skeleton-card { height: 72px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ================================================================
   GLOBAL
   ================================================================ */
.hidden { display: none !important; }

/* ================================================================
   EXECUTION SCREEN v2 — SEVERITY SYSTEM
   ================================================================ */
.exec-topbar {
    background: linear-gradient(135deg, #0a0f1e 0%, #1a2f5a 100%);
    color: white; padding: 20px 24px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    flex-wrap: wrap;
}
.exec-topbar-info h1 { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; margin: 0; color: white; }
.exec-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.exec-meta span { font-size: 12.5px; color: rgba(255,255,255,0.65); display: flex; align-items: center; gap: 5px; }
.exec-meta i { color: rgba(255,255,255,0.35); }
.exec-topbar-actions { flex-shrink: 0; }

.exec-progress-wrap {
    background: white; padding: 12px 24px; display: flex; align-items: center; gap: 14px;
    border: 1px solid var(--gray-200); border-top: none;
}
.exec-progress-track { flex: 1; height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.exec-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #60a5fa); border-radius: 4px; transition: width 0.45s cubic-bezier(0.4,0,0.2,1); }
.exec-progress-label { font-size: 12px; font-weight: 700; color: var(--gray-600); white-space: nowrap; min-width: 160px; text-align: right; }

.exec-legend {
    display: flex; gap: 16px; flex-wrap: wrap; padding: 9px 24px;
    background: var(--gray-50); border: 1px solid var(--gray-200); border-top: none; border-bottom: none;
}
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--gray-600); font-weight: 500; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.legend-dot.ok       { background: var(--success); }
.legend-dot.critical { background: #ef4444; }
.legend-dot.moderate { background: var(--warning); }
.legend-dot.cosmetic { background: #f59e0b; }
.legend-dot.na       { background: var(--gray-400); }

.exec-sections { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
.exec-section { background: white; border-radius: var(--radius-lg); border: 1.5px solid var(--gray-200); overflow: hidden; box-shadow: var(--shadow-xs); }
.exec-section-header {
    background: var(--gray-50); padding: 11px 18px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1.5px solid var(--gray-200);
}
.exec-section-name { font-size: 13.5px; font-weight: 700; color: var(--gray-800); display: flex; align-items: center; gap: 8px; }
.exec-section-name i { color: var(--primary); font-size: 13px; }
.exec-section-progress { font-size: 12px; font-weight: 700; color: var(--gray-500); background: var(--gray-200); padding: 3px 10px; border-radius: 20px; }
.exec-section-progress.done { background: var(--success-light); color: var(--success); }
.exec-section-items { display: flex; flex-direction: column; }

/* Item severity states */
.exec-item { padding: 14px 18px; border-bottom: 1px solid var(--gray-100); transition: background 0.2s; background: white; border-left: 3px solid transparent; }
.exec-item:last-child { border-bottom: none; }
.exec-item.ok       { background: #f0fdf6; border-left-color: var(--success); }
.exec-item.critical { background: #fff5f5; border-left-color: #ef4444; }
.exec-item.moderate { background: #fffbeb; border-left-color: var(--warning); }
.exec-item.cosmetic { background: #fffde7; border-left-color: #f59e0b; }
.exec-item.na       { background: var(--gray-50); border-left-color: var(--gray-300); opacity: 0.78; }
.exec-item-header { display: flex; align-items: center; gap: 10px; }
.exec-item-header .item-label { flex: 1; font-weight: 500; font-size: 13.5px; color: var(--gray-800); line-height: 1.4; }

/* Severity buttons */
.exec-sev-btns { display: flex; gap: 4px; flex-shrink: 0; }
.exec-sev-btn {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200); background: white;
    color: var(--gray-400); cursor: pointer; font-family: inherit;
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.exec-sev-btn:hover { border-color: var(--gray-400); color: var(--gray-600); background: var(--gray-50); }
.exec-sev-btn.active-ok       { background: var(--success); color: white; border-color: var(--success); box-shadow: 0 2px 6px rgba(5,150,105,0.35); }
.exec-sev-btn.active-critical { background: #ef4444; color: white; border-color: #ef4444; box-shadow: 0 2px 6px rgba(239,68,68,0.35); }
.exec-sev-btn.active-moderate { background: var(--warning); color: white; border-color: var(--warning); box-shadow: 0 2px 6px rgba(217,119,6,0.35); }
.exec-sev-btn.active-cosmetic { background: #f59e0b; color: white; border-color: #f59e0b; box-shadow: 0 2px 6px rgba(245,158,11,0.35); }
.exec-sev-btn.active-na       { background: var(--gray-400); color: white; border-color: var(--gray-400); }

.exec-item-details { margin-top: 10px; }
.exec-item-details .form-input { font-size: 13px; min-height: 60px; }
.exec-photo-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.exec-photo-btn { cursor: pointer; position: relative; overflow: hidden; }

/* ================================================================
   DASHBOARD — CONFORMITY RING
   ================================================================ */
.dash-conformity { display: flex; align-items: center; gap: 22px; padding: 16px 20px; }
.conformity-ring {
    width: 110px; height: 110px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    position: relative; flex-shrink: 0;
}
.conformity-ring::before {
    content: ''; position: absolute;
    width: 76px; height: 76px; background: white; border-radius: 50%;
}
.conformity-value { position: relative; z-index: 1; font-size: 20px; font-weight: 800; line-height: 1; }
.conformity-info { flex: 1; min-width: 0; }
.conformity-label { font-size: 13.5px; font-weight: 700; color: var(--gray-800); margin-bottom: 3px; }
.conformity-sub   { font-size: 12px; color: var(--gray-500); margin-bottom: 12px; }
.sev-breakdown { display: flex; flex-direction: column; gap: 6px; }
.sev-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.sev-row > span:nth-child(2) { color: var(--gray-600); flex: 1; }
.sev-row strong { font-size: 14px; font-weight: 800; color: var(--gray-800); }
.sev-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.sev-dot.critical { background: #ef4444; }
.sev-dot.moderate { background: var(--warning); }
.sev-dot.cosmetic { background: #f59e0b; }

/* ================================================================
   REPORT DETAIL v2 — HERO CARD + SEVERITY
   ================================================================ */
.report-back-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.report-hero {
    background: linear-gradient(135deg, #0a0f1e 0%, #1e3a5f 100%);
    color: white; border-radius: var(--radius-xl); padding: 28px 32px;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    margin-bottom: 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.28); flex-wrap: wrap;
}
.report-hero-left { flex: 1; min-width: 200px; }
.report-hero-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,0.45); margin-bottom: 8px; }
.report-hero-title { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.2; margin-bottom: 16px; }
.report-hero-meta { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.report-hero-meta span { font-size: 12.5px; color: rgba(255,255,255,0.68); display: flex; align-items: center; gap: 5px; }
.report-hero-meta i { color: rgba(255,255,255,0.35); font-size: 11px; }
.report-hero-right { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.report-hero-ring {
    width: 110px; height: 110px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; position: relative;
}
.report-hero-ring::before {
    content: ''; position: absolute;
    width: 76px; height: 76px; background: rgba(255,255,255,0.08); border-radius: 50%;
}
.report-hero-ring .conformity-value { color: white; font-size: 20px; font-weight: 800; position: relative; z-index: 1; }
.report-conformity-label { font-size: 10.5px; color: rgba(255,255,255,0.5); font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; }

.report-kpi-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.kpi-card {
    flex: 1; min-width: 80px; background: white; border-radius: var(--radius-lg);
    border: 1.5px solid var(--gray-200); padding: 14px 12px; text-align: center;
    box-shadow: var(--shadow-sm);
}
.kpi-num { display: block; font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 5px; }
.kpi-card > span:last-child { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-500); }
.kpi-card.ok       { border-top: 3px solid var(--success); }    .kpi-card.ok       .kpi-num { color: var(--success); }
.kpi-card.critical { border-top: 3px solid #ef4444; }           .kpi-card.critical .kpi-num { color: #ef4444; }
.kpi-card.moderate { border-top: 3px solid var(--warning); }    .kpi-card.moderate .kpi-num { color: var(--warning); }
.kpi-card.cosmetic { border-top: 3px solid #f59e0b; }           .kpi-card.cosmetic .kpi-num { color: #f59e0b; }
.kpi-card.na       { border-top: 3px solid var(--gray-400); }   .kpi-card.na       .kpi-num { color: var(--gray-400); }

.issues-panel { background: white; border-radius: var(--radius-lg); border: 1.5px solid var(--gray-200); padding: 20px 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.issues-panel-title { font-size: 16px; font-weight: 800; color: var(--gray-900); margin-bottom: 16px; display: flex; align-items: center; gap: 9px; }
.issues-panel-title i { color: var(--danger); }
.issues-group { margin-bottom: 14px; border-radius: var(--radius); overflow: hidden; border: 1.5px solid; }
.issues-group.critical { border-color: #fecaca; }
.issues-group.moderate { border-color: #fed7aa; }
.issues-group.cosmetic { border-color: #fde68a; }
.issues-group-header { padding: 8px 14px; font-size: 12px; font-weight: 800; display: flex; align-items: center; gap: 7px; text-transform: uppercase; letter-spacing: 0.6px; }
.issues-group.critical .issues-group-header { background: #fff5f5; color: #ef4444; }
.issues-group.moderate .issues-group-header { background: #fffbeb; color: var(--warning); }
.issues-group.cosmetic .issues-group-header { background: #fffde7; color: #b45309; }
.issue-item { padding: 11px 14px; border-top: 1px solid; background: white; }
.issues-group.critical .issue-item { border-color: #fecaca; }
.issues-group.moderate .issue-item { border-color: #fed7aa; }
.issues-group.cosmetic .issue-item { border-color: #fde68a; }
.issue-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--gray-400); margin-bottom: 2px; }
.issue-item-name { font-size: 13.5px; font-weight: 600; color: var(--gray-800); line-height: 1.4; }
.issue-item-notes { font-size: 12.5px; color: var(--gray-600); margin-top: 5px; display: flex; align-items: flex-start; gap: 5px; line-height: 1.5; }
.issue-item-notes i { color: var(--gray-400); flex-shrink: 0; margin-top: 2px; }

.report-sections-wrap { margin-bottom: 20px; }
.report-sections-wrap > h2 { font-size: 16px; font-weight: 800; color: var(--gray-900); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.report-sections-wrap > h2 i { color: var(--primary); }
.report-section { background: white; border-radius: var(--radius-lg); border: 1.5px solid var(--gray-200); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow-xs); }
.report-section h3 { background: var(--gray-50); padding: 11px 18px; font-size: 13.5px; font-weight: 700; color: var(--gray-800); border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; gap: 8px; }
.report-section h3 i { color: var(--primary); }
.report-items { display: flex; flex-direction: column; }
.report-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--gray-100); font-size: 13.5px; border-left: 3px solid transparent; }
.report-item:last-child { border-bottom: none; }
.report-item.ok       { border-left-color: var(--success); }
.report-item.critical { background: #fff9f9; border-left-color: #ef4444; }
.report-item.moderate { background: #fffdf4; border-left-color: var(--warning); }
.report-item.cosmetic { background: #fffef0; border-left-color: #f59e0b; }
.report-item.na       { background: var(--gray-50); border-left-color: var(--gray-300); opacity: 0.8; }
.report-item-status { width: 20px; flex-shrink: 0; margin-top: 1px; text-align: center; font-size: 14px; }
.report-item-name { font-weight: 600; color: var(--gray-800); line-height: 1.4; }
.report-item-notes { font-size: 12px; color: var(--gray-600); margin-top: 3px; display: flex; align-items: flex-start; gap: 5px; line-height: 1.5; }
.report-item-notes i { color: var(--gray-400); flex-shrink: 0; margin-top: 2px; }

/* Legacy report summary used in some renders */
.report-summary { margin-bottom: 20px; }
.report-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.report-stat { flex: 1; min-width: 80px; background: white; border-radius: var(--radius-lg); padding: 14px; text-align: center; border: 1.5px solid var(--gray-200); box-shadow: var(--shadow-sm); }
.report-stat-num { display: block; font-size: 26px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.report-stat > span:last-child { font-size: 11px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.report-stat.ok         .report-stat-num { color: var(--success); }
.report-stat.issue      .report-stat-num { color: var(--danger); }
.report-stat.na         .report-stat-num { color: var(--gray-400); }
.report-stat.conformity .report-stat-num { color: var(--primary); }

.report-signatures { background: white; border-radius: var(--radius-lg); border: 1.5px solid var(--gray-200); padding: 20px 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.report-signatures h3 { font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--gray-800); display: flex; align-items: center; gap: 8px; }
.signatures-row { display: flex; gap: 16px; flex-wrap: wrap; }
.sig-display { flex: 1; min-width: 180px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 12px; text-align: center; }
.sig-display img { max-height: 90px; max-width: 100%; display: block; margin: 0 auto; }
.sig-display p { font-size: 12px; color: var(--gray-500); margin-top: 8px; font-weight: 600; border-top: 1px solid var(--gray-300); padding-top: 6px; }

.report-comments { background: white; border-radius: var(--radius-lg); border: 1.5px solid var(--gray-200); padding: 20px 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.report-comments h3 { font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--gray-800); display: flex; align-items: center; gap: 8px; }
.report-comments h3 i { color: var(--primary); }
.comment { background: var(--gray-50); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; border-left: 3px solid var(--primary-muted); }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.comment-header strong { font-size: 13px; font-weight: 700; color: var(--gray-800); }
.comment-header > span:not(.status-badge) { font-size: 11.5px; color: var(--gray-400); }
.comment p { font-size: 13.5px; color: var(--gray-700); line-height: 1.6; margin: 0; }
.comment-form { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }

/* ================================================================
   CLIENT PORTAL
   ================================================================ */
.client-portal-header {
    background: linear-gradient(135deg, #0a0f1e 0%, #1a2f5a 100%);
    padding: 15px 24px; display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 16px rgba(0,0,0,0.3); color: white;
}
.client-portal-logo { font-size: 17px; font-weight: 800; color: white; display: flex; align-items: center; gap: 8px; letter-spacing: -0.3px; }
.client-portal-logo i { color: #60a5fa; }
.client-portal-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: rgba(255,255,255,0.78); }
.client-content { max-width: 860px; margin: 0 auto; padding: 28px 20px; }
.client-content h2 { font-size: 20px; font-weight: 800; color: var(--gray-900); margin-bottom: 20px; letter-spacing: -0.3px; }
.client-content h3 { font-size: 15px; font-weight: 700; color: var(--gray-700); margin-bottom: 12px; }
.client-reports-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.client-report-card {
    background: white; border-radius: var(--radius-lg);
    border: 1.5px solid var(--gray-200); padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    cursor: pointer; transition: var(--transition); box-shadow: var(--shadow-xs);
}
.client-report-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-muted); transform: translateY(-2px); }
.client-report-card.pending { cursor: default; opacity: 0.75; }
.client-report-card.pending:hover { box-shadow: var(--shadow-xs); transform: none; }
.client-report-info h4 { font-size: 14.5px; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.client-report-info p { font-size: 12.5px; color: var(--gray-500); display: flex; align-items: center; gap: 5px; margin-bottom: 2px; }
.client-report-info i { color: var(--gray-400); font-size: 11px; }
.client-report-badge { min-width: 58px; height: 58px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; flex-shrink: 0; }

/* ================================================================
   PRINT STYLESHEET
   ================================================================ */
@media print {
    body { background: white !important; font-size: 12px; }
    .sidebar, .exec-topbar-actions, .report-back-bar, .comment-form,
    #toast-container, .loading-overlay, .btn-secondary, .page-header .btn { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 16px !important; }
    .page { display: block !important; opacity: 1 !important; }
    .report-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; page-break-inside: avoid; }
    .kpi-card, .report-section, .issues-group, .report-signatures { page-break-inside: avoid; }
    .report-kpi-row { page-break-before: auto; }
    .issues-panel { page-break-before: auto; }
    .photo-thumb { max-width: 60px; max-height: 60px; }
    @page { margin: 15mm; size: A4; }
}
