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

:root {
    --primary:   #2563eb;
    --primary-h: #1d4ed8;
    --danger:    #dc2626;
    --success:   #16a34a;
    --warning:   #d97706;
    --info:      #0891b2;
    --bg:        #f8fafc;
    --surface:   #ffffff;
    --border:    #e2e8f0;
    --text:      #1e293b;
    --muted:     #64748b;
    --radius:    8px;
    --shadow:    0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
}

html, body {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

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

/* ─── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.navbar-brand { color: #fff; font-size: 1.1rem; font-weight: 700; }
.navbar-brand:hover { text-decoration: none; opacity: .9; }
.navbar-right { display: flex; align-items: center; gap: .75rem; }
.navbar-user { font-size: .875rem; opacity: .9; }

/* ─── Container ────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }

/* ─── Page header ──────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; }
.breadcrumb { font-size: .875rem; color: var(--muted); display: block; margin-bottom: .25rem; }

/* ─── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #f1f5f9;
}
.card-header h2, .card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}
.card-body { padding: 1.25rem; }
.card-footer {
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: .5rem;
    align-items: center;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:hover:not(:disabled) { opacity: .9; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled)  { background: var(--primary-h); }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-outline  { background: transparent; border: 1px solid rgba(255,255,255,.6); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.15); }
.btn-sm       { padding: .3rem .7rem; font-size: .8rem; }
.btn-full     { width: 100%; justify-content: center; }

/* ─── Forms ────────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .375rem; margin-bottom: 1rem; }
.field label { font-size: .875rem; font-weight: 500; }
.field input, .field select, .field textarea {
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    width: 100%;
    transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}
.field-action { min-width: 100px; }

/* ─── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: .9rem;
}
.alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }

/* ─── Badges ───────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: .2em .6em;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-error   { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #e0f2fe; color: #075985; }
.badge-muted   { background: #f1f5f9; color: var(--muted); }

/* ─── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.25rem;
    overflow-x: auto;
}
.tab {
    padding: .6rem 1.1rem;
    font-size: .9rem;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}
.tab:hover { color: var(--primary); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ─── Gallery posts ────────────────────────────────────────────────────────── */
.gallery-post { margin-bottom: 1.25rem; }
.gallery-post .card-header h3 { font-size: 1rem; margin-bottom: .15rem; }
.gallery-post-text {
    font-size: .9rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 1rem;
    padding: .75rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    white-space: pre-line;
}

/* ─── Photo grid ───────────────────────────────────────────────────────────── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .5rem;
}
.photo-item {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #f8fafc;
}
.photo-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform .15s;
}
.photo-item img:hover { transform: scale(1.03); }
.photo-item video {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    background: #000;
}

/* ─── Carnet ───────────────────────────────────────────────────────────────── */
.carnet {
    font-family: monospace;
    font-size: .85rem;
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--text);
}

/* ─── Misc ─────────────────────────────────────────────────────────────────── */
.mt-2 { margin-top: .75rem; }
.mt-4 { margin-top: 1.5rem; }
.text-muted { color: var(--muted); }
.small { font-size: .85rem; }
.inline { display: inline; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.empty-state { text-align: center; color: var(--muted); padding: 2rem; }
.job-status { margin: .5rem 0; min-height: 1.5rem; }

/* ─── Login ────────────────────────────────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}
.login-box {
    background: var(--surface);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-box h1 { text-align: center; font-size: 1.5rem; margin-bottom: .25rem; }
.login-box .subtitle { text-align: center; color: var(--muted); margin-bottom: 1.75rem; }

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    .actions-grid { grid-template-columns: 1fr; }
}
