/* =============================================================
   === GENERAL / SHARED STYLES
   ============================================================= */

html, body {
    background: #cbd4ef;
    margin: 0;
    padding: 0;
    font-family: Tahoma, sans-serif;
    min-height: 100vh;
}
/* =============================================================
   === PROJECT DROPDOWN - NICE WHITE CARD STYLE (much narrower)
   ============================================================= */

.project-selector-row {
    width: 100%;
    max-width: 540px;
    margin: 0 auto 32px auto;
    padding: 22px 28px;
    background: #ffffff;
    border: 2px solid #000;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);

    /* Make it a flex row with nice spacing between label and dropdown */
    display: flex;
    align-items: center;
    gap: 18px;                    /* ← this is the spacing you wanted */
}

.project-selector-row label {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    color: #263F3B;
    margin: 0;
}

.project-selector-row select {
    flex: 1;
    min-width: 380px;
    padding: 13px 16px;
    font-size: 13.5px;
    border: 2px solid #333;
    border-radius: 8px;
    background: white;
}


/* =============================================================
   === ADMIN DASHBOARD (ad-)
   ============================================================= */

.ad-container {
    background: #cbd4ef;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 35px 20px 20px;
    box-sizing: border-box;
}

.ad-dashboard {
    background: white;
    border-radius: 24px;
    padding: 30px;
    max-width: 920px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    text-align: left;
}

.ad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    margin-top: 30px;
}

.ad-card {
    background: white;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    border: 1px solid #f1f5f9;
    transition: all 0.25s ease;
}

.ad-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    border-color: #bae6fd;
}

.ad-card strong {
    display: block;
    font-size: 1.35rem;
    margin-bottom: 10px;
    color: #1e293b;
}

.ad-card small {
    color: #64748b;
    font-size: 0.95em;
    line-height: 1.45;
}

.ad-back-link {
    text-align: center;
    margin-top: 30px;
    font-size: 1.05em;
}

/* ad- modal */
.ad-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.65);
}

