/* --- General & Layout --- */
body {
    font-family: 'Cabin', sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    padding: 20px;
    padding-top: 0; /* start layout from top edge of viewport */
}
body.admin-page {
    padding: 0;
    margin: 0;
}

p {
    font-size: 0.875rem;
}

.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    margin: 20px auto;

}

.page-header {
    text-align: center; /* center only the top title and quote */
    margin-bottom: 18px;
}

/* keep the request catcher card content left-aligned */
.tool-card.request-catcher { text-align: left; }

/* visual styling for the request-catcher endpoint box */
.tool-card.request-catcher .code-container {
    background-color: #f6f8fa; /* subtle highlighted background */
    padding: 12px 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    box-shadow: none;
    justify-content: space-between; /* put copy button at the right edge of the grey box */
    max-width: 720px; /* keep it shorter so copy button isn't far right */
    gap: 8px;

}

.tool-card.request-catcher #api-endpoint {
    flex: 1 1 auto; /* allow the URL to grow and push the copy button to the right edge */
    display: block;
    max-width: none; /* allow flex to manage width */
    overflow-wrap: anywhere;
    margin-right: 10px; /* small gap before the copy button */
}

.tool-card.request-catcher .copy-wrapper {
    margin-left: 6px;
    flex-shrink: 0;
    align-self: center;
}

h2 {
    color: #343a40;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.75rem;
}

h4 {
    text-align: left;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 1.1rem;
}

.description {
    color: #6c757d;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

footer {
    text-align: center;
    margin-top: 20px;
    color: #6c757d;
    font-size: 12px;
}

/* --- Loader Spinner --- */
.loader {
    border: 5px solid #f3f3f3; /* Light grey */
    border-top: 5px solid #007bff; /* Blue */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Back Button --- */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 6px 12px;
    font-size: 12px;
    background-color: #007bff; /* primary blue to match Request Log Viewer */
    color: #fff !important;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s;
    z-index: 1000;
}

.back-button:hover {
    background-color: #0056b3; /* darker primary on hover */
}

/* --- Main Menu (index.php) --- */
.tool-menu a {
    display: block;
    padding: 10px;
    margin: 8px 0;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    font-size: 14px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.tool-menu a:hover {
    background-color: #0056b3;
}

/* --- Info Box (index.php) --- */
.info-box {
    background-color: #f1f1f1;
    padding: 20px;
    border-radius: 8px;
    margin-top: 25px;
    border-left: 5px solid #007bff;
    text-align: left;
}

.info-box h4 {
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 8px;
    color: #007bff;
}

.info-box p {
    margin-bottom: 10px;
}

.code-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: transparent; /* remove the grey background to match cards */
    padding: 14px 12px; /* increase padding so it doesn't look slim */
    border-radius: 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
    font-size: 1rem; /* increase base size for the container */
    word-break: break-all;
}
/* Endpoint sizing adjusted to sit slightly below the description */
#api-endpoint {
    font-size: 0.875rem; /* slightly smaller than .description (0.9rem) */
    font-weight: 500;
    word-break: break-all;
    flex: 1 1 auto;
    text-align: left;
    margin-right: 10px;
    display: block;
}

/* Ensure the copy control stays aligned and doesn't shrink */
.code-container .copy-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    flex-shrink: 0;
    font-size: 0.95rem;
    color: #495057;
    background-color: transparent; /* copy control should be transparent */
    padding: 2px 6px;
    border-radius: 4px;
}

/* Admin-specific: make the code container look like the request catcher (bordered box) and align left */
.admin-main-content .code-container {
    background-color: #f6f8fa;
    border: 1px solid #e9ecef;
    padding: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* match request catcher */
    max-width: 720px; /* keep it shorter so copy button isn't far right */
    gap: 8px;
    margin-left: 0; /* ensure left-aligned inside card */
}

/* Ensure admin endpoint code and copy control match the public Request Catcher look */
.admin-main-content #webhook-endpoint {
    font-size: 0.875rem; /* same as #api-endpoint */
    font-weight: 500;
    word-break: break-all;
    flex: 1 1 auto;
    text-align: left;
    margin-right: 10px;
    display: block;
}

