/**
 * SALAÜN ASSURANCES - Espace Client Styles
 */

:root {
    --navy: #1a2940;
    --navy-light: #2d4156;
    --gold: #c9a961;
    --gold-light: #d4bc7e;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --red-700: #b91c1c;
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --purple-50: #faf5ff;
    --purple-100: #f3e8ff;
    --purple-500: #a855f7;
    --purple-600: #9333ea;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
}

.login-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
}

.login-form-wrapper {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0;
}

.login-logo p {
    color: var(--gold);
    font-weight: 500;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-top: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.login-brand-side {
    display: none;
    flex: 1;
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .login-brand-side {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 3rem;
    }
}

.login-brand-content {
    position: relative;
    z-index: 1;
    color: white;
}

.login-brand-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.login-brand-content h2 span {
    color: var(--gold);
}

.login-brand-list {
    list-style: none;
}

.login-brand-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 1rem;
}

.login-brand-list li::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
}

.login-brand-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(201, 169, 97, 0.1);
}

.login-brand-circle-1 {
    width: 300px;
    height: 300px;
    bottom: -100px;
    right: -100px;
}

.login-brand-circle-2 {
    width: 150px;
    height: 150px;
    top: 80px;
    right: -40px;
}

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

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

.form-input-wrapper {
    position: relative;
}

.form-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    width: 20px;
    height: 20px;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 2.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.15);
}

.form-input-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
}

.form-input-toggle:hover {
    color: var(--gray-600);
}

.form-link {
    display: block;
    text-align: right;
    font-size: 0.875rem;
    color: var(--navy);
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.form-link:hover {
    color: var(--gold);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

.btn-primary:hover {
    background: var(--navy-light);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-gold {
    background: var(--gold);
    color: var(--navy);
}

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

.btn-outline {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-50);
}

.form-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-600);
}

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

.form-footer a:hover {
    color: var(--gold);
}

/* ==================== ALERTS ==================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.alert-error {
    background: var(--red-50);
    border: 1px solid var(--red-100);
    color: var(--red-700);
}

.alert-success {
    background: var(--green-50);
    border: 1px solid var(--green-100);
    color: var(--green-700);
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* ==================== LAYOUT ==================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--navy);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s;
}

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

@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0);
    }
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
}

.sidebar-logo p {
    color: var(--gold);
    font-size: 0.875rem;
    font-weight: 500;
}

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

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav-item.active {
    background: rgba(201, 169, 97, 0.2);
    color: var(--gold);
    border-right: 3px solid var(--gold);
}

.sidebar-nav-item svg {
    width: 20px;
    height: 20px;
}

.sidebar-nav-section {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.4);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--navy);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-content {
    flex: 1;
    margin-left: 0;
    padding: 1.5rem;
}

@media (min-width: 1024px) {
    .main-content {
        margin-left: 260px;
    }
}

.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    margin: -1.5rem -1.5rem 1.5rem;
}

@media (min-width: 1024px) {
    .mobile-header {
        display: none;
    }
}

.mobile-menu-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
    color: var(--gray-700);
}

.mobile-logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
}

.mobile-logo span {
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 500;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

@media (min-width: 1024px) {
    .sidebar-overlay {
        display: none !important;
    }
}

/* ==================== CARDS ==================== */
.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.25rem;
}

/* ==================== WELCOME BANNER ==================== */
.welcome-banner {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
}

.welcome-banner h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-banner p {
    color: rgba(255,255,255,0.7);
}

/* ==================== QUICK ACTIONS ==================== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }
}

.quick-action {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1rem;
    text-decoration: none;
    transition: all 0.2s;
}

.quick-action:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.quick-action-icon svg {
    width: 20px;
    height: 20px;
}

.quick-action-icon.red {
    background: var(--red-100);
    color: var(--red-600);
}

.quick-action-icon.blue {
    background: var(--blue-100);
    color: var(--blue-600);
}

.quick-action-icon.green {
    background: var(--green-100);
    color: var(--green-600);
}

.quick-action-icon.purple {
    background: var(--purple-100);
    color: var(--purple-600);
}

.quick-action h3 {
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.quick-action p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

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

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.25rem;
}

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

.stat-header svg {
    width: 20px;
    height: 20px;
}

.stat-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.stat-badge.green {
    background: var(--green-50);
    color: var(--green-700);
}

.stat-badge.orange {
    background: var(--orange-50);
    color: var(--orange-600);
}

.stat-badge.red {
    background: var(--red-50);
    color: var(--red-600);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
}

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

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

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.table tr:hover {
    background: var(--gray-50);
}

.table-link {
    color: var(--navy);
    text-decoration: none;
    font-weight: 500;
}

.table-link:hover {
    color: var(--gold);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-green {
    background: var(--green-100);
    color: var(--green-700);
}

.badge-blue {
    background: var(--blue-100);
    color: var(--blue-700);
}

.badge-orange {
    background: var(--orange-100);
    color: var(--orange-600);
}

.badge-red {
    background: var(--red-100);
    color: var(--red-700);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-700);
}

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

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==================== LOADING ==================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== UTILITIES ==================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

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

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

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

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}