.ad-modal-content {
    background: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 40px 44px;
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

/* =============================================================
   === ADMIN_FLAGS (af-)
   ============================================================= */

.af-container {
    background: #cbd4ef;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 35px 20px 20px;
    box-sizing: border-box;
}

.af-dashboard {
    background: white;
    border-radius: 24px;
    padding: 30px;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.af-top-header { margin-bottom: 25px; }

.af-top-actions {
    text-align: center;
    margin-bottom: 30px;
}

.af-project-card {
    background: white;
    border-radius: 20px;
    padding: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.af-empty-state {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

.af-back-link {
    margin-top: 40px;
    text-align: center;
}

.af-assignments-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 9.5pt;
    border: 2px solid #5a9866;
}

.af-assignments-table th,
.af-assignments-table td {
    border: 2px solid #5a9866;
    padding: 12px 10px;
    vertical-align: top;
    text-align: left;
}

.af-assignments-table th {
    background-color: #5a9866;
    color: #ffffff;
    font-weight: bold;
    text-align: center;
}

.af-assignments-table td.description {
    text-align: left;
    padding-left: 16px;
    line-height: 1.4;
}

.af-assignments-table tr:nth-child(even) {
    background-color: #f8fafc;
}

/* Study Flags Table - Balanced Columns */
.af-assignments-table th:nth-child(1) { width: 32%; }   /* Study Flag */
.af-assignments-table th:nth-child(2) { width: 32%; }   /* Study Flag Description */
.af-assignments-table th:nth-child(3) { width: 12%; }   /* Created By */
.af-assignments-table th:nth-child(4) { width: 14%; }   /* Created */
.af-assignments-table th:nth-child(5) { width: 10%; }   /* Actions */

/* af- modal */
.af-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.65);
}

.af-modal-content {
    background: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 40px 44px;
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.af-form-label {
    display: block;
    margin: 10px 0 5px;
    font-weight: 600;
    color: #334155;
}

.af-form-input,
.af-form-textarea {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.af-form-buttons {
    margin-top: 30px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.af-form-buttons button {
    padding: 12px 28px;
    font-size: 1.05rem;
    min-width: 130px;
}

.af-response-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    display: none;
}

.af-page-title {
    text-align: center;
    font-size: 22px;
    color: #000000;
    margin-bottom: 20px;
    font-weight: 600;
}

/* =============================================================
   === ADMIN_PROJECTS (ap-) - CARD + LAYOUT + MODALS
   ============================================================= */

.ap-container {
    background-color: #cbd4ef;
    min-height: 100vh;
    padding: 30px 20px;
    display: flex;
    justify-content: center;
}

.ap-dashboard {
    background: white;
    border: 2px solid #000000;
    border-radius: 24px;
    padding: 30px;
    max-width: 920px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.ap-focus-cell {
    max-height: 160px;           /* Half the previous height */
    overflow-y: auto;
    display: block;
    padding: 10px 12px;
    line-height: 1.45;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 25px;
}

/* Optional: Add a bit more space to the rows below */
.ap-info-table tr + tr {
    margin-top: 12px;
}

/* Action bar & buttons */
.ap-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 25px;
    align-items: center;
}

.ap-delete-project-btn {
    margin-left: auto;
}

.ap-action-btn {
    padding: 9px 16px;
    font-size: 12px;
    white-space: nowrap;
}

/* Global dashboard typography */
.ap-dashboard,
.ap-dashboard * {
    font-family: Tahoma, Arial, sans-serif;
    font-size: 10pt;
}

/* =============================================================
   === PROJECT SELECTOR
   ============================================================= */

.ap-project-selector-row {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.ap-project-selector-row label {
    font-weight: bold;
    color: #263F3B;
    white-space: nowrap;
}

.ap-project-selector-row select {
    padding: 8px 14px;
    font-size: 13px;
    border: 2px solid #E6F4F1;
    border-radius: 6px;
    background: #F5F2EB;
    color: #263F3B;
    min-width: 420px;
}

/* =============================================================
   === MODALS (Edit + Add New Project + Audit Trail)
   ============================================================= */

.ap-edit-modal,
.ap-add-modal,
.ap-audit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: flex-start;   /* changed from center so tall content can scroll properly */
    justify-content: center;
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    padding-top: 40px;         /* give a bit of breathing room from the very top */
}

.ap-edit-modal-content,
.ap-add-modal-content {
    background: white;
    padding: 20px 24px;
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;                 /* centers the inner card inside the outer .ap-dashboard */
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border: 8px solid #E6F4F1;
    position: relative;
    box-sizing: border-box;
}

.ap-audit-modal-content {
    background: white;
    width: 100%;
    max-width: 720px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border: 8px solid #E6F4F1;
    overflow: hidden;
    padding: 25px 30px;
}



/* Modal headings */
.ap-edit-modal-content h2,
.ap-add-modal-content h2,
.ap-audit-modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1f2937;
    font-size: 1.35rem;
}

/* Form elements inside Edit / Add modals */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
}

.ap-edit-modal-content input,
.ap-edit-modal-content textarea,
.ap-add-modal-content input,
.ap-add-modal-content textarea {
    font-family: Tahoma, Arial, sans-serif;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    outline: none;
}

.ap-edit-modal-content input:focus,
.ap-edit-modal-content textarea:focus,
.ap-add-modal-content input:focus,
.ap-add-modal-content textarea:focus {
    border-color: #3b82f6;
}

.ap-edit-project-btn {
    color: #000;
}

/* Modal buttons */
.modal-buttons {
    margin-top: 30px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Add New Project form (uses ap- prefix per admin screen convention) */
.ap-form-buttons {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.ap-grok-btn {
    background: #0a7c3d;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.ap-add-title {
    margin-top: 0;
    font-size: 1.45rem;
    text-align: center;
    margin-bottom: 25px;
}

.ap-project-name-input {
    max-width: 520px;
    font-size: 15px;
}

.ap-add-modal-content .ap-focus-textarea,
.ap-focus-textarea {
    width: 100%;
    min-height: 80px;
}

.ap-focus-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}

.ap-char-count {
    font-size: 0.75em;
}

.ap-char-count span {
    font-size: inherit;
}

.ap-form-error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}

.ap-add-modal-content .form-group {
    margin-bottom: 8px;
}

/* =============================================================
   === AUDIT TRAIL TABLE
   ============================================================= */

.ap-audit-modal table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.ap-audit-modal th,
.ap-audit-modal td {
    padding: 12px 18px;
    text-align: left;
    font-size: 13px;
    vertical-align: top;
}

.ap-audit-modal th {
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
}

.ap-audit-modal td {
    border-bottom: 1px solid #eee;
}

/* =============================================================
   === REFER-BACK URL - Clean two-column layout (#2)
   ============================================================= */

.ap-refer-back-row td:first-child {
    vertical-align: top;
    padding-top: 12px;
    width: 180px;
}

.ap-refer-back-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    border: 1px solid #ccc;
    padding: 12px;
    border-radius: 6px;
}

