/* ===========================================
   Admin Shared CSS - Alpine Home
   Styles communs entre admin.html,
   proprietaire-dashboard.html et ajouter-propriete.html
   =========================================== */

/* --- CSS Variables --- */
:root {
    --primary: #2B2C26;
    --secondary: #6E5641;
    --accent-1: #ffffff;
    --accent-2: #78716c;
    --cta: #6E5641;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #2B2C26;
    --light: #FFFBF4;
    --gray: #64748b;
    --font-title: 'Playfair Display', serif;
    --font-subtitle: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    --border-color: #e2e8f0;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 2px 10px rgba(0,0,0,0.05);
}

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

body {
    font-family: var(--font-body);
    color: var(--dark);
}

/* --- Buttons --- */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-size: 14px;
    text-decoration: none;
}

a.btn, a.btn:hover, a.btn:visited {
    text-decoration: none;
}

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

.btn-primary:hover {
    background: #094058;
}

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

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

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

.btn-warning:hover {
    background: #d97706;
}

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

.btn-secondary {
    background: var(--accent-2);
    color: var(--accent-1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* --- Form Controls --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-control,
input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.form-control:focus,
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(32,164,243,0.1);
}

textarea, textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select, select.form-control {
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 20px;
}

.modal-close, .btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* --- Alerts --- */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #9ae6b4;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #91d5ff;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* --- Dropdown flash prevention --- */
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    position: absolute;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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