/* Het Stille Team Dashboard — Editorial Context */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300..700;1,8..60,300..700&family=Inter:wght@300..700&display=swap');

:root {
    /* Brand colors — editorial context (cream canvas) */
    --bg:             #f6f2e9;   /* cream-200: page background */
    --surface:        #faf7ef;   /* cream-100: paper / cards */
    --surface-hover:  #eee7d7;   /* cream-300: raised / hover */
    --border:         #E1D9BF;   /* cream-500: subtle border */
    --border-strong:  #CFC59E;   /* cream-600: heavier border */

    /* Text */
    --text:           #0F2A1D;   /* green-800: primary text */
    --text-body:      #4A4A4A;   /* ink-700: body text */
    --text-muted:     #6B6B6B;   /* ink-500: secondary */
    --text-meta:      #8C8880;   /* ink-400: meta / tertiary */

    /* Accent */
    --accent:         #C8A951;   /* gold-400: warm gold */
    --accent-hover:   #A88A3D;   /* gold-500: mid gold */
    --link:           #2D5016;   /* green-500: links */
    --link-hover:     #A88A3D;   /* gold-500: link hover */

    /* Status */
    --green:          #4ade80;   /* status-positive */
    --yellow:         #A88A3D;   /* status-caution */
    --red:            #8C4A3F;   /* status-critical */
    --orange:         #A88A3D;   /* caution variant */

    /* Status backgrounds */
    --green-bg:       #E3EADB;
    --yellow-bg:      #F4ECCF;
    --red-bg:         #F0DCD5;

    /* Layout */
    --radius:         4px;

    /* Fonts */
    --font-display: "Source Serif 4", Georgia, serif;
    --font-ui:      "Inter", system-ui, sans-serif;

    /* Shadows — editorial: minimal, hairline */
    --shadow-1:     0 1px 0 rgba(15, 42, 29, 0.04), 0 1px 2px rgba(15, 42, 29, 0.04);
    --shadow-2:     0 1px 0 rgba(15, 42, 29, 0.05), 0 4px 12px rgba(15, 42, 29, 0.06);
}

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

body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

::selection { background: #FFE69E; color: #0F2A1D; }

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: var(--shadow-2);
}
.login-logo {
    height: 48px;
    width: auto;
    margin-bottom: 0.5rem;
}
.login-box h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.login-box .subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.login-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    transition: border-color 0.15s;
}
.login-box input:focus {
    outline: none;
    border-color: var(--accent);
}
.login-box button {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 2px;
    background: var(--accent);
    color: white;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.login-box button:hover { background: var(--accent-hover); }
.alert.error {
    background: var(--red-bg);
    border: 1px solid var(--red);
    color: var(--red);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-logo {
    height: 32px;
    width: auto;
}
.topbar-left h1 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text);
}
.topbar-date { color: var(--text-meta); font-size: 0.8rem; }
.back-link { color: var(--text-muted); font-size: 0.85rem; }
.back-link:hover { color: var(--link); }
.btn-logout {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    transition: border-color 0.15s, color 0.15s;
}
.btn-logout:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

/* Dashboard */
.dashboard { padding: 1.5rem 2rem; max-width: 1400px; margin: 0 auto; }
.section { margin-bottom: 2rem; }
.section h2 {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 0.75rem;
}

/* Client cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.client-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-1);
}
.client-card:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    box-shadow: var(--shadow-2);
    text-decoration: none;
    color: var(--text);
}
.client-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.client-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.client-stats {
    display: flex;
    gap: 1.5rem;
}
.stat { text-align: center; }
.stat-value { display: block; font-size: 1.1rem; font-weight: 600; color: var(--text); }
.stat-label { font-size: 0.65rem; color: var(--text-meta); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-error { color: var(--red); }

/* Status dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-recent { background: var(--yellow); }
.status-offline { background: var(--red); }
.status-unknown { background: var(--text-meta); }

/* Badges */
.tier-badge {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.15rem 0.45rem;
    border-radius: 2px;
    background: var(--surface-hover);
    color: var(--text-muted);
    letter-spacing: 0.04em;
}
.tier-1 { background: rgba(200, 169, 81, 0.15); color: var(--accent); }
.tier-2 { background: rgba(45, 80, 22, 0.12); color: var(--link); }
.tier-3 { background: rgba(15, 42, 29, 0.1); color: var(--text); }
.env-label { font-size: 0.75rem; color: var(--text-meta); }

/* Status labels */
.status-ok { color: #2D5016; font-weight: 600; }
.status-fail { color: var(--red); font-weight: 600; }
.status-timeout { color: var(--yellow); font-weight: 600; }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-strong);
    color: var(--text-meta);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.data-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-body);
}
.error-row { background: var(--red-bg); }
.error-msg { font-size: 0.8rem; color: var(--red); max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.overdue td { color: var(--red); }
.overdue-flag { color: var(--red); font-weight: bold; margin-left: 0.25rem; }

/* Pipeline status */
.pipeline-status {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
    font-weight: 500;
}
.pipeline-besteld { background: rgba(200, 169, 81, 0.15); color: var(--accent); }
.pipeline-intake-ontvangen { background: var(--yellow-bg); color: var(--yellow); }
.pipeline-in-productie { background: rgba(45, 80, 22, 0.12); color: var(--link); }
.pipeline-review { background: var(--green-bg); color: #2D5016; }
.pipeline-opgeleverd { background: var(--green-bg); color: #2D5016; }

/* Two column layout */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
    .dashboard { padding: 1rem; }
    .topbar { padding: 0.75rem 1rem; }
}

/* Agent grid (detail page) */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.agent-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-1);
}
.agent-card.agent-error { border-color: var(--red); }
.agent-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.agent-meta { font-size: 0.75rem; color: var(--text-meta); display: flex; justify-content: space-between; }

