/* ==========================================================================
   ISGCORE ENTERPRISE SAAS DESIGN SYSTEM - OFFICIAL OHS LIGHT SAFETY THEME
   (FERAH, AYDINLIK & MODERN İSG GÜVENLİK YEŞİLİ & İKAZ RENKLERİ)
   ========================================================================== */

:root {
    --bg-main: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-topbar: #FFFFFF;
    
    --primary: #059669; /* TSE & ISO 7010 Resmi İSG Güvenlik Yeşili */
    --primary-hover: #047857;
    --primary-light: #ECFDF5;
    --primary-border: #A7F3D0;
    
    --isg-green: #059669; /* İlk Yardım, Güvenli Alan & Onay */
    --isg-yellow: #EAB308; /* Dikkat, İkaz & Baret Sarısı */
    --isg-orange: #EA580C; /* Şantiye, İş Makinesi & Tehlike */
    --isg-red: #DC2626; /* Acil Müdahale, Yangın & DÖF */
    --isg-blue: #0284C7; /* KKD Zorunluluk Bilgilendirme */
    
    --accent-orange: #EA580C;
    --accent-red: #DC2626;
    --accent-green: #059669;
    --accent-yellow: #EAB308;
    --accent-purple: #7C3AED;
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-light: #0F172A;
    
    --border-subtle: #E2E8F0;
    --border-hover: #CBD5E1;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 2px 10px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 8px 22px rgba(15, 23, 42, 0.08);
    
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --transition-fast: 0.18s ease;
}

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

body.isg-theme {
    font-family: var(--font-body);
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ==========================================================================
   TOPBAR (LIGHT & CRISP)
   ========================================================================== */

.isg-topbar {
    background: #FFFFFF;
    color: var(--text-primary);
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.isg-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-badge-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
    border: 1px solid rgba(167, 243, 208, 0.5);
}

.brand-titles {
    display: flex;
    flex-direction: column;
}

.brand-logo-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #0F172A;
}

.accent-green {
    color: #059669;
}

.accent-orange {
    color: #EA580C;
}

.version-tag {
    font-size: 0.65rem;
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    font-weight: 700;
}

.brand-sub-tag {
    font-size: 0.65rem;
    color: #059669;
    letter-spacing: 0.8px;
    font-weight: 700;
}

.firm-selector-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 6px 14px;
    border-radius: var(--radius-md);
}

.firm-icon {
    font-size: 1.25rem;
}

.firm-info label {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    color: #64748B;
    letter-spacing: 0.5px;
}

.firm-info select {
    background: transparent;
    border: none;
    color: #0F172A;
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
}

.firm-info select option {
    background: #FFFFFF;
    color: #0F172A;
}

.urgent-alert-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    color: #991B1B;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.urgent-alert-pill:hover {
    background: #FEE2E2;
}

.pulse-dot-red {
    width: 8px;
    height: 8px;
    background: #EF4444;
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulseRed 1.8s infinite;
}

