/* ===== VARIABLES ===== */
:root {
    --primary-color: #1BA098;
    --primary-dark: #158f87;
    --primary-light: #e8f7f6;
    --secondary-color: #2c3e50;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    --sidebar-width: 280px;
    --header-height: 70px;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
    display: none;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-screen.active {
    display: flex;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo img {
    width: 180px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.2));
}

.login-logo h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-logo p {
    font-size: 14px;
    color: var(--text-light);
}

.login-form .form-group {
    margin-bottom: 25px;
}

.login-form label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-form label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.login-form input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-login i {
    margin-right: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
}

.login-footer p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.login-footer .version {
    font-size: 12px;
    margin-top: 20px;
}

/* ===== MAIN APP ===== */
.main-app {
    display: none;
}

.main-app.active {
    display: block;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-menu-toggle:hover {
    background: var(--bg-light);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.header-logo img {
    height: 38px;
    width: auto;
}

.header-search {
    flex: 1;
    max-width: 500px;
    position: relative;
    margin: 0 30px;
}

.header-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.header-search input {
    width: 100%;
    padding: 12px 16px 12px 45px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    transition: var(--transition);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: var(--transition);
}

.header-icon-btn:hover {
    background: var(--bg-light);
}

.header-icon-btn .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    transition: var(--transition);
}

.header-user:hover {
    background: var(--bg-light);
}

.header-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.user-role {
    font-size: 12px;
    color: var(--text-light);
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
    transition: transform 0.3s ease;
}

.sidebar-content {
    padding: 20px 0;
}

/* Nav Section */
.nav-section {
    margin-bottom: 8px;
}

.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-light);
    text-transform: uppercase;
}

.nav-section-header.collapsible {
    cursor: pointer;
    transition: var(--transition);
    border-radius: 0;
}

.nav-section-header.collapsible:hover {
    background: var(--bg-light);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.collapse-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.nav-section-header.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

/* Nav Submenu */
.nav-submenu {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.nav-submenu.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Nav Items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    margin: 2px 12px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-item.active:hover {
    background: var(--primary-dark);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item span {
    flex: 1;
}

/* Badges */
.badge-mini {
    background: var(--primary-color);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.badge-mini.warning {
    background: var(--warning);
    color: var(--text-dark);
}

.badge-mini.danger {
    background: var(--danger);
}

.nav-item.active .badge-mini {
    background: white;
    color: var(--primary-color);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 30px;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s ease;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-title i {
    font-size: 32px;
    color: var(--primary-color);
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-outline {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-light);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.card-body {
    font-size: 14px;
}

/* Grid System */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Stat Cards */
.stat-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.primary { background: var(--primary-color); }
.stat-icon.success { background: var(--success); }
.stat-icon.warning { background: var(--warning); }
.stat-icon.danger { background: var(--danger); }
.stat-icon.info { background: var(--info); }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 6px;
}

.stat-change.positive {
    color: var(--success);
    background: #e8f5e9;
}

.stat-change.negative {
    color: var(--danger);
    background: #ffebee;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

.table thead {
    background: var(--bg-light);
}

.table th {
    padding: 15px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 15px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--bg-light);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: #e8f5e9;
    color: var(--success);
}

.status-badge.warning {
    background: #fff3cd;
    color: #856404;
}

.status-badge.danger {
    background: #ffebee;
    color: var(--danger);
}

.status-badge.info {
    background: #e3f2fd;
    color: var(--info);
}

/* Placeholder Page */
.placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    background: var(--bg-white);
    border-radius: 12px;
    padding: 60px 40px;
    box-shadow: var(--shadow-sm);
}

.placeholder-icon {
    font-size: 80px;
    color: var(--primary-color);
    margin-bottom: 20px;
    opacity: 0.5;
}

.placeholder-page h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.placeholder-page p {
    font-size: 16px;
    color: var(--text-light);
    max-width: 500px;
    line-height: 1.8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    :root {
        --sidebar-width: 260px;
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-search {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .btn-menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header {
        padding: 0 15px;
    }

    .header-search {
        display: none;
    }

    .header-logo span {
        display: none;
    }

    .user-info {
        display: none;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Scrollbar Styles */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}
