/* ============================================
   ERPAMA Platform - Main Stylesheet
   Centralized CSS Management
   ============================================ */

/* ─── CSS Variables ─── */
:root {
    --sidebar-width: 260px;
    --header-height: 60px;
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --accent: #8b5cf6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --gray-50: #f8fafc;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1);
    --transition: 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--gray-50);
}

/* ─── Sidebar ─── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
    color: white;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-menu {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
}

.menu-header {
    padding: 10px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
}

.sidebar-menu .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-menu .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.sidebar-menu .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.15);
    border-left-color: #818cf8;
}

.sidebar-menu .nav-link i {
    width: 24px;
    margin-right: 12px;
}

/* ─── Main Layout ─── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-content {
    padding: 24px;
}

/* ─── Page Headers ─── */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* ─── Cards ─── */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
    font-weight: 600;
}

.hover-shadow {
    transition: all var(--transition);
}

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

/* ─── Tables ─── */
.table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    border-bottom-width: 1px;
}

/* ─── Mobile Menu Overlay ─── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

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

/* ─── Hamburger Button ─── */
.mobile-hamburger {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--gray-100);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: background var(--transition);
    padding: 0;
}

.mobile-hamburger:hover,
.mobile-hamburger:active {
    background: var(--gray-200);
}

.hamburger-icon {
    width: 20px;
    height: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-hamburger.active .hamburger-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-hamburger.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-hamburger.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ─── Sidebar Close Button (mobile only) ─── */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255,255,255,0.15);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
    transition: background var(--transition);
    z-index: 10;
}

.sidebar-close-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* ─── Language Switcher ─── */
.lang-switcher {
    display: inline-flex;
    gap: 4px;
    padding: 2px;
    background: var(--gray-100);
    border-radius: 6px;
}

.lang-switcher button {
    border: none;
    background: transparent;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: var(--gray-500);
    transition: all var(--transition);
}

.lang-switcher button.active {
    background: white;
    color: var(--gray-800);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.lang-switcher-sidebar {
    border-top: 1px solid rgba(255,255,255,0.1);
}

.lang-switcher-sidebar .lang-switcher {
    background: rgba(255,255,255,0.1);
    width: 100%;
    display: flex;
}

.lang-switcher-sidebar .lang-switcher button {
    flex: 1;
    color: rgba(255,255,255,0.6);
}

.lang-switcher-sidebar .lang-switcher button.active {
    background: rgba(255,255,255,0.2);
    color: white;
    box-shadow: none;
}

/* ─── Responsive ─── */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
    }
    .sidebar-close-btn {
        display: flex !important;
    }
    .main-content {
        padding: 16px;
    }
    .top-header {
        padding: 0 16px;
    }
}
