:root {
    /* Color Palette - Premium Dark/Modern */
    --bg-body: #f0f2f5;
    --bg-sidebar: #ffffff;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #64748b;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-main: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;

    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* LAYOUT */
.app-container {
    display: flex;
    height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--glass-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.sidebar-header {
    margin-bottom: 40px;
    padding: 0 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 15px;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
}

.nav-item:hover {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-item ion-icon {
    font-size: 20px;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-profile .info {
    display: flex;
    flex-direction: column;
}

.user-profile .name {
    font-weight: 600;
    font-size: 14px;
}

.user-profile .role {
    font-size: 12px;
    color: var(--text-light);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: rgba(243, 244, 246, 0.5);
    /* Overlay */
}

/* TOP BAR */
.top-bar {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.page-title h2 {
    font-size: 20px;
    font-weight: 600;
}

.page-title p {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-light);
    transition: 0.2s;
    position: relative;
}

.icon-btn:hover {
    background: var(--bg-body);
    color: var(--primary);
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* CONTENT WRAPPER */
.content-wrapper {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CARDS & PANELS */
.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.icon-box {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.icon-box.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.icon-box.green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.icon-box.yellow {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.icon-box.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-info h3 {
    font-size: 14px;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-info .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin: 5px 0;
}

.stat-info .trend {
    font-size: 12px;
    font-weight: 500;
}

.trend.positive {
    color: var(--success);
}

/* TABLES */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th {
    text-align: left;
    padding: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

/* BUTTONS */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-success {
    background: var(--success);
    color: white;
}

/* FORM ELEMENTS */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 8px;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8fafc;
    font-family: inherit;
    font-size: 14px;
    transition: border 0.2s;
}

.form-control:focus,
textarea:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    width: 500px;
    max-width: 90%;
}

.modal h3 {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* SPLIT VIEW */
.split-view {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .split-view {
        grid-template-columns: 1fr;
    }
}

.review-card-preview {
    background: #f8fafc;
    border-left: 4px solid var(--primary);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-style: italic;
    color: #555;
}

.ai-suggestion {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(79, 70, 229, 0.1));
    border: 1px dashed var(--accent);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
}

/* CLIENTS GRID */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.client-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: 0.2s;
    padding: 20px;
}

.client-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.client-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.client-card p {
    font-size: 13px;
    color: var(--text-light);
    margin: 0;
}

.client-actions {
    display: flex;
    gap: 5px;
    margin-top: auto;
}

/* LEGAL PAGES */
.legal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    line-height: 1.8;
}

.legal-container h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #f1f5f9;
}

.last-update {
    color: #94a3b8;
    font-style: italic;
    margin-bottom: 2rem;
}

.legal-container section {
    margin-bottom: 3rem;
}

.legal-container h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: #e2e8f0;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.legal-container h3 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.75rem;
    color: #cbd5e1;
}

.legal-container ul {
    margin: 1rem 0;
    padding-left: 2rem;
    color: #cbd5e1;
}

.legal-container li {
    margin: 0.5rem 0;
    color: #cbd5e1;
}

.legal-container p {
    color: #cbd5e1;
}

.legal-container a {
    color: var(--accent);
    text-decoration: none;
}

.legal-container a:hover {
    text-decoration: underline;
}

.legal-container strong {
    color: #f8fafc;
}

/* COOKIE BANNER */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    z-index: 9999;
    display: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.cookie-text h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
}

.btn-cookie-accept {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-cookie-accept:hover {
    background: var(--primary-hover);
}

.btn-cookie-refuse {
    background: transparent;
    color: #cbd5e1;
    border: 1px solid #475569;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.btn-cookie-refuse:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: #cbd5e1;
}

@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: flex-end;
    }
}