/* PIA ERP - Custom Styles (Bootstrap 5 overlay) */
:root {
    --pia-primary: #1e3a5f;
    --pia-primary-light: #2563eb;
    --pia-accent: #3b82f6;
    --pia-success: #10b981;
    --pia-warning: #f59e0b;
    --pia-danger: #ef4444;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;
}

* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

/* App Layout */
.app-container { display: flex; min-height: 100vh; }
.main-content { flex: 1; display: flex; flex-direction: column; margin-left: var(--sidebar-width); transition: margin-left 0.2s; }
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }
.page-container { flex: 1; padding: 24px; background: #f1f5f9; }

/* Sidebar */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width);
    background: var(--pia-primary); color: #cbd5e1; display: flex; flex-direction: column;
    transition: width 0.2s; z-index: 1050; overflow-x: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-footer { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 12px; }
.sidebar.collapsed .nav-link i { margin-right: 0; font-size: 1.2rem; }

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.1); height: var(--header-height);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
    width: 36px; height: 36px; background: var(--pia-accent); border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 14px;
}
.brand-text { font-weight: 600; color: #fff; font-size: 16px; }
.sidebar-toggle { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 4px; }
.sidebar-toggle:hover { color: #fff; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px;
    color: #94a3b8; text-decoration: none; font-size: 14px; font-weight: 500; transition: all 0.15s;
}
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,0.08); color: #e2e8f0; }
.sidebar-nav .nav-link.active { background: rgba(59,130,246,0.2); color: #60a5fa; }
.sidebar-nav .nav-link i { width: 20px; text-align: center; font-size: 15px; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.1); color: #64748b; font-size: 12px; }

/* Top Header */
.top-header {
    display: flex; align-items: center; justify-content: space-between;
    height: var(--header-height); padding: 0 24px; background: #fff;
    border-bottom: 1px solid #e2e8f0;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-icon-btn { background: none; border: none; color: #64748b; font-size: 18px; cursor: pointer; padding: 8px; border-radius: 8px; }
.header-icon-btn:hover { background: #f1f5f9; color: #1e293b; }

.user-dropdown { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.user-dropdown:hover { background: #f1f5f9; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%; background: #dbeafe; color: var(--pia-accent);
    display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
}
.user-info { line-height: 1.3; }
.user-name { font-size: 13px; font-weight: 600; color: #1e293b; }
.user-role { font-size: 11px; color: #94a3b8; }

/* Auth Pages */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f1f5f9; }
.auth-card { max-width: 420px; width: 100%; }

/* Cards */
.card { border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.card-header { background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-weight: 600; }

/* Tables */
.table th { font-weight: 600; color: #64748b; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 2px solid #e2e8f0; }
.table td { vertical-align: middle; color: #334155; font-size: 14px; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* Status badges */
.badge-status { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 20px; }

/* Risk badges */
.risk-low { background: #dcfce7; color: #166534; }
.risk-medium { background: #fef9c3; color: #854d0e; }
.risk-high { background: #fee2e2; color: #991b1b; }
.risk-critical { background: #991b1b; color: #fff; }

/* Mobile */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }
}
