/* Dataroom Zyligo - Styles globaux */

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1e3a5f;
    --primary-light: #2b5a8f;
    --primary-dark: #142a45;
    --accent: #1a56db;
    --accent-light: #3b82f6;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --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;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 6px;
    --radius-lg: 10px;
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn:active {
    transform: translateY(0);
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--primary-light);
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
}
.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

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

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}
.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}
.btn-icon {
    padding: 8px;
    line-height: 1;
}

/* === Forms === */
.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}
.form-input::placeholder {
    color: var(--gray-400);
}
.form-textarea {
    resize: vertical;
    min-height: 100px;
}
.form-error {
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}
.form-hint {
    color: var(--gray-500);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* === Cards === */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-body {
    padding: 20px;
}
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* === Tables === */
.table-wrapper {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.875rem;
}
.table th {
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-50);
    white-space: nowrap;
}
.table tbody tr:hover {
    background: var(--gray-50);
}
.table-striped tbody tr:nth-child(even) {
    background: var(--gray-50);
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.6;
}
.badge-primary { background: #dbeafe; color: #1e40af; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #cffafe; color: #155e75; }
.badge-default { background: var(--gray-100); color: var(--gray-600); }

/* === Alerts === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid transparent;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0 4px;
}
.alert-close:hover { opacity: 1; }

/* === Avatar === */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--white);
    flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.6875rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }

/* === Presence indicator === */
.presence-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid var(--white);
}
.presence-dot.online { background: var(--success); }
.presence-dot.offline { background: var(--gray-300); }

/* === Breadcrumb === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 0.875rem;
    color: var(--gray-500);
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--gray-300); }
.breadcrumb-current { color: var(--gray-800); font-weight: 500; }

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    color: var(--gray-300);
}
.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: 8px;
}

/* === Dropdown === */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 220px;
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.08);
    z-index: 100;
    display: none;
    padding: 6px;
    animation: dropdown-in 0.15s ease-out;
}
@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-menu.show { display: block; }
button.dropdown-item,
a.dropdown-item,
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--gray-700);
    cursor: pointer;
    border-radius: var(--radius);
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    outline: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
    font-family: var(--font);
    transition: all 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}
button.dropdown-item:hover,
a.dropdown-item:hover,
.dropdown-item:hover {
    background: var(--gray-50) !important;
    color: var(--gray-900);
}
button.dropdown-item[style*="danger"],
.dropdown-item.dropdown-item-danger {
    color: var(--danger);
}
button.dropdown-item[style*="danger"]:hover,
.dropdown-item.dropdown-item-danger:hover {
    background: #fef2f2 !important;
}
.dropdown-divider {
    border: none;
    border-top: 1px solid var(--gray-100);
    margin: 4px 6px;
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show {
    display: flex;
}
.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
}
.modal-lg { max-width: 700px; }
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-body { padding: 20px; }
.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0;
    line-height: 1;
}
.modal-close:hover { color: var(--gray-600); }

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1.5rem;
    justify-content: center;
}
.pagination a, .pagination span {
    padding: 8px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-600);
}
.pagination a:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}
.pagination .active {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

/* === Loading === */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Utilities === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

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

.w-full { width: 100%; }
.overflow-hidden { overflow: hidden; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Responsive === */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    .btn-lg { padding: 12px 20px; }
    .table th, .table td { padding: 8px 12px; }
}
