/* SambaPOS Klantenportal – basis styling */
:root {
    --bg: #f4f6f9;
    --card: #ffffff;
    --text: #1a1d23;
    --muted: #6b7280;
    --primary: #ec6724;
    --primary-hover: #d45a1c;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --border: #e5e7eb;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Topbar */
.topbar {
    background: #ec6724;
    color: #fff;
    padding: .65rem 0;
}
.topbar-admin { background: #1e3a5f; }
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.brand {
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
}
.brand-logo {
    height: 36px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    display: block;
}
.brand-text { color: #fff; }
.topbar .nav a { color: rgba(255,255,255,.92); }
.topbar .nav a:hover { color: #fff; text-decoration: underline; }
.topbar .user-label { color: rgba(255,255,255,.8); }
.topbar .btn-outline {
    border-color: rgba(255,255,255,.7);
    color: #fff;
}
.topbar .btn-outline:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
}
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}
.auth-card h1 { color: var(--primary); }
.mb-search-wrap { position: relative; z-index: 20; overflow: visible; }
.card { overflow: visible; }

.nav {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.nav a { color: #e5e7eb; }
.nav a:hover { color: #fff; }
.user-label { color: #9ca3af; font-size: .9rem; }

main.container { flex: 1; padding-top: 1.5rem; padding-bottom: 2rem; }

.footer {
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .85rem;
}

/* Auth */
.auth-card {
    max-width: 400px;
    margin: 3rem auto;
    background: var(--card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.auth-card h1 { margin-top: 0; font-size: 1.5rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: .35rem; font-size: .9rem; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="search"],
.input {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
}
.form-group input:focus, .input: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;
    gap: 1rem;
}
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
}
.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 400; cursor: pointer; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* Buttons */
.btn {
    display: inline-block;
    padding: .5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: .9rem;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { background: #f3f4f6; text-decoration: none; }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-outline {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-secondary {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
}
.btn-secondary:hover {
    background: #f3f4f6;
    color: var(--text);
}
.topbar .btn-outline {
    background: transparent;
    border-color: rgba(255,255,255,.7);
    color: #fff;
}
.topbar .btn-outline:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
}
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* Alerts */
.alert {
    padding: .75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: .95rem;
}
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #e0f2fe; color: #075985; }

/* Cards & tables */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
}
.card-title { margin: 0 0 1rem; font-size: 1.15rem; }
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}
.label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

.table-wrap { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}
.table th, .table td {
    padding: .6rem .75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table th { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; }
.table tbody tr:hover { background: #f9fafb; }
.text-right { text-align: right; }

.badge {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: #e5e7eb;
    color: #374151;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--muted); font-size: .9rem; }

/* Misc */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { margin: .25rem 0 0; }
.flex-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.back-link { font-size: .9rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.my-3 { margin: 1rem 0; }
.hidden { display: none !important; }

.search-bar {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
    max-width: 420px;
}
.search-bar .input { flex: 1; }

.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.steps { padding-left: 1.25rem; }
.steps li { margin-bottom: .5rem; }

/* Entity search */
.entity-search { position: relative; max-width: 480px; }
.entity-results {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    max-height: 280px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}
.entity-results.open { display: block; }
.entity-results button {
    display: block;
    width: 100%;
    text-align: left;
    padding: .6rem .9rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: .95rem;
    border-bottom: 1px solid var(--border);
}
.entity-results button:hover { background: #f3f4f6; }
.entity-results .meta { color: var(--muted); font-size: .8rem; }

/* Impersonatie */
.impersonation-banner {
    background: #f59e0b;
    color: #1f2937;
    padding: .65rem 0;
    font-size: .95rem;
}
.impersonation-banner .container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.impersonation-banner .btn {
    margin-left: auto;
    background: #fff;
    border: 1px solid #d97706;
}

.inline-form {
    display: inline;
}
.actions-cell {
    white-space: nowrap;
}
.actions-cell .btn {
    margin-right: .25rem;
}

.code-textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .85rem;
    line-height: 1.45;
}

/* Support / FreeScout */
.support-thread-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.support-msg {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.15rem;
    background: #fff;
}
.support-msg-customer {
    border-left: 4px solid var(--primary);
    background: #f8fafc;
}
.support-msg-agent {
    border-left: 4px solid #059669;
}
.support-msg-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .5rem;
    font-size: .9rem;
}
.support-msg-body {
    line-height: 1.55;
    word-break: break-word;
}
.support-msg-body img {
    max-width: 100%;
    height: auto;
}



/* Rich text editor – geïntegreerd in form */
.rte-wrap {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    padding: .4rem .5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.rte-toolbar button {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    padding: .3rem .55rem;
    cursor: pointer;
    font-size: .85rem;
    color: #374151;
}
.rte-toolbar button:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}
.rte-editor {
    min-height: 180px;
    padding: .85rem 1rem;
    line-height: 1.55;
    outline: none;
    background: #fff;
}
.rte-editor:focus {
    box-shadow: inset 0 0 0 2px #93c5fd;
}
.rte-editor.rte-invalid {
    box-shadow: inset 0 0 0 2px #f87171;
}
.rte-editor:empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}
.rte-hidden {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.support-attachments {
    margin: .75rem 0 0;
    padding-left: 1.1rem;
    font-size: .9rem;
}
.support-attachments a { color: var(--primary); }

code.access-code {
    font-size: .95rem;
    background: #f3f4f6;
    padding: .15rem .45rem;
    border-radius: 4px;
    letter-spacing: .04em;
}


.actions-cell {
    white-space: nowrap;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    justify-content: flex-end;
}
.actions-cell .btn { margin: 0; }

.logo-preview {
    margin: 1rem 0 1.25rem;
    padding: 1rem;
    background: #ec6724;
    border-radius: 8px;
    display: inline-block;
}
.logo-preview-img {
    max-height: 48px;
    max-width: 200px;
    width: auto;
    height: auto;
    display: block;
}
.sep {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}


.auth-logo {
    text-align: center;
    margin-bottom: 1rem;
}
.auth-logo img {
    max-height: 56px;
    max-width: 220px;
    width: auto;
    height: auto;
}

/* Dropzone uploader */
.dropzone {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
    padding: 1.75rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.dropzone:hover,
.dropzone:focus {
    border-color: var(--primary);
    background: #fff7f2;
    outline: none;
}
.dropzone.is-dragover {
    border-color: var(--primary);
    background: #fff0e8;
    box-shadow: 0 0 0 3px rgba(236, 103, 36, .2);
}
.dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}
.dropzone-icon {
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: .5rem;
    color: var(--primary);
}
.dropzone-title {
    margin: 0;
    font-weight: 600;
    font-size: 1.05rem;
}
.dropzone-sub {
    margin: .35rem 0 0;
    color: var(--muted);
}
.dropzone-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}
.dropzone-hint { margin: .75rem 0 0; }
.dropzone-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.dropzone-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem .75rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.dropzone-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f4f6;
    flex-shrink: 0;
}
.dropzone-thumb.icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    color: var(--muted);
    font-weight: 600;
}
.dropzone-meta { flex: 1; min-width: 0; text-align: left; }
.dropzone-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropzone-size { font-size: .85rem; color: var(--muted); }
.dropzone-remove {
    border: none;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    font-size: .9rem;
    padding: .25rem .4rem;
}
.dropzone-remove:hover { text-decoration: underline; }
.dropzone-item.is-error {
    border-color: #fca5a5;
    background: #fef2f2;
}

.dropbox-breadcrumb {
    margin: 0 0 1rem;
    font-size: .95rem;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
}
.dropbox-breadcrumb a { color: var(--primary); font-weight: 500; }
.dropbox-breadcrumb .sep { color: var(--muted); }
.form-inline-dropbox {
    display: flex;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
}
.dropzone-progress {
    margin-top: 1rem;
}
.dropzone-progress-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--primary);
    width: 0%;
    transition: width .2s;
}