.empty-state { color: var(--text-muted); font-style: italic; font-size: 0.9rem; }

/* Fototheek */

/* Storage meter */
.storage-meter {
    position: relative;
    display: inline-block;
    width: 140px;
    height: 22px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 2px;
    overflow: hidden;
}
.storage-bar {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: rgba(200, 169, 81, 0.25);
    transition: width 0.3s;
}
.storage-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Upload button */
.btn-upload {
    padding: 0.4rem 1rem;
    background: var(--accent);
    color: white;
    border-radius: 2px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.15s;
}
.btn-upload:hover { background: var(--accent-hover); color: white; }

/* Category filter */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.cat-badge {
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface);
    transition: all 0.15s;
}
.cat-badge:hover { border-color: var(--accent); color: var(--text); }
.cat-active {
    background: rgba(200, 169, 81, 0.15);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 500;
}

/* Category add button */
.cat-add {
    border-style: dashed;
    color: var(--text-meta);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0.2rem 0.65rem;
}
.cat-add:hover { border-color: var(--accent); color: var(--accent); }

/* Category management panel */
.cat-manage {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-1);
}
.cat-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.cat-form input[type="text"] {
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    flex: 1;
    min-width: 120px;
}
.cat-form input[type="text"]:focus { outline: none; border-color: var(--accent); }
.cat-form input[type="color"] {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 2px;
    cursor: pointer;
    background: var(--bg);
}
.btn-cat-add {
    padding: 0.45rem 0.85rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 2px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
}
.btn-cat-add:hover { background: var(--accent-hover); }
.cat-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.cat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 2px;
    font-size: 0.8rem;
}
.cat-item:hover { background: var(--surface-hover); }
.cat-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cat-item-name { color: var(--text); font-weight: 500; }
.cat-item-slug { color: var(--text-meta); font-size: 0.7rem; }
.cat-item-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-meta);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.3rem;
    line-height: 1;
}
.cat-item-delete:hover { color: var(--red); }

/* Photo grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.photo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-1);
}
.photo-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-2);
}
.photo-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.photo-placeholder {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-hover);
    color: var(--text-meta);
    font-size: 0.8rem;
}
.photo-info {
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.photo-name {
    font-size: 0.75rem;
    color: var(--text-body);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}
.photo-cat {
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Tag badges */
.tag-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    margin: 0.15rem;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 42, 29, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.lightbox.active { display: flex; }
.lightbox-content {
    background: var(--surface);
    border-radius: var(--radius);
    max-width: 900px;
    max-height: 90vh;
    width: 100%;
    overflow: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.lightbox-content img {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    display: block;
    background: #1a1a1a;
}
.lightbox-close {
    position: absolute;
    top: 0.5rem; right: 0.75rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}
.lightbox-meta {
    padding: 1.25rem;
}
.lightbox-meta h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.lightbox-meta p {
    font-size: 0.85rem;
    color: var(--text-body);
    margin-bottom: 0.5rem;
}
.lightbox-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}
.btn-download {
    padding: 0.4rem 1rem;
    background: var(--accent);
    color: white;
    border-radius: 2px;
    font-size: 0.8rem;
    font-weight: 500;
}
.btn-download:hover { background: var(--accent-hover); color: white; }
.btn-delete {
    padding: 0.4rem 1rem;
    background: none;
    border: 1px solid var(--red);
    color: var(--red);
    border-radius: 2px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-delete:hover { background: var(--red-bg); }

/* Upload form */
.upload-container {
    max-width: 600px;
    margin: 0 auto;
}
.upload-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-1);
}

/* Drop zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 1.25rem;
    position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(200, 169, 81, 0.05);
}
.drop-zone input[type="file"] {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: -1;
}
.drop-zone-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.drop-icon {
    font-size: 2rem;
    color: var(--accent);
    line-height: 1;
}
.drop-zone-text p {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.drop-hint {
    font-size: 0.75rem !important;
    color: var(--text-meta) !important;
}
.drop-zone-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.drop-zone-preview img {
    max-height: 200px;
    max-width: 100%;
    border-radius: 2px;
}
.btn-remove-preview {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.3rem 0.75rem;
    border-radius: 2px;
    font-size: 0.75rem;
    cursor: pointer;
}

/* Upload fields */
.upload-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.25rem;
}
.field-hint {
    font-weight: 400;
    color: var(--text-meta);
}
.field input, .field select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    transition: border-color 0.15s;
}
.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--accent);
}
.btn-submit {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 2px;
    background: var(--accent);
    color: white;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-submit:hover { background: var(--accent-hover); }

/* Fototheek link on client detail */
.fototheek-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: border-color 0.15s, color 0.15s;
}
.fototheek-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

@media (max-width: 900px) {
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
    .lightbox { padding: 1rem; }
    .lightbox-content { max-height: 95vh; }
}