/* Refer-Back URL card - change from blue to black */
.ap-refer-back-card {
    border: 2px solid #000000;        /* Black border */
    border-radius: 10px;
}

.ap-refer-back-url {
    flex: 1;
    font-size: 13px;
    word-break: break-all;
    font-family: monospace;
    background: transparent;
    border: none;
    padding: 0;
}

.ap-copy-btn {
    padding: 6px 14px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}

/* =============================================================
   === STRIPE BANNERS
   ============================================================= */

.ap-success-banner {
    background: #10b981;
    color: #fff;
    padding: 20px;
    margin: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1em;
}

.ap-error-banner {
    background: #ef4444;
    color: #fff;
    padding: 20px;
    margin: 20px;
    border-radius: 8px;
    text-align: center;
}

/* Center the "Add New Project" button above the two-column area for balance */
.ap-add-button-wrapper {
    text-align: center;
    margin-bottom: 15px;
}

/* =============================================================
   === ADMIN_PROJECTS - TWO-COLUMN LAYOUT + BUTTON SPACING
   ============================================================= */

.ap-main-content {
    display: flex;
    gap: 35px;
    align-items: start;
    max-width: 860px;
    margin: 0 auto;
}

/* Left project info card — allows it to take the remaining space next to the fixed-width refer-back card */
.ap-project-info-card {
    flex: 1;
    min-width: 0;
}

.ap-action-bar {
    margin-top: 25px;
    margin-bottom: 45px;        /* ← more space before Refer-Back URL */
    padding-top: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ap-refer-back-card {
    flex: 0 0 340px;
    background: #f8f9fa;
    border: 2px solid #0066cc;
    border-radius: 10px;
    padding: 20px;
}

.ap-refer-back-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ap-refer-back-header .title {
    font-weight: bold;
    color: #222b22;
    font-size: 1.1em;
}

.ap-copy-btn {
    font-size: 12px;
    padding: 4px 12px;
    height: 28px;
    line-height: 1;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Extra spacing after "Include Scientific names" checkbox */
#includeScientificGrok {
    margin-bottom: 25px;
}

#scientificCheckboxLabel {   /* fallback if there's a wrapping label */
    margin-bottom: 25px;
}


/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* =============================================================
   ADMIN_SEARCH_TERMS - CLEAN & FINAL (2026)
   ============================================================= */


/* (Column widths are now defined in the tighter rules below for the 6-column layout) */

/* === CONTAINER & LAYOUT === */
.as-container {
    background: #cbd4ef;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 35px 40px 40px;
    box-sizing: border-box;
}

/* === MAIN WHITE CARD === */
.as-main-card {
    background: #ffffff;
    border: 2px solid #000;
    border-radius: 20px;
    padding: 32px 32px 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    width: 100%;
    max-width: 1680px;   /* wider to give Search Term column more room */
    box-sizing: border-box;
    overflow: hidden;
}

