/* MBFsoft - NIDEC Employee Improvement & Observation System */
/* Modern Enterprise Industrial UI */

:root {
    --nidec-primary: #0284c7;
    --nidec-primary-hover: #0369a1;
    --nidec-dark: #0f172a;
    --nidec-sidebar-bg: #0f172a;
    --nidec-sidebar-hover: #1e293b;
    --nidec-sidebar-active: #2563eb;
    --nidec-sidebar-text: #94a3b8;
    --nidec-body-bg: #f8fafc;
    --nidec-card-bg: #ffffff;
    --nidec-border: #e2e8f0;
}

body {
    background-color: var(--nidec-body-bg);
    color: #334155;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

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

/* Sidebar */
.app-sidebar {
    width: 260px;
    background: var(--nidec-sidebar-bg);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1040;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.sidebar-brand .brand-logo-img {
    max-height: 42px;
    max-width: 130px;
    object-fit: contain;
    border-radius: 4px;
}

.sidebar-brand .brand-text {
    line-height: 1.2;
}

.sidebar-brand .brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.sidebar-brand .brand-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-cta {
    padding: 1rem 1.25rem 0.5rem;
}

.btn-new-ticket {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}

.btn-new-ticket:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.75rem;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.35rem;
    font-weight: 700;
}

.sidebar-nav .nav-link {
    color: var(--nidec-sidebar-text);
    padding: 0.65rem 0.85rem;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

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

.sidebar-nav .nav-link.active {
    color: #ffffff;
    background: var(--nidec-sidebar-active);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

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

.sidebar-user .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #334155;
    color: #93c5fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.sidebar-user .user-info {
    flex: 1;
    overflow: hidden;
    line-height: 1.25;
}

.sidebar-user .user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Main Content Area */
.app-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: calc(100% - 260px);
    background-color: var(--nidec-body-bg);
}

/* Topbar */
.app-topbar {
    height: 64px;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid var(--nidec-border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle-btn {
    border: none;
    background: transparent;
    font-size: 1.3rem;
    color: #475569;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    line-height: 1;
}

.sidebar-toggle-btn:hover {
    background: #f1f5f9;
}

.plant-badge {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 0.8rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Page Content */
.app-content {
    flex: 1 0 auto;
    width: 100%;
    padding: 1.5rem 1.75rem;
}

/* Footer */
.app-footer {
    background: #ffffff;
    border-top: 1px solid var(--nidec-border);
    padding: 0.85rem 1.5rem;
    font-size: 0.82rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mbf-badge {
    color: #0284c7;
    font-weight: 600;
    text-decoration: none;
}

/* Cards & UI Elements */
.card-enterprise {
    background: #ffffff;
    border: 1px solid var(--nidec-border);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-enterprise .card-header {
    background: #ffffff;
    border-bottom: 1px solid var(--nidec-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-enterprise .card-body {
    padding: 1.25rem;
}

/* KPI Cards */
.kpi-card {
    background: #ffffff;
    border: 1px solid var(--nidec-border);
    border-radius: 10px;
    padding: 1.15rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    height: 100%;
    min-height: 96px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.kpi-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.kpi-card.kpi-blue::before { background: #2563eb; }
.kpi-card.kpi-yellow::before { background: #f59e0b; }
.kpi-card.kpi-indigo::before { background: #6366f1; }
.kpi-card.kpi-green::before { background: #10b981; }
.kpi-card.kpi-red::before { background: #ef4444; }
.kpi-card.kpi-purple::before { background: #8b5cf6; }

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.kpi-blue .kpi-icon { background: #eff6ff; color: #2563eb; }
.kpi-yellow .kpi-icon { background: #fef3c7; color: #d97706; }
.kpi-indigo .kpi-icon { background: #e0e7ff; color: #4f46e5; }
.kpi-green .kpi-icon { background: #d1fae5; color: #059669; }
.kpi-red .kpi-icon { background: #fee2e2; color: #dc2626; }
.kpi-purple .kpi-icon { background: #ede9fe; color: #7c3aed; }

.kpi-details {
    overflow: hidden;
    min-width: 0;
}

.kpi-details .kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.kpi-details .kpi-label {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Critical Safety Highlight */
.kpi-critical-safety {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    border: 1px solid #fecdd3;
    animation: softPulse 2.5s infinite;
}

@keyframes softPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(225, 29, 72, 0); }
}

/* Prioritás Badgek */
.badge-priority-critical {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
    font-weight: 600;
}

.badge-priority-high {
    background-color: #ffedd5;
    color: #9a3412;
    border: 1px solid #fb923c;
    font-weight: 600;
}

.badge-priority-medium {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    font-weight: 600;
}

.badge-priority-low {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    font-weight: 600;
}

.bg-purple {
    background-color: #8b5cf6 !important;
}

/* osTicket-stílusú adatáblázat */
.table-osticket {
    width: 100%;
    margin-bottom: 0;
    vertical-align: middle;
}

.table-osticket thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--nidec-border);
    white-space: nowrap;
}

.table-osticket tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.88rem;
}

.table-osticket tbody tr:hover td {
    background-color: #f8fafc;
}

.table-ticket-code {
    font-family: monospace;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.92rem;
}

.table-ticket-code:hover {
    text-decoration: underline;
}

/* Timeline Stílus */
.status-timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 1rem;
}

.status-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: #cbd5e1;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #2563eb;
    box-shadow: 0 0 0 2px #eff6ff;
}

.timeline-content {
    background: #f8fafc;
    border: 1px solid var(--nidec-border);
    border-radius: 8px;
    padding: 0.85rem 1rem;
}

/* Fotók és kép előnézetek */
.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.attachment-thumb-card {
    border: 1px solid var(--nidec-border);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.attachment-thumb-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.attachment-thumb-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.attachment-thumb-name {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #ffffff;
    color: #475569;
    border-top: 1px solid #f1f5f9;
}

/* Mobil reszponzivitás */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
    }

    .app-sidebar.show {
        left: 0;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    }

    .app-main {
        width: 100% !important;
    }

    .app-content {
        padding: 1rem;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.5);
        z-index: 1035;
        display: none;
    }

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

/* Admin segédosztályok */
.bg-purple {
    background-color: #8b5cf6 !important;
}

.bg-purple-subtle {
    background-color: #ede9fe !important;
}

.text-purple {
    color: #7c3aed !important;
}

.nav-pills .nav-link {
    color: #475569;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-pills .nav-link:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.nav-pills .nav-link.active {
    background-color: var(--nidec-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