@keyframes pulseRed {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.pulse-dot-green {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    display: inline-block;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
    border-left: 1px solid #E2E8F0;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #059669;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0F172A;
}

.user-role {
    font-size: 0.72rem;
    color: #059669;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all var(--transition-fast);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.82rem;
}

.btn-primary {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

.btn-warning {
    background: var(--accent-orange);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}
.btn-warning:hover {
    background: #C2410C;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: #F8FAFC;
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ==========================================================================
   LAYOUT: SIDEBAR & MAIN CONTENT (LIGHT & CRISP)
   ========================================================================== */

.isg-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 72px);
}

.isg-sidebar {
    width: 280px;
    background: #FFFFFF;
    color: #334155;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 14px;
    flex-shrink: 0;
    border-right: 1px solid #E2E8F0;
    box-shadow: 1px 0 3px rgba(15, 23, 42, 0.02);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background: #ECFDF5;
    color: #059669;
}

.nav-item.active {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.nav-icon {
    font-size: 1.15rem;
}

.nav-label {
    flex-grow: 1;
}

.nav-badge-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.nav-badge-pill.green { background: #DCFCE7; color: #15803D; }
.nav-badge-pill.orange { background: #FFEDD5; color: #C2410C; }
.nav-badge-pill.red { background: #FEE2E2; color: #DC2626; }
.nav-badge-pill.blue { background: #E0F2FE; color: #0369A1; }
.nav-badge-pill.purple { background: #F3E8FF; color: #7E22CE; }

.nav-item.active .nav-badge-pill {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.sidebar-status-card {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: var(--radius-md);
    padding: 14px;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #065F46;
    margin-bottom: 4px;
}

.sidebar-status-card p {
    font-size: 0.72rem;
    color: #047857;
    margin-bottom: 8px;
}

.ibys-sync-time {
    font-size: 0.68rem;
    color: #059669;
    font-weight: 700;
}

/* ==========================================================================
   CONTENT VIEWPORT
   ========================================================================== */

.isg-content {
    flex: 1;
    padding: 30px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.2s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.view-title {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: #0F172A;
}

.view-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-fast);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.kpi-icon-wrap {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.kpi-icon-wrap.blue { background: #E0F2FE; color: #0284C7; }
.kpi-icon-wrap.red { background: #FEE2E2; color: #EF4444; }
.kpi-icon-wrap.green { background: #DCFCE7; color: #10B981; }
.kpi-icon-wrap.orange { background: #FFEDD5; color: #EA580C; }
.kpi-icon-wrap.purple { background: #F3E8FF; color: #8B5CF6; }

.kpi-meta {
    display: flex;
    flex-direction: column;
}

.kpi-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 1.55rem;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.2;
    margin: 2px 0;
}

.kpi-sub {
    font-size: 0.74rem;
    font-weight: 600;
}
.kpi-sub.green { color: #059669; }
.kpi-sub.red { color: #DC2626; }
.kpi-sub.purple { color: #7C3AED; }

/* Dashboard Layout */
.dashboard-grid-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.panel-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 14px;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 1.12rem;
    font-weight: 700;
    color: #0F172A;
}

.panel-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.badge-tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}
.badge-tag.green { background: #DCFCE7; color: #15803D; }

/* Risk Summary Meters */
.risk-summary-meters {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 18px 0;
}

.meter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.84rem;
    font-weight: 600;
}

.meter-label {
    width: 210px;
    flex-shrink: 0;
}

.meter-bar {
    flex: 1;
    height: 10px;
    background: #E2E8F0;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: var(--radius-full);
}

.meter-row.red .meter-fill { background: #EF4444; }
.meter-row.orange .meter-fill { background: #EA580C; }
.meter-row.yellow .meter-fill { background: #F59E0B; }
.meter-row.green .meter-fill { background: #10B981; }

.meter-count {
    width: 55px;
    text-align: right;
    font-weight: 700;
}

.panel-footer-action {
    margin-top: 18px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 14px;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

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

.isg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.isg-table th {
    background: #F8FAFC;
    color: var(--text-secondary);
    padding: 12px 16px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-subtle);
}

.isg-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.isg-table tr:hover td {
    background: #F8FAFC;
}

.table-thumb-img {
    width: 50px;
    height: 38px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}
.status-badge.red { background: #FEE2E2; color: #DC2626; }
.status-badge.orange { background: #FFEDD5; color: #C2410C; }
.status-badge.green { background: #DCFCE7; color: #15803D; }
.status-badge.blue { background: #E0F2FE; color: #0369A1; }

.mt-4 {
    margin-top: 24px;
}

/* ==========================================================================
   5X5 RISK MATRIX
   ========================================================================== */

.matrix-interactive-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    text-align: center;
}

.matrix-card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 18px;
}

.matrix-grid-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.matrix-y-axis-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.matrix-board {
    display: grid;
    grid-template-columns: repeat(5, 75px);
    grid-template-rows: repeat(5, 55px);
    gap: 6px;
}

.matrix-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    color: #FFFFFF;
    cursor: pointer;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-subtle);
}

.matrix-cell:hover {
    transform: scale(1.08);
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.level-green { background: #10B981; }
.level-yellow { background: #EAB308; color: #0F172A; }
.level-orange { background: #EA580C; }
.level-red { background: #DC2626; }

.blink-cell {
    animation: blinkCrit 1.5s infinite;
}

@keyframes blinkCrit {
    0%, 100% { background: #DC2626; }
    50% { background: #991B1B; }
}

.matrix-x-axis-label {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 14px;
}

.filter-pills-row {
    display: flex;
    gap: 8px;
}

.pill-btn {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pill-btn.active, .pill-btn:hover {
    background: #0284C7;
    color: #FFFFFF;
    border-color: #0284C7;
}

/* ==========================================================================
   INCIDENT & NEAR-MISS CARDS
   ========================================================================== */

.incidents-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 22px;
}

.incident-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-fast);
}

.incident-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.incident-card-img-wrap {
    height: 190px;
    position: relative;
    overflow: hidden;
}

.incident-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.incident-badge-floating {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    color: #FFFFFF;
}
.incident-badge-floating.red { background: #DC2626; }
.incident-badge-floating.orange { background: #EA580C; }

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

.incident-location {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.incident-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0F172A;
}

.incident-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 14px;
}

.incident-meta-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ==========================================================================
   EQUIPMENT QR CARDS
   ========================================================================== */

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.equipment-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
}

.equipment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.equipment-code {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: #0F172A;
}

.equipment-qr-mini {
    width: 60px;
    height: 60px;
    background: #F8FAFC;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.equipment-specs {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

/* ==========================================================================
   TRAINING & CERTIFICATES
   ========================================================================== */

.training-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
}

.training-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.training-badge {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
}
.training-badge.red { background: #FEE2E2; color: #DC2626; }
.training-badge.orange { background: #FFEDD5; color: #C2410C; }
.training-badge.blue { background: #E0F2FE; color: #0284C7; }

.training-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.training-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
    flex-grow: 1;
}

.training-progress-row {
    margin-bottom: 16px;
}

.progress-bar-wrap {
    height: 8px;
    background: #E2E8F0;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: #10B981;
    border-radius: var(--radius-full);
}

.progress-text {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.training-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 14px;
    font-size: 0.82rem;
}

/* Documents Grid */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.doc-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-fast);
}

.doc-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

.doc-icon {
    font-size: 2rem;
}

.doc-info {
    flex: 1;
}

.doc-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: #0F172A;
}

.doc-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.doc-status.valid {
    font-size: 0.72rem;
    font-weight: 700;
    background: #DCFCE7;
    color: #15803D;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.isg-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6, 26, 20, 0.78);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.isg-modal-overlay.open {
    display: flex;
}

.isg-modal-content {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    padding: 28px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 14px;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #0F172A;
}

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

.modal-close:hover {
    color: #0F172A;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.form-group input, .form-group select, .form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18);
}

.photo-select-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 4px;
}

.photo-choice {
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
}

.photo-choice img {
    width: 100%;
    height: 75px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.photo-choice span {
    font-size: 0.75rem;
    font-weight: 600;
}

.photo-choice input {
    display: none;
}

.photo-choice:hover, .photo-choice.selected {
    border-color: #EA580C;
    background: #FFF7ED;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
}

/* QR Scanner Body */
.qr-scanner-body {
    text-align: center;
    padding: 20px 0;
}

.scanner-view-frame {
    width: 280px;
    height: 280px;
    background: #0F172A;
    margin: 0 auto 24px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.laser-scanner-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: #EF4444;
    box-shadow: 0 0 12px #EF4444;
    animation: scanMove 2s infinite ease-in-out;
}

@keyframes scanMove {
    0%, 100% { top: 10%; }
    50% { top: 90%; }
}

.scanner-hint {
    color: #94A3B8;
    font-size: 0.78rem;
    padding: 0 20px;
    z-index: 1;
}

.quick-sim-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

/* Printable Certificate Frame */
.certificate-modal-box {
    max-width: 820px;
}

.certificate-printable-frame {
    background: #FFFDF7;
    border: 8px double #B45309;
    padding: 24px;
    border-radius: var(--radius-sm);
    color: #1E293B;
}

.cert-border {
    border: 1px solid #D97706;
    padding: 24px;
    text-align: center;
}

.cert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #B45309;
    padding-bottom: 14px;
    margin-bottom: 18px;
}

.cert-flag {
    font-size: 2.2rem;
}

.cert-titles h3 {
    font-size: 0.95rem;
    letter-spacing: 1px;
    color: #9A3412;
}

.cert-titles h4 {
    font-size: 0.78rem;
    color: #475569;
    margin: 3px 0;
}

.cert-titles h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: #1E293B;
    letter-spacing: 0.5px;
}

.cert-text {
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 18px;
    text-align: justify;
}

.cert-user-info-box {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    text-align: left;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.86rem;
}

.cert-signatures {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    border-top: 1px dashed #CBD5E1;
    padding-top: 16px;
}

.sig-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.82rem;
}

.sig-qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#certQrCodeElement img {
    margin: 0 auto;
}

/* ==========================================================================
   ISHIKAWA ROOT CAUSE & 5-WHY STYLES
   ========================================================================== */

.ishikawa-container-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.ishikawa-header {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.ishikawa-diagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.fish-category-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    padding: 16px;
    border-top: 4px solid var(--primary);
}

.fish-category-card:nth-child(2) { border-top-color: #EA580C; }
.fish-category-card:nth-child(3) { border-top-color: #8B5CF6; }
.fish-category-card:nth-child(4) { border-top-color: #10B981; }

.cat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #0F172A;
}

.cat-causes {
    list-style: none;
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.five-why-box {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--radius-md);
    padding: 20px;
}

.why-step {
    font-size: 0.86rem;
    padding: 8px 12px;
    border-left: 3px solid #F59E0B;
    background: #FFFFFF;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 8px;
}

.why-step.root-cause {
    border-left-color: #EF4444;
    background: #FEF2F2;
    color: #991B1B;
    font-weight: 700;
}

/* ==========================================================================
   SAFETYCULTURE SMART CHECKLIST STYLES
   ========================================================================== */

.checklist-container-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.checklist-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F8FAFC;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin-bottom: 20px;
    font-size: 0.88rem;
}

.checklist-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checklist-item-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.checklist-item-row.pass {
    border-left: 4px solid #10B981;
    background: #FAFDFB;
}

.checklist-item-row.fail {
    border-left: 4px solid #EF4444;
    background: #FEF8F8;
}

.check-status-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    flex-shrink: 0;
}

.checklist-item-row.pass .check-status-icon { background: #DCFCE7; color: #15803D; }
.checklist-item-row.fail .check-status-icon { background: #FEE2E2; color: #DC2626; }

.check-content {
    flex: 1;
}

.check-content h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.check-content p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.check-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 1024px) {
    .isg-layout {
        flex-direction: column;
    }
    .isg-sidebar {
        width: 100%;
    }
    .dashboard-grid-layout {
        grid-template-columns: 1fr;
    }
}

