/* ============================================
   ProERP — Kurumsal Kaynak Planlama Sistemi
   Premium Design System
   ============================================ */

:root {
    --erp-primary: #6366f1;
    --erp-primary-dark: #4f46e5;
    --erp-primary-light: #818cf8;
    --erp-secondary: #0ea5e9;
    --erp-success: #10b981;
    --erp-warning: #f59e0b;
    --erp-danger: #ef4444;
    --erp-info: #06b6d4;
    --erp-dark: #0f172a;
    --erp-sidebar-bg: #1e293b;
    --erp-sidebar-width: 260px;
    --erp-body-bg: #f1f5f9;
    --erp-card-bg: #ffffff;
    --erp-text: #334155;
    --erp-text-muted: #94a3b8;
    --erp-border: #e2e8f0;
    --erp-radius: 12px;
    --erp-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --erp-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
    --erp-transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--erp-body-bg);
    color: var(--erp-text);
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   SIDEBAR
   ============================================ */
.erp-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--erp-sidebar-width);
    background: var(--erp-sidebar-bg);
    color: #cbd5e1;
    z-index: 1050;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
}

.erp-sidebar-content {
    padding: 0;
}

.erp-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 20px;
    color: #fff;
}

.erp-sidebar-brand i {
    font-size: 24px;
    color: var(--erp-primary-light);
}

.erp-sidebar-brand small {
    font-size: 10px;
    background: rgba(99, 102, 241, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--erp-primary-light);
    margin-left: auto;
}

.erp-sidebar-brand .erp-sidebar-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    margin-left: auto;
}

/* Sidebar user */
.erp-sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.erp-sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--erp-primary), var(--erp-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.erp-sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.erp-sidebar-user-role {
    font-size: 11px;
    color: var(--erp-text-muted);
}

/* Navigation */
.erp-nav {
    padding: 8px 0;
}

.erp-nav-section {
    padding: 16px 20px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #64748b;
    text-transform: uppercase;
}

.erp-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--erp-transition);
    border-left: 3px solid transparent;
}

.erp-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.erp-nav-link.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.15);
    border-left-color: var(--erp-primary);
}

.erp-nav-link i {
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.erp-nav-divider {
    margin: 8px 20px;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Sidebar toggle mobile */
.erp-sidebar-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1060;
    background: var(--erp-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--erp-shadow-lg);
}

.erp-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: var(--erp-transition);
}

.erp-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.erp-main {
    margin-left: var(--erp-sidebar-width);
    padding: 24px;
    min-height: 100vh;
}

/* ============================================
   HEADER BAR
   ============================================ */
.erp-header {
    background: linear-gradient(135deg, var(--erp-primary) 0%, #7c3aed 100%);
    color: #fff;
    padding: 24px 28px;
    border-radius: var(--erp-radius);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    z-index: 0;
}

.erp-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

.erp-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.erp-header p {
    opacity: 0.85;
    margin: 4px 0 0;
    font-size: 13px;
}

/* ============================================
   CARDS
   ============================================ */
.erp-card {
    background: var(--erp-card-bg);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    box-shadow: var(--erp-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.erp-card .card-header {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--erp-border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.erp-card .card-body {
    padding: 20px;
}

/* ============================================
   KPI STAT CARDS
   ============================================ */
.erp-stat {
    background: var(--erp-card-bg);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--erp-transition);
}

.erp-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--erp-shadow-lg);
}

.erp-stat::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--erp-primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.erp-stat:hover::after {
    opacity: 1;
}

.erp-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.erp-stat-icon.purple {
    background: rgba(99, 102, 241, 0.1);
    color: var(--erp-primary);
}

.erp-stat-icon.blue {
    background: rgba(14, 165, 233, 0.1);
    color: var(--erp-secondary);
}

.erp-stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--erp-success);
}

.erp-stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--erp-warning);
}

.erp-stat-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--erp-danger);
}

.erp-stat-icon.cyan {
    background: rgba(6, 182, 212, 0.1);
    color: var(--erp-info);
}

.erp-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--erp-dark);
    line-height: 1.2;
}

.erp-stat-label {
    font-size: 12px;
    color: var(--erp-text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================
   TABLES
   ============================================ */
.erp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.erp-table thead th {
    background: #f8fafc;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--erp-border);
}

.erp-table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.erp-table tbody tr:hover {
    background: #f8fafc;
}

.erp-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES
   ============================================ */
.erp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.erp-badge.green {
    background: #dcfce7;
    color: #166534;
}

.erp-badge.red {
    background: #fee2e2;
    color: #991b1b;
}

.erp-badge.yellow {
    background: #fef3c7;
    color: #92400e;
}

.erp-badge.blue {
    background: #dbeafe;
    color: #1e40af;
}

.erp-badge.gray {
    background: #f1f5f9;
    color: #475569;
}

/* ============================================
   BUTTONS
   ============================================ */
.erp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--erp-transition);
    text-decoration: none;
    position: relative;
    z-index: 2;
}

.erp-btn-primary {
    background: var(--erp-primary);
    color: #fff;
}

.erp-btn-primary:hover {
    background: var(--erp-primary-dark);
    color: #fff;
}

.erp-btn-secondary {
    background: #f1f5f9;
    color: var(--erp-text);
    border: 1px solid var(--erp-border);
}

.erp-btn-secondary:hover {
    background: #e2e8f0;
    color: var(--erp-text);
}

.erp-btn-success {
    background: var(--erp-success);
    color: #fff;
}

.erp-btn-danger {
    background: var(--erp-danger);
    color: #fff;
}

/* ============================================
   FORM CONTROLS
   ============================================ */
.erp-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--erp-border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    transition: var(--erp-transition);
    background: #fff;
}

.erp-input:focus {
    outline: none;
    border-color: var(--erp-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.erp-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--erp-text);
    margin-bottom: 6px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.erp-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    padding: 20px;
}

.erp-login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.erp-login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.erp-login-logo i {
    font-size: 48px;
    color: var(--erp-primary);
    margin-bottom: 12px;
    display: block;
}

.erp-login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--erp-dark);
    margin: 0;
}

.erp-login-logo p {
    color: var(--erp-text-muted);
    font-size: 14px;
    margin: 4px 0 0;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.erp-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--erp-text-muted);
}

.erp-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.erp-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--erp-text);
    margin: 0 0 8px;
}

.erp-empty p {
    font-size: 13px;
    margin: 0;
}

/* ============================================
   CHART
   ============================================ */
.erp-chart-container {
    position: relative;
    height: 300px;
    padding: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 767.98px) {
    .erp-sidebar {
        transform: translateX(-100%);
    }

    .erp-sidebar.active {
        transform: translateX(0);
    }

    .erp-main {
        margin-left: 0;
        padding: 16px;
        padding-top: 60px;
    }

    .erp-header h1 {
        font-size: 18px;
    }

    .erp-stat-value {
        font-size: 20px;
    }
}

@media (min-width: 768px) {

    .erp-sidebar-toggle,
    .erp-sidebar-overlay,
    .erp-sidebar-close {
        display: none !important;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
.erp-sidebar::-webkit-scrollbar {
    width: 4px;
}

.erp-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.erp-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* ============================================
   ANIMATION
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.erp-card,
.erp-stat {
    animation: fadeIn 0.3s ease;
}