/* Project selector inside main card */
.as-main-card .project-selector-row {
    margin: 0 auto 32px auto;
    max-width: 720px;
    padding: 22px 28px;
    background: #ffffff;
    border: 2px solid #000;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

/* === 3-CARD GRID === */
.as-main-grid {
    display: grid;
    grid-template-columns: 2.1fr 1.1fr 0.95fr;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* === CARDS === */
.as-card {
    background: #ffffff;
    border: 2px solid #000;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    font-family: Tahoma, sans-serif;
    font-size: 10pt;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

.as-card-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
}

.as-total-info,
.as-card-instruction {
    font-family: Tahoma, sans-serif;
    font-size: 10pt;
    line-height: 1.4;
    margin-bottom: 15px;
    color: #444;
}

/* === TABLE === */
.as-table-container {
    width: 100%;
    /* No fixed height or scrolling here — the parent .as-card-body handles scrolling for the whole left card.
       This lets the table use the full width of the wide Card 1 and feels like one open area. */
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin: 10px 0 6px;
    box-sizing: border-box;
    overflow: visible;   /* let content flow naturally into the card-body scroller */
}

.as-searches-table {
    width: 100%;
    table-layout: fixed;
    box-sizing: border-box;
}

.as-searches-table td {
    word-break: break-word;        /* Allows long words to wrap */
    white-space: normal;           /* Allows text to wrap to next line */
    vertical-align: top;
    /* max-width removed — column % widths now control sizing (see "TABLE COLUMN WIDTHS" section below) */
}

/* Optional: Make the columns clearer */
.as-searches-table td:first-child {
    font-weight: 500;
    color: #222;
}

.as-searches-table .checkbox-col {
    width: 38px;
    text-align: center;
}

.as-searches-table .studies-col,
.as-searches-table th.studies-col {
    width: 115px;
    max-width: 115px;
    text-align: center;
    padding: 8px 6px 8px 12px;
}

.as-searches-table td.studies-col {
    font-weight: bold;
    color: #d9534f;
}

.as-searches-table th:not(.checkbox-col):not(.studies-col) {
    text-align: left;
}

/* Bulk actions */
.bulk-actions,
.as-manual-action-buttons {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

/* === DIRECTIVE SECTION === */
.as-directive-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.as-clear-btn {
    font-size: 12px;
    padding: 4px 14px;
    height: 28px;
}

#searchTermDirective {
    min-height: 180px;
}

/* Make textareas consistent */
.as-card textarea.form-control {
    border: 2px solid #333333;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    width: 100%;
    box-sizing: border-box;
}

/* === PAGE TITLE === */
.as-page-title {
    margin: 0 0 24px 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #263F3B;
    text-align: center;
    font-family: Tahoma, Arial, sans-serif;
}

/* === MISC FIXES === */
.as-manual-checkbox {
    margin-top: 14px;
    padding-left: 4px;
}

/* === GENERATE BUTTON SPINNER === */
.as-generate-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #333333;
    border-radius: 8px;
    gap: 8px;
    transition: all 0.2s ease;
}

.as-generate-btn:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}



/* Spinner */
.as-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: as-spin 0.8s linear infinite;
    display: none;
}

.as-generate-btn.loading .as-spinner {
    display: inline-block;
}

@keyframes as-spin {
    to {
        transform: rotate(360deg);
    }
}

/* === TABLE COLUMN WIDTHS (Search Terms Page) === */
.as-searches-table {
    table-layout: fixed;
    width: 100%;
}

.as-searches-table th.checkbox-col,
.as-searches-table td.checkbox-col {
    width: 38px;
    min-width: 38px;
}

/* Nudge the "select all" header checkbox slightly left so it lines up with the row checkboxes */
.as-searches-table th.checkbox-col .select-all-terms {
    margin-left: -1px;
}

.as-searches-table th:not(.checkbox-col):not(.studies-col) {
    text-align: left;
}

/* === Nbr of Studies Column === */
.as-searches-table th.studies-col,
.as-searches-table td.studies-col {
    width: 102px;
    max-width: 102px;
    text-align: center;
    padding: 8px 4px 8px 8px;   /* reduced right padding so pencil sits tighter */
    font-weight: bold;
}

/* Remove any red color */
.as-searches-table td.studies-col {
    color: inherit;   /* Keeps the normal text color */
}

/* === Actions column — very tight against Studies count === */
.as-searches-table th.actions-col,
.as-searches-table td.actions-col {
    width: 26px;
    min-width: 26px;
    max-width: 26px;
    text-align: center;
    padding: 4px 0 4px 0;   /* almost zero padding — pencil hugs the studies count */
}

