/* assets/css/style.css */

:root {
    /* --- MODERN RICH PALETTE --- */
    --color-primary: #4F46E5;
    /* Indigo 600 */
    --color-primary-dark: #3730A3;
    /* Indigo 800 */
    --color-secondary: #0F172A;
    /* Slate 900 */
    --color-accent: #06B6D4;
    /* Cyan 500 */
    --color-danger: #EF4444;
    /* Red 500 */
    --color-warning: #F59E0B;
    /* Amber 500 */
    --color-success: #10B981;
    /* Emerald 500 */

    --color-bg: #F8FAFC;
    /* Slate 50 */
    --color-surface: rgba(255, 255, 255, 0.85);
    /* Glassmorphism base */
    --color-surface-solid: #FFFFFF;
    --color-text-main: #1E293B;
    /* Slate 800 */
    --color-text-muted: #64748B;
    /* Slate 500 */
    --color-border: #E2E8F0;
    /* Slate 200 */

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.05);

    --radius: 16px;
    --radius-sm: 8px;
    --radius-round: 50%;

    --font-family: 'Inter', system-ui, -apple-system, sans-serif;

    --header-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    background-attachment: fixed;
    color: var(--color-text-main);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--color-primary);
    transition: color 0.3s;
}

a:hover {
    color: var(--color-primary-dark);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--color-secondary);
    line-height: 1.2;
    margin-bottom: 0.5em;
}

/* MISC MISSING CLASSES */
.text-h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-secondary);
}

.text-h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-secondary);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- STRUCTURE PWA / DASHBOARD --- */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* SIDEBAR (Desktop: Fixe, Mobile: Off-canvas) */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--color-secondary) 0%, #1E293B 100%);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
}

.brand {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #FFFFFF;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand i {
    color: var(--color-accent);
    font-size: 24px;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.nav-menu {
    list-style: none;
    flex: 1;
    padding: 0;
}

.nav-item {
    margin-bottom: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    color: #94A3B8;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(5px);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 4px;
    background-color: var(--color-accent);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--color-accent);
}

.nav-icon {
    margin-right: 14px;
    width: 24px;
    text-align: center;
    font-size: 18px;
    transition: transform 0.3s;
}

.nav-link:hover .nav-icon {
    transform: scale(1.1);
    color: var(--color-accent);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    width: calc(100% - 260px);
    transition: margin-left 0.4s ease-in-out, width 0.4s ease-in-out;
}

/* HEADER */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--color-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-glass);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: sticky;
    top: 15px;
    z-index: 900;
}

.menu-toggle {
    display: none;
    font-size: 24px;
    color: var(--color-text-main);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

.menu-toggle:active {
    transform: scale(0.9);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 6px 12px;
    border-radius: 30px;
    transition: background 0.3s;
}

.user-profile:hover {
    background: rgba(0, 0, 0, 0.03);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-round);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.user-info-text {
    text-align: right;
}

.user-info-text strong {
    display: block;
    font-weight: 700;
    color: var(--color-secondary);
    font-size: 14px;
}

.user-info-text small {
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

/* --- CARDS & COMPONENTS --- */
.card {
    background: var(--color-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-glass);
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--color-surface-solid);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 5px solid var(--color-primary);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    transform: skewX(-20deg) translateX(150px);
    transition: transform 0.5s;
}

.stat-card:hover::after {
    transform: skewX(-20deg) translateX(-150px);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-secondary);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* TABLES */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

thead th {
    background-color: #F1F5F9;
    color: var(--color-text-muted);
    font-weight: 700;
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-border);
}

thead th:first-child {
    border-top-left-radius: var(--radius-sm);
}

thead th:last-child {
    border-top-right-radius: var(--radius-sm);
}

td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
    background: var(--color-surface-solid);
    transition: background 0.2s;
}

tbody tr:hover td {
    background-color: #F8FAFC;
}

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.badge-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.badge-warning {
    background-color: #FEF3C7;
    color: #92400E;
    border: 1px solid #F59E0B;
}

.badge-danger {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.35);
    transform: translateY(-2px);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-secondary);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 15px;
    background: var(--color-surface-solid);
    transition: all 0.3s;
    color: var(--color-text-main);
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    background: #FFFFFF;
}

/* LOGIN V2 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.1) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- MOBILE RESPONSIVE TWEAKS --- */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    }

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

    .sidebar-overlay.open {
        display: block;
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }

    .menu-toggle {
        display: block;
    }

    .top-header {
        padding: 12px 15px;
        top: 0;
        border-radius: 0 0 var(--radius) var(--radius);
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .user-info-text strong,
    .user-info-text small {
        display: none;
    }
}