:root {
    --bg-color: #0f1014;
    --sidebar-bg: #16181d;
    --card-bg: #1c1f26;
    --card-hover: #222630;

    --text-color: #f0f0f0;
    --text-muted: #8b92a5;

    --primary-color: #00d287;
    /* Modern Teal/Green */
    --primary-hover: #00b071;
    --primary-glow: rgba(0, 210, 135, 0.4);

    --secondary-color: #4f46e5;
    /* Indigo */
    --secondary-hover: #4338ca;

    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;

    --input-bg: #252a33;
    --border-color: #2e3440;

    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== LAYOUT SYSTEM ===== */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    padding-top: calc(var(--header-height) + 30px);
    transition: margin-left 0.3s ease;
    width: calc(100% - var(--sidebar-width));
}

@media (max-width: 991px) {
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
        padding-top: calc(var(--header-height) + 20px);
    }
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 25px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 15px;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu .menu-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    margin: 20px 0 10px 15px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(0, 210, 135, 0.1);
    color: var(--primary-color);
}

.sidebar-menu li a.active {
    font-weight: 600;
    box-shadow: inset 3px 0 0 0 var(--primary-color);
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    font-weight: 600;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--danger-color);
    color: white;
}

/* ===== TOPBAR ===== */
.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--header-height);
    background: rgba(15, 16, 20, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 900;
    transition: left 0.3s ease;
}

@media (max-width: 991px) {
    .topbar {
        left: 0;
        padding: 0 20px;
    }
}

.toggle-sidebar {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    display: none;
}

@media (max-width: 991px) {
    .toggle-sidebar {
        display: block;
    }
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-left: auto;
}

.current-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 576px) {
    .current-date {
        display: none;
    }
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-profile .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), #2dd4bf);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.3);
}

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

.user-profile .name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.user-profile .role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== CARDS & CONTAINERS ===== */
.page_header {
    margin-bottom: 30px;
}

.page_title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(90deg, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 25px;
}

/* ===== FORMS ===== */
.form-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.form-control,
.form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: #ffffff;
    /* Force white text */
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--input-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 210, 135, 0.1);
    color: #ffffff;
    /* Force white text */
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.btn-outline-danger {
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    background: transparent;
}

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

/* Action Buttons in Table */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-action-view {
    background: rgba(79, 70, 229, 0.2);
    color: #818cf8;
}

.btn-action-edit {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.btn-action-delete {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.btn-action-view:hover,
.btn-action-edit:hover,
.btn-action-delete:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

/* ===== TABLES ===== */
.table-responsive {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table {
    margin-bottom: 0;
    color: var(--text-muted);
}

.table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 16px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    color: var(--text-color);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ===== LOGIN PAGE & SLIDESHOW ===== */
/* Keeping slideshow styles but refining overlay */
.slideshow-overlay {
    background: rgba(10, 11, 15, 0.85);
    /* Slightly darker for better contrast */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ===== UTILITIES ===== */
.text-primary {
    color: var(--primary-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Dashboard specifics from original style.css incorporated */
.stat-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
    z-index: 2;
    position: relative;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 2;
    position: relative;
}

.stat-icon {
    font-size: 5rem;
    opacity: 0.05;
    position: absolute;
    right: -10px;
    top: -10px;
    color: var(--text-color);
    z-index: 1;
}

.slideshow {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.slideshow li {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    z-index: 0;
    animation: imageAnimation 24s linear infinite;
}

.slideshow li:nth-child(1) {
    background-image: url('https://images.unsplash.com/photo-1534438327276-14e5300c3a48?q=80&w=1470&auto=format&fit=crop');
    animation-delay: 0s;
}

.slideshow li:nth-child(2) {
    background-image: url('https://images.unsplash.com/photo-1517836357463-d25dfeac3438?q=80&w=1470&auto=format&fit=crop');
    animation-delay: 6s;
}

.slideshow li:nth-child(3) {
    background-image: url('https://images.unsplash.com/photo-1541534741688-6078c6bfb5c5?q=80&w=1469&auto=format&fit=crop');
    animation-delay: 12s;
}

.slideshow li:nth-child(4) {
    background-image: url('https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?q=80&w=1470&auto=format&fit=crop');
    animation-delay: 18s;
}

@keyframes imageAnimation {
    0% {
        opacity: 0;
        animation-timing-function: ease-in;
    }

    10% {
        opacity: 1;
        animation-timing-function: ease-out;
    }

    20% {
        opacity: 1;
    }

    30% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* Background Quote */
.background-quote {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    font-size: 8rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.03);
    z-index: -1;
    pointer-events: none;
    text-transform: uppercase;
    line-height: 1;
    transition: opacity 2s ease-in-out;
    user-select: none;
}

@media (max-width: 768px) {
    .background-quote {
        font-size: 4rem;
    }
}

/* ===== IA WIDGET ===== */
.ai-widget{
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ai-button{
    width: 60px;
    height: 60px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.ai-bubble{
    background: #1e293b;
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    display: none;
}

.ai-bubble.show{
    display: block;
}