.as-searches-table .edit-term-btn {
    background: none;
    border: 1px solid #0367A6;
    color: #0367A6;
    font-size: 11px;
    line-height: 1;
    padding: 0 2px;
    border-radius: 2px;
    cursor: pointer;
    min-width: 16px;
}

.as-searches-table .edit-term-btn:hover {
    background: #0367A6;
    color: white;
}

/* Red pencil when this search term has API exclusions set */
.as-searches-table .edit-term-btn.has-exclusions {
    border-color: #dc3545;
    color: #dc3545;
}

.as-searches-table .edit-term-btn.has-exclusions:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Name columns — Scientific Name widened significantly (was too narrow) */
.as-searches-table th:first-child:not(.checkbox-col),
.as-searches-table td:first-child:not(.checkbox-col) {  /* Search Term */
    width: 34%;
}

.as-searches-table th:nth-child(3),
.as-searches-table td:nth-child(3) {   /* Common Name */
    width: 20%;
}

.as-searches-table .scientific-col {   /* Scientific Name — now much wider */
    width: 28%;
}

/* Remove the old tight max-width cap so wide columns (especially Scientific) can actually use the space in the wide left card */
.as-searches-table td {
    max-width: none;
}
/* =============================================================
   ADMIN USERS PAGE STYLES (au- prefix)
   ============================================================= */

/* === PAGE CONTAINER === */
.au-container {
    background-color: #cbd4ef;
    min-height: 100vh;
    padding: 30px 20px;
    display: flex;
    justify-content: center;
}

