/* ==========================================================================
   ISO 9001 Multi-Tenant Form Yönetim Sistemi - Core Design System (CSS)
   Aydınlık (Light) & Karanlık (Dark) Tema Destekli Ultra-Modern Tasarım
   ========================================================================== */

:root {
    /* Color Palette - Light Mode */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-subtle: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-color: #e2e8f0;
    --border-subtle: #cbd5e1;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.1);
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

    --accent-cyan: #0284c7;
    --accent-emerald: #059669;
    --accent-amber: #d97706;
    --accent-rose: #e11d48;

    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: #1e293b;
    --sidebar-active: #312e81;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.35);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --header-height: 68px;
    --sidebar-width: 260px;
}

[data-theme="dark"] {
    /* Color Palette - Dark Mode */
    --bg-main: #090d16;
    --bg-card: #131926;
    --bg-card-subtle: #1c2438;
    --bg-glass: rgba(19, 25, 38, 0.85);
    --border-color: #232d42;
    --border-subtle: #334155;

    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --sidebar-bg: #0b0f19;
    --sidebar-hover: #172033;
    --sidebar-active: #4338ca;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.45);
}

/* Base & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Layout Wrapper */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo-icon {
    width: 38px;
    height: 38px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    box-shadow: var(--shadow-glow);
}

.sidebar-brand-text {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: 11px;
    color: #818cf8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    list-style: none;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 12px 6px;
}