.admin-main-content .code-container .copy-wrapper {
    /* use a subtle panel-like background so the control is visible in admin */
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* make the inline copy control slightly smaller */
.code-container .copy-wrapper .copy-text {
    font-size: 0.78rem;
    padding: 0 6px;
}
.code-container .copy-wrapper .copy-icon {
    font-size: 13px;
}

/* Visible focus for keyboard users on copy controls */
.copy-wrapper[tabindex="0"]:focus {
    outline: 3px solid rgba(13,110,253,0.25);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Forms & Inputs (All Tools) --- */
.form-group {
    margin-bottom: 15px;
    text-align: left;
}

/* --- HTTP Method Badges (shared with admin) --- */
.method-badge {
    padding: 0.3em 0.6em;
    border-radius: 0.25rem;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    font-size: 0.8em;
}
.method-get { background-color: #28a745; }
.method-post { background-color: #007bff; }
.method-put { background-color: #ffc107; color: #212529; }
.method-delete { background-color: #dc3545; }
.method-head { background-color: #6f42c1; }
.method-other { background-color: #6c757d; }

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* --- Custom Checkboxes --- */
.checkbox-container {
    display: flex; align-items: center; gap: 10px;
    margin: 20px 0; padding-left: 5px; text-align: left; cursor: pointer;
}
.checkbox-container label { font-weight: normal; cursor: pointer; margin: 0; }
.checkbox-container input[type="checkbox"] { display: none; }
.checkbox-container .custom-checkbox {
    width: 18px; height: 18px; border: 2px solid #007bff;
    border-radius: 4px; display: inline-block; position: relative;
    transition: background-color 0.2s, border-color 0.2s; flex-shrink: 0;
}
.checkbox-container input[type="checkbox"]:checked + .custom-checkbox {
    background-color: #007bff; border-color: #007bff;
}
.checkbox-container input[type="checkbox"]:checked + .custom-checkbox::after {
    content: '✓'; font-size: 14px; color: white; position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
}

/* --- Buttons (All Tools) --- */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

button {
    flex: 1;
    background-color: #007bff;
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.button-secondary {
    background-color: #6c757d;
}

/* Lighter Clear button for search controls: keep scope small so other outline-secondary buttons are unaffected */
.input-group-append .btn-outline-secondary,
#clear-search-btn {
    background-color: #f7f8fa; /* very light grey */
    border-color: #e9ecef;     /* soft border */
    color: #495057;
}
.input-group-append .btn-outline-secondary:hover,
#clear-search-btn:hover,
.input-group-append .btn-outline-secondary:focus,
#clear-search-btn:focus {
    background-color: #eef2f6; /* slightly darker on hover/focus */
    border-color: #e3e7ea;
    color: #343a40;
}

/* Icon-style button similar to AWS console: circular, subtle border, hover/focus states */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: 50%;
    background-color: transparent;
    border: 1px solid rgba(0,0,0,0.08);
    color: #17a2b8; /* teal-blue accent for icon */
    cursor: pointer;
}
.btn-icon:hover {
    background-color: rgba(23,162,184,0.06);
}
.btn-icon:active {
    background-color: rgba(23,162,184,0.12);
}
.btn-icon:focus {
    outline: 3px solid rgba(23,162,184,0.15);
    outline-offset: 2px;
}

/* When placed inside Bootstrap input-group-append, make the icon's border slightly tighter
   so it sits flush with the input and other buttons. */
.input-group-append .btn-icon {
    border-radius: 4px;
    width: auto;
    height: auto;
    padding: 6px 10px;
}

.input-group-append .btn-icon {
    /* very light blue based on Bootstrap primary (#007bff) but much lighter for subtlety */
    background-color: rgba(0,123,255,0.06);
    border-color: rgba(0,123,255,0.12);
}
.input-group-append .btn-icon:hover {
    background-color: rgba(0,123,255,0.12);
}

/* Global toast / temporary alert used by admin pages (centered near top) */
#global-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(255,255,255,0.98);
    border: 1px solid #e9ecef;
    padding: 8px 14px;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    color: #007bff;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 3000;
}
#global-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.btn-icon img {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* If the provided PNG is light/white (as in the screenshot), invert it when placed inside the input group
   so it becomes visible against the light page background. This keeps the original PNG file unchanged. */
.input-group-append .btn-icon img {
    filter: invert(1) contrast(120%);
}

/* --- Enhanced Result Formatting --- */
.output-title {
    text-align: left;
    font-size: 1.1em;
    font-weight: bold;
    color: #343a40;
    margin-top: 30px;
    margin-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.result-card {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: left;
}

.result-card-header {
    background-color: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    font-weight: bold;
    color: #007bff;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    align-items: center;
}

.result-category {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}
.result-category:last-child {
    border-bottom: none;
}

.result-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
}
.result-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.result-item-label {
    font-weight: bold;
    color: #495057;
    flex-basis: 150px;
    padding-right: 10px;
}

.result-item-value {
    flex-grow: 1;
    flex-basis: 300px;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.9em;
}

.result-item-status {
    flex-basis: 120px;
    text-align: right;
    margin-left: auto;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-success { background-color: #28a745; }
.status-failure { background-color: #dc3545; }
.status-info { background-color: #007bff; }

.result-item-explanation {
    flex-basis: 100%;
    margin-top: 8px;
    font-size: 0.85em;
    color: #6c757d;
    padding-left: 10px;
    border-left: 3px solid #e9ecef;
}

/* --- Raw Output & Copy Button --- */
.result-box {
    position: relative;
    text-align: left;
    margin-top: 10px;
    padding: 15px;
    border: 1px solid #e3e3e3;
    border-radius: 5px;
    max-height: 450px;
    overflow: auto;
}
.result-box.raw-output {
    background-color: #f6f8fa;
    font-size: 12px;
    text-align: left;
}
.result-box pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Make pre blocks focusable and show visible focus for keyboard users */
.details-cell pre.selectable-pre {
    outline: none;
}
.details-cell pre.selectable-pre:focus {
    outline: 3px solid rgba(13,110,253,0.25);
    outline-offset: 2px;
}
/* make code blocks slightly larger in logs globally */
.details-cell pre.selectable-pre { font-size: 0.8rem; line-height: 1.1; }
/* titles and meta inside details cells */
.details-cell h5 { font-size: 0.85rem; margin: 0; font-weight: 600; }
.log-meta { font-size: 0.75rem; }
/* unify other standalone pre blocks (tool outputs, debug panels) */
#generatedCodeOutput, #modalCodeContent, #debugContent, #rawJsonOutput, .result-box pre {
    font-size: 0.8rem;
    line-height: 1.1;
}

/* Override default/bootstrap pre sizing globally so pre elements are slightly larger (~80%) */
pre, pre * { font-size: 80% !important; line-height: 1.1 !important; }
code, code * { font-size: 80% !important; }
.copy-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.result-box .copy-wrapper, .result-category .copy-wrapper {
    position: absolute;
    /* center vertically between the label and the code block */
    top: 50%;
    right: 15px;
    /* lift slightly above center so copy control sits a bit higher over the code block */
    transform: translateY(-58%);
    /* slightly stronger panel background so the control stands out above code */
    background-color: rgba(255,255,255,0.85);
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.copy-wrapper.inline-copy {
    display: inline-flex;
    margin-left: 6px;
    padding: 0 6px;
    font-size: 0.8em;
    background-color: transparent; /* transparent per request */
    border-radius: 0;
    color: #495057;
}
.copy-icon {
    font-size: 16px;
}

/* --- Form Scanner --- */
.scan-status {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    font-style: normal;
    font-size: 0.9em;
    color: #495057;
}
.page-list {
    font-family: 'Cabin', sans-serif;
    font-size: 1em;
}
.page-list a {
    font-family: 'Cabin', sans-serif;
    font-size: 1em;
}
.result-card-header .result-item-label {
    font-weight: bold;
    color: #007bff;
    flex-basis: auto;
}
.result-card-header .result-item-value {
    color: #343a40;
}

/* --- Product Explorer --- */
.product-explorer {
    display: flex;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    height: 50vh;
    min-height: 350px;
    overflow: hidden;
    background-color: #fff;
}

.product-list-pane {
    flex: 0 0 40%;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

#productSearch {
    padding: 10px;
    border: none;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}
#productSearch:focus {
    outline: none;
    border-bottom-color: #007bff;
}

#productList {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

#productList li {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    transition: background-color 0.2s;
}

#productList li:hover {
    background-color: #f8f9fa;
}

#productList li.active {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

#productList .product-id {
    font-weight: bold;
    display: block;
    font-size: 0.9em;
    margin-bottom: 2px;
}

#productList .product-name {
    font-size: 0.8em;
    color: #6c757d;
    display: block;
}
#productList li.active .product-name {
    color: #e0e0e0;
}

.product-details-pane {
    flex: 1;
    padding: 0;
    overflow-y: auto;
}

.product-details-pane .placeholder-text {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #6c757d;
    font-style: italic;
}

.product-details-pane .result-category {
    padding: 20px;
}

.product-details-pane .result-item {
    text-align: left;
}

.product-details-pane .result-item-label,
.product-details-pane .result-item-value {
    font-size: 0.8em;
    font-family: 'Cabin', sans-serif;
}
.url-link-icon {
    text-decoration: none;
    margin-left: 5px;
}

/* --- Feedback Button & Modal --- */
.feedback-button {
    width: 100%;
    margin-top: 20px;
    background-color: #28a745;
    font-size: 16px;
}
.feedback-button:hover {
    background-color: #218838;
}

.body-modal-open > *:not(.modal) {
    filter: blur(5px);
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 1001; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
    animation: fadeIn 0.3s;
    display: flex;
    flex-direction: column;
}
.modal-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}
.modal-content .modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}
.modal-content .modal-header .copy-wrapper {
    position: relative;
    top: auto;
    right: auto;
    font-size: 0.9em;
}
.modal-content .result-box {
    margin: 0;
    border: none;
    border-radius: 0;
    max-height: 60vh;
}
.modal-content .button-group {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
}

@keyframes fadeIn {
    from {opacity: 0; transform: scale(0.95);}
    to {opacity: 1; transform: scale(1);}
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.honeypot-field {
    display: none;
}

#form-message {
    margin-top: 15px;
    font-weight: bold;
}

/* --- Admin Panel --- */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Make the sidebar fixed so it always spans the full viewport height even when the page scrolls */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    background-color: #007bff;
    color: white;
    padding: 20px;
    overflow: auto;
}
.admin-sidebar h3 {
    margin-bottom: 30px;
}