/* === MAIN OUTER CARD (wide) === */
.au-dashboard {
    background: #ffffff;
    border: 2px solid #000;
    border-radius: 24px;
    padding: 30px;
    max-width: 1400px;   /* wide enough for the users table */
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

/* Project switcher on Manage Users page - placed below the title inside the card */
.au-dashboard .au-project-switcher {
    margin-top: 12px;
    margin-bottom: 20px;
}



/* === Manage Users page specific styles (au- prefix) === */

/* Extra spacing so project dropdown sits nicely below the page title */
.au-dashboard .au-title {
    margin-bottom: 30px;
}





.au-quick-edit-row {
    margin-bottom: 24px;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 6px;
}

.au-quick-edit-select {
    min-width: 620px;
    padding: 10px 14px;
    margin: 0 14px;
}



/* === INNER CONTENT CARD (narrower) === */
.au-content-card {
    background: #ffffff;
    border: 2px solid #000;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    margin: 28px auto 0;
    width: 100%;
    max-width: 88%;
    box-sizing: border-box;
}

/* === FORM STYLES === */
.au-form-label {
    display: block;
    margin: 10px 0 5px;
    font-weight: 600;
    color: #334155;
}

.au-form-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.au-form-small {
    color: #64748b;
    font-size: 0.9em;
}

.au-form-buttons {
    margin-top: 30px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* === USERS TABLE === */
.au-users-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.au-users-table th,
.au-users-table td {
    padding: 12px 18px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.au-users-table th {
    background: #f8fafc;
    font-weight: 600;
}

.au-users-table th:last-child,
.au-users-table td:last-child {
    text-align: center;
}

/* === MODALS === */
.au-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.65);
}

.au-modal-content {
    background: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 40px 44px;
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

/* =============================================================
   ADD USER MODAL - CLEAN FORM STYLES
   ============================================================= */

.au-modal-content {
    max-width: 460px;
    padding: 32px 36px;
}

.au-modal-content h2 {
    margin: 0 0 24px 0;
    font-size: 22px;
}

/* Form Groups */
.au-form-group {
    margin-bottom: 18px;
}

.au-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

/* Inputs & Select */
.au-form-input,
.au-modal-content input[type="text"],
.au-modal-content input[type="email"],
.au-modal-content input[type="tel"],
.au-modal-content input[type="password"],
.au-modal-content select {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    background: white;
}

/* === Role Select in Add User Modal === */
.au-modal-content select {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: white;
    box-sizing: border-box;
    cursor: pointer;
}

/* Buttons */
.au-btn {
    padding: 10px 22px;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #ccc;
    background: white;
}

.au-btn-primary {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 10px 26px;
}

.au-form-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 10px;
}

/* ============================================
   LOGIN PAGE (login- prefix)
   ============================================ */
/* ============================================
   LOGIN PAGE (login-)
   ============================================ */

/* Container */
.login-container {
    background: #cbd4ef;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px 15px;
    box-sizing: border-box;
}

.login-wrapper {
    max-width: 420px;
    width: 100%;
}

/* Card */
.login-card {
    background: white;
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 4px;           /* very small gap */
}

.login-card h2 {
    text-align: center;
    margin-bottom: 18px;
    color: #1e293b;
    font-size: 1.3rem;
}

/* Login inputs - username + password */
.login-card .login-input {
    width: 100%;
    padding: 10px 13px;
    font-size: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

/* Form elements */
.login-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}


.login-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-button {
    width: 100%;
    padding: 11px;
    font-size: 1.05rem;
    font-weight: 600;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 6px;
}

.login-button:hover {
    background: #0055aa;
}

.login-error-message {
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 9px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}
.login-error-message a {
    color: #b91c1c;
    text-decoration: underline;
    font-weight: 600;
}

/* SMS form */
.login-sms-info {
    text-align: center;
    margin-bottom: 14px;
    color: #475569;
}

.login-masked-phone {
    font-weight: 700;
    color: #1e293b;
}

.login-sms-input {
    text-align: center;
    font-size: 1.55em;
    letter-spacing: 4px;
}

/* Bottom section - Don't have an account? */
.login-bottom-section {
    text-align: center;
    margin-top: 2px;              /* almost touching the card */
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.login-bottom-section p {
    margin-bottom: 6px;
    color: #475569;
    font-size: 0.92rem;
}

.login-create-button {
    display: inline-block;
    padding: 11px 28px;
    font-size: 1rem;
    font-weight: 600;
    background-color: #10b981;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(16, 185, 129, 0.3);
}

/* ============================================
   REGISTER PAGE (rg- prefix)
   ============================================ */
.rg-container {
    background: #cbd4ef;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 15px;
    box-sizing: border-box;
}

.rg-wrapper {
    max-width: 460px;
    width: 100%;
}

.rg-card {
    background: white;
    border-radius: 16px;
    padding: 28px 26px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.rg-card h2 {
    text-align: center;
    margin-bottom: 22px;
    color: #1e293b;
    font-size: 1.35rem;
}

.rg-card h3 {
    margin: 22px 0 10px;
    color: #263F3B;
    font-size: 1.1rem;
}

.rg-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}

.rg-input {
    width: 100%;
    padding: 11px 14px;
    font-size: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 14px;
    box-sizing: border-box;
}

.rg-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.rg-button {
    width: 100%;
    padding: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    background: #263F3B;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
}

.rg-button:hover {
    background: #1f3230;
}

.rg-error-message {
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.rg-success {
    text-align: center;
}

.rg-success p {
    font-size: 1.05rem;
    margin: 20px 0 30px;
}

/* Counter for project focus */
#focusCounter {
    text-align: right;
    font-size: 0.9rem;
    color: #666;
    margin-top: -8px;
    margin-bottom: 10px;
}

/* =============================================================
   === CHANGE PASSWORD (cp-) - Matches other admin screens
   ============================================================= */

.cp-container {
    background: #cbd4ef;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 35px 40px 40px;
    box-sizing: border-box;
}

.cp-main-card {
    background: #ffffff;
    border: 2px solid #000;
    border-radius: 20px;
    padding: 40px 40px 32px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    width: 100%;
    max-width: 520px;           /* nice and compact */
    margin: 0 auto;
    box-sizing: border-box;
}

.cp-title {
    margin: 0 0 30px 0;
    font-size: 24px;
    font-weight: 700;
    color: #263F3B;
    text-align: center;
    font-family: Tahoma, Arial, sans-serif;
}


/* =============================================================
   === MASTER SCREEN TITLE (this wins — all headings identical)
   ============================================================= */

.as-title,
.ad-title,
.af-title,
.ap-title,
.au-title,
.login-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.45rem;
    font-weight: bold;
    color: #1e293b;
}

