:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.admin-shell {
    display: flex;
    min-height: 100vh;

    /* Let the shell grow wider than the screen if the content needs it */
    width: max-content;

    /* But never smaller than the browser window */
    min-width: 100%;

}

.admin-sidebar {
	/*
    width: 260px;
    background: #111827;
    color: #ffffff;
    padding: 24px 18px;
    flex: 0 0 260px;
    */
    background: #111827;
    color: #ffffff;
    border-bottom: 1px solid var(--border);

    padding-top: 5px;
    padding-right: 28px;
    padding-bottom: 15px;
    padding-left: 28px;

    display: block;
    justify-content: space-between;
    align-items: center;

}

.admin-logo {
    font-size: 20px;
    font-weight: 700;

}

.admin-nav {
	/*
    display: flex;
    flex-direction: column;
    gap: 8px;
    */
}

.admin-nav a {
    color: #d1d5db;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 500;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: #1f2937;
    color: #ffffff;
}




.admin-nav-button {
    width: 100%;
    color: #d1d5db;
    background: transparent;
    border: 0;
    text-align: left;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 500;
    font: inherit;
    cursor: pointer;
}

.admin-nav-button:hover,
.admin-nav-button.active {
    background: #111827;
    color: #ffffff;
}



.admin-main {
    flex: 1 0 auto;
    min-width: 0;
}

.admin-topbar {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-title {
    margin: 0;
    font-size: 24px;
}

.admin-user {
    color: var(--muted);
    font-size: 14px;
}

.admin-user-nav {
    color: var(--text);
    font-size: 14px;
}


.admin-content {
    padding: 28px;
    min-width: max-content;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.card-label {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    margin: 0;
    font-size: 18px;
}

.admin-table-wrap,
.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.admin-table th {
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-table tr:hover {
    background: #f9fafb;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.form-grid {
    display: grid;
    gap: 16px;
    max-width: 680px;
}

.form-row label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    font: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

/*
@media (max-width: 900px) {
    .admin-shell {
        display: flex;
        width: max-content;
        min-width: 100%;
    }

    .admin-sidebar {
        width: 260px;
        flex: 0 0 260px;
    }

    .admin-main {
        flex: 1 0 auto;
    }

    .admin-nav {
        flex-direction: column;
        overflow-x: visible;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .admin-content {
        padding: 18px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .admin-topbar {
        display: block;
    }

    .admin-title {
        margin-bottom: 6px;
    }
}

*/










.admin-table-form {
    width: 100%;
}

.admin-table-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.admin-table thead th {
    vertical-align: top;
    background: #f9fafb;
}

.admin-th-title {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.admin-th-filter {
    position: relative;
    min-width: 150px;
}

.admin-th-filter-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.admin-th-filter input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 8px 10px 8px 32px;
    font-size: 13px;
    font: inherit;
    background: #ffffff;
    color: #111827;
}

.admin-th-filter input::placeholder {
    color: #9ca3af;
}

.admin-th-filter input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}



.admin-th-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.admin-th-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.admin-sort-buttons {
    display: inline-flex;
    gap: 4px;
}

.admin-sort-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}

.admin-sort-button:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
}

.admin-sort-button.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.admin-sort-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border-radius: 999px;
    padding: 2px 6px;
    background: #e0ecff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
}


.admin-row-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.admin-row-actions form {
    display: inline-flex;
    margin: 0;
}

.admin-row-actions .btn {
    height: 38px;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.admin-row-actions .btn {
    width: auto;
}





















.status {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-success {
    background: #e6f4ea;
    color: #137333;
}

.status-failed {
    background: #fce8e6;
    color: #a50e0e;
}

.status-processing {
    background: #e8f0fe;
    color: #174ea6;
}

.status-uploaded {
    background: #f1f3f4;
    color: #3c4043;
}



/************************************************************************/


.wysiwyg-box {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.wysiwyg-toolbar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.wysiwyg-toolbar button {
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
}

.wysiwyg-toolbar button:hover {
    background: #f3f4f6;
}

.wysiwyg-editor {
    min-height: 260px;
    padding: 14px;
    outline: none;
    line-height: 1.6;
}

.wysiwyg-editor:focus {
    box-shadow: inset 0 0 0 2px #2563eb;
}


.wysiwyg-source {
    width: 100%;
    min-height: 260px;
    padding: 14px;
    border: 0;
    outline: none;
    resize: vertical;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.6;
}

.wysiwyg-source:focus {
    box-shadow: inset 0 0 0 2px #2563eb;
}


.wysiwyg-toolbar select {
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
}

.wysiwyg-editor h1 {
    font-size: 32px;
    margin: 0 0 16px;
}

.wysiwyg-editor h2 {
    font-size: 26px;
    margin: 0 0 14px;
}

.wysiwyg-editor h3 {
    font-size: 21px;
    margin: 0 0 12px;
}

.wysiwyg-editor h4 {
    font-size: 18px;
    margin: 0 0 10px;
}

.wysiwyg-editor blockquote {
    border-left: 4px solid #d1d5db;
    margin: 12px 0;
    padding: 8px 14px;
    background: #f9fafb;
}

.wysiwyg-editor img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 12px 0;
}

/***********************************************************************/





