﻿/* VEKABUY ORGANISATION - STYLES PROFESSIONNELS */

:root {
    --primary: #dc2626;
    --primary-dark: #991b1b;
    --bg: #0a0a0a;
    --surface: #1a1a1a;
    --surface-light: #2a2a2a;
    --text: #ffffff;
    --text-secondary: #a3a3a3;
    --border: #2a2a2a;
    --success: #10b981;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* LOGIN PAGE */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg) 0%, #1f1f1f 100%);
}

.login-container {
    background: var(--surface);
    padding: 3rem;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* FORMS */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}

.error-msg {
    color: var(--primary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 8px;
    display: none;
}

.error-msg.show {
    display: block;
}

/* BUTTONS */
.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
}

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

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

.btn-secondary:hover {
    background: var(--surface-light);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 100%;
}

.btn-logout:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-add-category {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 1rem 1.5rem 0;
}

.btn-add-category:hover {
    background: var(--primary);
    color: #fff;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

/* DASHBOARD */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand h2 {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-brand span {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-top: 0.25rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--surface-light);
    color: var(--text);
}

.nav-link.active {
    background: var(--surface-light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
}

.nav-link-actions {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}

.nav-delete-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s;
}

.nav-link:hover .nav-delete-btn {
    opacity: 1;
}

.nav-delete-btn:hover {
    background: var(--primary);
    color: #fff;
}

.nav-delete-btn svg {
    width: 14px;
    height: 14px;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.125rem;
}

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

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
}

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

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: 280px;
    background: var(--bg);
}

.top-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.top-bar h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.timestamp {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.content-section {
    display: none;
    padding: 2rem;
}

.content-section.active {
    display: block;
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

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

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

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ACTIVITY */
.recent-activity {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-user {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.activity-text {
    color: var(--text);
    font-size: 0.875rem;
}

.activity-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* RULES */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rule-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.rule-card:hover {
    border-color: var(--primary);
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.rule-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.rule-actions {
    display: flex;
    gap: 0.5rem;
}

.rule-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.rule-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.rule-btn-edit {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.rule-btn-edit:hover {
    background: #3b82f6;
    color: #fff;
}

.rule-btn-delete {
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary);
}

.rule-btn-delete:hover {
    background: var(--primary);
    color: #fff;
}

.rule-content {
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

.rule-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.rule-meta {
    display: flex;
    gap: 1rem;
}

/* LOGS */
.logs-filters {
    display: flex;
    gap: 1rem;
}

.filter-select {
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.875rem;
}

.logs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.log-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-user {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.log-action {
    padding: 0.25rem 0.75rem;
    background: var(--surface-light);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.log-text {
    color: var(--text);
    font-size: 0.875rem;
    flex: 1;
    margin: 0 1rem;
}

.log-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.modal-container {
    position: relative;
    background: var(--surface);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--surface-light);
    color: var(--text);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* ANIMATIONS */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    .main-content {
        margin-left: 240px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .top-bar {
        padding: 1rem;
    }
    .content-section {
        padding: 1rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    .login-header h1 {
        font-size: 1.5rem;
    }
}