.sidebar-menu-item {
    margin-bottom: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-link.active {
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.sidebar-badge {
    margin-left: auto;
    background-color: var(--accent-rose);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Main Content Area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
}

/* Navbar */
.app-navbar {
    height: var(--header-height);
    background-color: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Action Icon Buttons */
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

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

.btn-icon .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: var(--accent-rose);
    border-radius: 50%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.2;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-card-subtle);
    border-color: var(--border-subtle);
}

.btn-success {
    background-color: var(--accent-emerald);
    color: #ffffff;
}

.btn-danger {
    background-color: var(--accent-rose);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* Content Body */
.app-content {
    padding: 28px;
    flex: 1;
}

/* Metric Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
}

.stat-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* Card */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
}

.card-body {
    padding: 24px;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.custom-table th {
    background-color: var(--bg-card-subtle);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.custom-table tr:hover td {
    background-color: var(--bg-card-subtle);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background-color: rgba(5, 150, 105, 0.15); color: #10b981; }
.badge-warning { background-color: rgba(217, 119, 6, 0.15); color: #f59e0b; }
.badge-danger { background-color: rgba(225, 29, 72, 0.15); color: #f43f5e; }
.badge-primary { background-color: rgba(79, 70, 229, 0.15); color: #6366f1; }
.badge-info { background-color: rgba(2, 132, 199, 0.15); color: #0ea5e9; }

/* Form Controls */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background-color: var(--bg-card);
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

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

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: toastSlideIn 0.3s ease;
}

.toast.success { border-left-color: var(--accent-emerald); }
.toast.error { border-left-color: var(--accent-rose); }
.toast.warning { border-left-color: var(--accent-amber); }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Impersonation Banner */
.superadmin-impersonation-bar {
    background: linear-gradient(90deg, #78350f 0%, #b45309 100%);
    color: #fef3c7;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid #d97706;
    z-index: 95;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.app-content.no-padding {
    padding: 0 !important;
}

/* Modal Wide & Fullscreen Modifiers */
.modal-container.modal-lg {
    max-width: 900px;
}

.modal-container.modal-xl {
    max-width: 1200px;
    width: 95vw;
}

/* Print & A4 PDF Output Styles (Öneri 3) */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .app-sidebar, .app-navbar, .superadmin-impersonation-bar, .modal-footer, .btn, .navbar-actions, #toast-container, .no-print {
        display: none !important;
    }
    .app-container, .app-main, .app-content {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        min-height: auto !important;
    }
    .form-sheet {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        margin: 0 auto !important;
        width: 100% !important;
        page-break-after: always;
    }
}

/* ==========================================================================
   Visual Icon Picker & Color Swatches Component
   ========================================================================== */
.icon-picker-container {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
}

.icon-picker-search {
    margin-bottom: 10px;
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding: 4px;
}

.icon-picker-item {
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.icon-picker-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.icon-picker-item.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.color-swatches-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.color-swatch-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.color-swatch-btn:hover {
    transform: scale(1.15);
}

.color-swatch-btn.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--primary);
    transform: scale(1.1);
}

.category-live-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.category-preview-badge {
    padding: 8px 14px;
    border-radius: 20px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

/* Planlama & Takvim Yönetimi Stilleri */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.plan-card.status-completed {
    border-left: 5px solid #10b981;
}

.plan-card.status-planned {
    border-left: 5px solid #6366f1;
}

.plan-card.status-overdue {
    border-left: 5px solid #ef4444;
}

.plan-card.status-cancelled {
    border-left: 5px solid #64748b;
    opacity: 0.7;
}

.plan-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-type-training { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.plan-type-audit { background: rgba(2, 132, 199, 0.15); color: #38bdf8; border: 1px solid rgba(2, 132, 199, 0.3); }
.plan-type-maintenance { background: rgba(217, 119, 6, 0.15); color: #fbbf24; border: 1px solid rgba(217, 119, 6, 0.3); }
.plan-type-action { background: rgba(225, 29, 72, 0.15); color: #fb7185; border: 1px solid rgba(225, 29, 72, 0.3); }
.plan-type-general { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }

.plan-date-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin: 14px 0;
}

.plan-date-item {
    display: flex;
    flex-direction: column;
}

.plan-date-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.plan-date-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.plan-days-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.days-today { background: #ef4444; color: #fff; animation: pulse 2s infinite; }
.days-approaching { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.4); }
.days-overdue { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.4); }
.days-completed { background: rgba(16, 185, 129, 0.15); color: #10b981; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ==========================================================================
   ISO 9001 DİF (CAPA) & Balık Kılçığı (Ishikawa 6M) Component Styles
   ========================================================================== */
.dif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.dif-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border-left: 4px solid var(--primary);
}

.dif-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.4);
}

.dif-card.status-closed { border-left-color: #10b981; }
.dif-card.status-overdue { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.02); }
.dif-card.status-eval-pending { border-left-color: #f59e0b; }

.fishbone-diagram-container {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 20px 0;
    position: relative;
    overflow-x: auto;
}

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

.fishbone-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.fishbone-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
    font-weight: 700;
    font-size: 13px;
}

.fishbone-tag-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    min-height: 40px;
}

.fishbone-tag-item {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.fishbone-tag-item .btn-remove-tag {
    color: #ef4444;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.fishbone-tag-item .btn-remove-tag:hover {
    opacity: 1;
}

.five-why-container {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
}

.five-why-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.five-why-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

/* Compliance Report Styles */
.compliance-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.compliance-matrix th, .compliance-matrix td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.compliance-matrix th {
    background: var(--bg-card-subtle);
    font-weight: 700;
    color: var(--text-muted);
}

.row-missing {
    background: rgba(239, 68, 68, 0.06) !important;
}

.row-partial {
    background: rgba(245, 158, 11, 0.05) !important;
}

.row-completed {
    background: rgba(16, 185, 129, 0.04) !important;
}

/* Responsive Mobile Rules */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s ease;
    }
    .app-sidebar.mobile-open {
        left: 0;
    }
    .app-navbar {
        padding: 0 16px;
    }
    .app-content {
        padding: 16px;
    }
    .plan-grid, .dif-grid, .fishbone-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Thermal Barcode & Quality Control Label Printer Styles
   ========================================================================== */
.thermal-label-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #1e293b;
    border-radius: var(--radius-md);
    margin: 16px 0;
}

.thermal-label-box {
    background: #ffffff;
    color: #000000;
    font-family: 'Inter', -apple-system, sans-serif;
    border: 2px solid #000000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

.thermal-size-50x30 {
    width: 300px;
    height: 180px;
    padding: 8px 10px;
}

.thermal-size-80x50 {
    width: 440px;
    height: 275px;
    padding: 12px 14px;
}

.thermal-size-100x70 {
    width: 520px;
    height: 360px;
    padding: 16px 18px;
}

.thermal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000000;
    padding-bottom: 6px;
}

.thermal-brand {
    font-weight: 900;
    font-size: 14px;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.thermal-status-stamp {
    background: #000000;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.thermal-body {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 6px 0;
    flex: 1;
}

.thermal-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
}

.thermal-info-item strong {
    font-weight: 800;
}

.thermal-qr-col {
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
}

.thermal-barcode-line {
    border-top: 1px dashed #000000;
    padding-top: 4px;
    text-align: center;
    font-family: monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
}

/* Pure Thermal Print Mode */
@media print {
    body * {
        visibility: hidden;
    }
    #thermal-print-area, #thermal-print-area * {
        visibility: visible;
    }
    #thermal-print-area {
        position: fixed;
        left: 0;
        top: 0;
        margin: 0;
        padding: 0;
        background: #ffffff !important;
        border: none !important;
        box-shadow: none !important;
    }
    .modal-overlay, .modal-header, .modal-footer, .btn, .sidebar, .app-navbar {
        display: none !important;
    }
}