/* Sidebar user info (username and timestamps) */
.sidebar-user-info {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    position: relative; /* allow absolutely positioned tooltip inside */
}
.sidebar-user-info .sidebar-username {
    font-weight: 600;
    font-size: 0.95rem;
}
.sidebar-user-info .sidebar-time {
    font-size: 0.75rem; /* compact time display */
    color: rgba(255,255,255,0.95);
    line-height: 1.15;
}
.sidebar-user-info .sidebar-time #sidebar-time-value,
.sidebar-user-info .sidebar-time #sidebar-time-epoch {
    color: #fff;
    font-size: 0.75rem; /* match compact time size */
    line-height: 1.15;
}

/* Time mode two-option switch */
.time-toggle-switch {
    display: inline-flex;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    padding: 2px;
}
.time-toggle-switch .toggle-option {
    background: transparent;
    border: none;
    color: #e9ecef;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
}
.time-toggle-switch .toggle-option.active {
    background: #fff;
    color: #007bff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.time-toggle-switch .toggle-option[aria-pressed="false"] { opacity: 0.7; }

/* prevent the epoch small from changing layout width as it updates */
.sidebar-user-info .sidebar-time small { display: inline-block; min-width: 88px; text-align: left; margin-left:6px; }

/* Floating copied tooltip inside admin sidebar */
/* Tooltip used for copy feedback. It's appended to the nearest .sidebar-user-info when possible */
.admin-sidebar .copy-tooltip {
    position: absolute;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 1200;
    display: none; /* hidden by default */
    white-space: nowrap;
    max-width: 220px;
}
.admin-sidebar .copy-tooltip.visible {
    display: block;
    opacity: 1;
    transform: translateY(-8px) scale(1);
}

/* ensure sidebar time area stacks and doesn't overflow */
.sidebar-user-info .sidebar-time { display:flex; flex-direction:column; gap:2px; }
.sidebar-user-info .sidebar-time span#sidebar-time-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 100%; }
.admin-sidebar .sidebar-link {
    display: block;
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.2s;
}
.admin-sidebar .sidebar-link:hover {
    background-color: #0056b3;
}

/* Shift main content over to account for the fixed sidebar */
.admin-main-content {
    margin-left: 250px;
    flex-grow: 1;
    padding: 0;
    background-color: #f8f9fa;
    min-height: 100vh;
    overflow-y: auto;
}
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.login-error {
    color: #dc3545;
    margin-top: 10px;
}
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background-color: #fff;
    height: 100%;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.admin-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.admin-controls input[type="text"] {
    max-width: 400px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    text-align: left;
    vertical-align: middle;
}

    /* Smaller text for user management table */
    .user-management-table th, .user-management-table td {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
.admin-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}
.admin-table .feedback-text {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 400px;
}
.status-select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ced4da;
}
.hide-button {
    padding: 4px 10px;
    font-size: 12px;
}
.admin-table tr.status-row-completed { background-color: #e9f7ef; }
.admin-table tr.status-row-in-progress { background-color: #fff8e1; }
.admin-table tr.status-row-rejected { background-color: #fbe9e7; }
.archive-indicator {
    background-color: #e9ecef;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}
.table-wrapper {
    margin-top: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    overflow-y: auto;
    max-height: 70vh;
}
.admin-table .highlighted {
    background-color: #ffebee !important;
}


/* dark mode CSS removed (toggle UI was removed) */
html.dark-mode .modal-content .modal-header { border-color: #444; }
html.dark-mode .close-button { color: #aaa; }
html.dark-mode .close-button:hover { color: #fff; }
html.dark-mode .login-container { background-color: #1e1e1e; }
html.dark-mode .admin-table th, html.dark-mode .admin-table td { border-color: #444; }
html.dark-mode .admin-table th { background-color: #3a3a3a; }
html.dark-mode .admin-table tr.status-row-completed { background-color: #1c3a27; }
html.dark-mode .admin-table tr.status-row-in-progress { background-color: #3d3623; }
html.dark-mode .admin-table tr.status-row-rejected { background-color: #422625; }
html.dark-mode .admin-sidebar { background-color: #0056b3; }
html.dark-mode .admin-sidebar h3 { color: #fff; padding: 12px 16px; margin: 0 0 8px 0; }
html.dark-mode .admin-sidebar .sidebar-link { color: rgba(255,255,255,0.95); border-bottom: 1px solid rgba(255,255,255,0.03); }
html.dark-mode .admin-sidebar .sidebar-link.active { background-color: rgba(255,255,255,0.06); color: #fff; }
html.dark-mode .admin-sidebar .sidebar-user-info { color: #e9eef8; }
html.dark-mode .admin-sidebar .sidebar-username { font-weight:700; color: #fff; }
html.dark-mode .admin-sidebar .sidebar-time-label, html.dark-mode .admin-sidebar .sidebar-unix-label { color: #cfe3ff; }
html.dark-mode .admin-sidebar .click-to-copy { color: #fff; }
html.dark-mode .admin-main-content { color: #e0e0e0; }
html.dark-mode .admin-toggle-btn { background: rgba(255,255,255,0.06); color: #fff; border: 1px solid rgba(255,255,255,0.04); }
html.dark-mode .admin-sidebar-close { color: #fff; }
html.dark-mode .back-button { background-color: #0d6efd; color: #fff !important; }
html.dark-mode .action-button { background-color: #0d6efd; color: #fff; }
html.dark-mode .admin-main-content { background-color: #121212; }
html.dark-mode .admin-container { background-color: #1e1e1e; }
html.dark-mode .archive-indicator { background-color: #3a3a3a; color: #e0e0e0; }
html.dark-mode .result-box.raw-output { background-color: #22272e; }
html.dark-mode .copy-wrapper { background-color: rgba(0,0,0,0.5); }
html.dark-mode .table-wrapper { border-color: #444; }
html.dark-mode .admin-table .highlighted { background-color: #4a1e1e !important; }
html.dark-mode .scan-status { background-color: #3a3a3a; }

/* Admin toggle button: hidden by default, visible only on narrow viewports */
.admin-toggle-btn { display: none; }
@media (max-width: 900px) {
    .admin-toggle-btn { display: inline-block !important; z-index: 4000; position: fixed; left: 12px; top: 12px; background: rgba(255,255,255,0.95); border-radius: 6px; padding: 6px 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
}
@media (min-width: 901px) {
    .admin-toggle-btn { display: none !important; }
}

/* screen-reader only helper */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Responsive sidebar behaviour: hide sidebar by default on small screens and show via .open */
.admin-sidebar-close { display: none; }
@media (max-width: 900px) {
    /* Hide sidebar off-canvas by default */
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 220ms ease;
        width: 80%;
        max-width: 340px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.25);
        z-index: 3000;
    }
    /* When open, slide back in */
    .admin-sidebar.open {
        transform: translateX(0);
    }
    /* Show a close control only on small screens */
    .admin-sidebar-close {
        display: inline-block;
        position: absolute;
        top: 12px;
        right: 12px;
        background: transparent;
        border: none;
        color: white;
        font-size: 18px;
        cursor: pointer;
        padding: 6px;
        line-height: 1;
    }
    /* Remove left margin for main content so it fills the viewport when sidebar is hidden */
    .admin-main-content {
        margin-left: 0;
    }
    /* Add a light overlay when sidebar is open (using body class set by JS) */
    body.sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 2500;
        pointer-events: auto;
    }
}
