:root {
    /* --sr-yellow keeps its Phase 1 name for compatibility with every file
       that already references it, but the value is now the real Roadrunner
       brand gold (from the Phase 7 reference logo/proposal docs), not a
       generic construction yellow. */
    --sr-black: #000000;
    --sr-white: #FFFFFF;
    --sr-yellow: #C9A227;
    --sr-yellow-bright: #E0B830;
    --sr-bg: #121212;
    --sr-surface: #1E1E1E;
    --sr-surface-raised: #262626;
    --sr-border: #333333;
    --sr-text: #F2F2F2;
    --sr-text-muted: #A0A0A0;
    --sr-danger: #E53935;
    --sr-success: #43A047;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--sr-bg);
    color: var(--sr-text);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

a {
    color: var(--sr-yellow);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- Auth pages (login / signup) ---------- */

.sr-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sr-bg);
}

.sr-auth-card {
    background: var(--sr-surface);
    border: 1px solid var(--sr-border);
    border-radius: 8px;
    padding: 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.sr-auth-logo {
    display: block;
    height: 56px;
    width: auto;
    margin: 0 auto 12px;
}

.sr-auth-card h1 {
    margin: 0 0 4px;
    font-size: 22px;
    color: var(--sr-yellow);
    text-align: center;
}

.sr-auth-card .sr-subtitle {
    margin: 0 0 24px;
    color: var(--sr-text-muted);
    font-size: 13px;
    text-align: center;
}

.sr-field {
    margin-bottom: 16px;
}

.sr-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--sr-text-muted);
}

.sr-field input[type="text"],
.sr-field input[type="email"],
.sr-field input[type="password"],
.sr-field input[type="date"],
.sr-field input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    background: var(--sr-bg);
    border: 1px solid var(--sr-border);
    border-radius: 4px;
    color: var(--sr-text);
    font-size: 14px;
}

.sr-field textarea,
.sr-field select {
    width: 100%;
    padding: 10px 12px;
    background: var(--sr-bg);
    border: 1px solid var(--sr-border);
    border-radius: 4px;
    color: var(--sr-text);
    font-size: 14px;
    font-family: inherit;
}

.sr-field textarea {
    min-height: 90px;
}

.sr-field input:focus,
.sr-field textarea:focus,
.sr-field select:focus {
    outline: none;
    border-color: var(--sr-yellow);
}

.sr-field input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.sr-checkbox-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--sr-text-muted);
}

.sr-btn {
    display: inline-block;
    background: var(--sr-yellow);
    color: var(--sr-black);
    border: none;
    border-radius: 4px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.sr-btn:hover {
    background: var(--sr-yellow-bright);
    box-shadow: 0 2px 10px rgba(201, 162, 39, 0.25);
}

.sr-btn:active {
    transform: translateY(1px);
}

.sr-btn-secondary {
    background: transparent;
    color: var(--sr-text);
    border: 1px solid var(--sr-border);
}

.sr-btn-secondary:hover {
    background: var(--sr-surface-raised);
    border-color: var(--sr-yellow);
    box-shadow: none;
}

.sr-alert {
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 16px;
}

.sr-alert-error {
    background: rgba(229, 57, 53, 0.15);
    border: 1px solid var(--sr-danger);
    color: #ff8a80;
}

.sr-alert-success {
    background: rgba(67, 160, 71, 0.15);
    border: 1px solid var(--sr-success);
    color: #a5d6a7;
}

/* Generated content, not part of .textContent - confirm-toast.js's
   banner.textContent.trim() read (used for both the reassurance toast and
   the sound-effect hook) stays exactly the message text either way. */
.sr-alert-error::before {
    content: "\26A0\FE0F  ";
}

.sr-alert-success::before {
    content: "\2705 ";
}

.sr-auth-links {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--sr-text-muted);
}

/* ---------- App shell (topbar + sidebar) ---------- */

.sr-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sr-topbar {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) minmax(180px, 280px) 340px;
    column-gap: 12px;
    align-items: center;
    background: var(--sr-surface);
    border-bottom: 2px solid var(--sr-yellow);
    padding: 8px 16px;
    min-height: 56px;
    flex-shrink: 0;
}

.sr-topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sr-topbar-logo-chip {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 3px 8px;
    background: var(--sr-black);
    border-radius: 4px;
}

.sr-topbar-logo-chip img {
    height: 100%;
    width: auto;
    display: block;
}

.sr-topbar-company {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.sr-clock {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--sr-text);
    flex-shrink: 0;
    text-align: right;
    line-height: 1.4;
}

#sr-edit-mode-toggle {
    flex-shrink: 0;
}

/* Name on top; "Max Status · Role" smaller underneath (stacked so a long status never squeezes the name). */
.sr-user-chip {
    font-size: 13px;
    color: var(--sr-text-muted);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    line-height: 1.25;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
}

.sr-user-chip strong {
    color: var(--sr-text);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    flex-shrink: 1;
}

.sr-user-chip-role {
    font-size: 11px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 30px;
}

.sr-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sr-sidebar {
    width: 220px;
    background: var(--sr-surface);
    border-right: 1px solid var(--sr-border);
    flex-shrink: 0;
    padding: 16px 0;
    overflow-y: auto;
}

.sr-sidebar nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 20px;
    color: var(--sr-text);
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, border-left-color 0.15s ease, color 0.15s ease;
}

.sr-nav-badge {
    background: var(--sr-yellow);
    color: var(--sr-black);
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 7px;
    flex-shrink: 0;
}

.sr-sidebar nav a:hover {
    background: var(--sr-surface-raised);
    text-decoration: none;
}

.sr-sidebar nav a.active {
    border-left-color: var(--sr-yellow);
    color: var(--sr-yellow);
    background: var(--sr-surface-raised);
}

.sr-sidebar-divider {
    margin: 12px 20px;
    border-top: 1px solid var(--sr-border);
}

.sr-main {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.sr-main h1 {
    margin-top: 0;
    color: var(--sr-yellow);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sr-help-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--sr-border);
    background: var(--sr-surface);
    color: var(--sr-text-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.sr-help-btn:hover {
    border-color: var(--sr-yellow);
    color: var(--sr-yellow);
}

.sr-card {
    background: var(--sr-surface);
    border: 1px solid var(--sr-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.sr-table-scroll {
    overflow-x: auto;
}

.sr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sr-table th, .sr-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--sr-border);
}

.sr-table th {
    color: var(--sr-text-muted);
    font-weight: 600;
}

.sr-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.sr-badge-admin {
    background: var(--sr-yellow);
    color: var(--sr-black);
}

.sr-badge-user {
    background: var(--sr-surface-raised);
    color: var(--sr-text-muted);
}

.sr-badge-pending {
    background: rgba(224, 184, 48, 0.18);
    color: var(--sr-yellow-bright);
}

.sr-badge-rejected {
    background: rgba(229, 57, 53, 0.15);
    color: #ff8a80;
}

.sr-badge-manager {
    background: rgba(66, 133, 244, 0.18);
    color: #8ab4f8;
}

.sr-badge-new {
    background: var(--sr-yellow);
    color: var(--sr-black);
}

.sr-badge-success {
    background: rgba(67, 160, 71, 0.18);
    color: var(--sr-success);
}

.sr-badge-danger {
    background: rgba(229, 57, 53, 0.15);
    color: #ff8a80;
}

/* ---------- Admin Edit Mode (inline-editable branding/labels) ---------- */

#sr-edit-mode-toggle {
    font-size: 11px;
    padding: 4px 10px;
}

.sr-edit-mode-active .sr-editable {
    outline: 1px dashed var(--sr-yellow);
    outline-offset: 2px;
    border-radius: 2px;
    cursor: text;
    padding: 0 2px;
}

.sr-edit-mode-active .sr-editable:hover {
    background: rgba(255, 193, 7, 0.15);
}

.sr-editable-input {
    background: var(--sr-bg);
    border: 1px solid var(--sr-yellow);
    color: var(--sr-text);
    font: inherit;
    padding: 0 4px;
    border-radius: 2px;
}

.sr-inline-form {
    display: inline;
}

.sr-btn-small {
    padding: 4px 10px;
    font-size: 12px;
    width: auto;
}

/* ---------- Contacts: search/filter + company grouping (#26) ---------- */

.sr-contacts-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.sr-contacts-filters input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    background: var(--sr-bg);
    border: 1px solid var(--sr-border);
    border-radius: 4px;
    color: var(--sr-text);
    font-size: 13px;
}

.sr-contacts-filters select {
    padding: 8px 10px;
    background: var(--sr-bg);
    border: 1px solid var(--sr-border);
    border-radius: 4px;
    color: var(--sr-text);
    font-size: 13px;
}

.sr-contacts-group-row td {
    background: var(--sr-surface-raised);
    color: var(--sr-yellow);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 10px;
}

.sr-contacts-no-results {
    color: var(--sr-text-muted);
    font-size: 13px;
    padding: 12px 0;
}

/* ---------- Confirmation toast (center-screen "it worked" reassurance) ---------- */

.sr-confirm-toast-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.sr-confirm-toast-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sr-confirm-toast {
    background: var(--sr-surface);
    border: 1px solid var(--sr-success);
    border-radius: 10px;
    padding: 28px 36px;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.sr-confirm-toast-overlay.active .sr-confirm-toast {
    transform: scale(1);
}

.sr-confirm-toast-icon {
    font-size: 40px;
    line-height: 1;
    color: var(--sr-success);
    margin-bottom: 10px;
}

.sr-confirm-toast-message {
    font-size: 15px;
    color: var(--sr-text);
    line-height: 1.5;
}

/* ---------- Language picker (login / signup), read-only values, hidden labels ---------- */

.sr-lang-picker {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin: -12px -12px 8px 0;
    font-size: 12px;
    color: var(--sr-text-muted);
}

.sr-lang-picker label {
    margin: 0;
    font-size: 12px;
    color: var(--sr-text-muted);
}

.sr-lang-picker select {
    width: auto;
    padding: 4px 8px;
    font-size: 13px;
    background: var(--sr-surface-raised);
    color: var(--sr-text);
    border: 1px solid var(--sr-border);
    border-radius: 6px;
}

.sr-readonly-value {
    padding: 9px 12px;
    background: var(--sr-surface-raised);
    border: 1px solid var(--sr-border);
    border-radius: 6px;
    color: var(--sr-text);
    font-size: 14px;
    min-height: 38px;
}

.sr-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;
}

.sr-approve-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.sr-approve-form select {
    padding: 5px 8px;
    font-size: 13px;
}

/* Text boxes and dropdowns inside tables (Roles, Admin Panel): same dark look as every other field. */
.sr-table input[type="text"],
.sr-table select,
.sr-inline-form select {
    background: var(--sr-bg);
    color: var(--sr-text);
    border: 1px solid var(--sr-border);
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 13px;
}

.sr-table input[type="text"]:focus,
.sr-table select:focus,
.sr-inline-form select:focus {
    outline: none;
    border-color: var(--sr-yellow);
}

/* ---------- Edit Mode: Software Text / Software Data ---------- */
.sr-editmode-choices {
    display: grid;
    gap: 12px;
    margin: 10px 0 6px;
}

.sr-editmode-choice {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    background: var(--sr-bg);
    border: 1px solid var(--sr-border);
    border-radius: 10px;
    color: var(--sr-text);
    cursor: pointer;
    font: inherit;
    padding: 14px 16px;
}

.sr-editmode-choice strong {
    color: var(--sr-yellow);
    font-size: 16px;
}

.sr-editmode-choice span {
    color: var(--sr-text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.sr-editmode-choice:hover {
    border-color: var(--sr-yellow);
}

.sr-editmode-choice-data strong {
    color: #ff8a80;
}

.sr-editmode-choice-data:hover {
    border-color: var(--sr-danger);
}

.sr-edit-banner {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(460px, calc(100vw - 24px));
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.sr-edit-banner[hidden] {
    display: none;
}

.sr-edit-banner-text {
    background: #3a3010;
    border: 1px solid var(--sr-yellow);
    color: var(--sr-yellow-bright);
}

.sr-edit-banner-data {
    background: #3a1210;
    border: 1px solid var(--sr-danger);
    color: #ffb4ab;
}

.sr-edit-banner .sr-btn {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .sr-edit-banner {
        bottom: 84px;
    }
}

.sr-edit-text .sr-text-editable {
    outline: 1px dashed rgba(201, 162, 39, 0.65);
    outline-offset: 2px;
    border-radius: 2px;
    cursor: text;
}

.sr-edit-text .sr-text-editable:hover {
    background: rgba(255, 193, 7, 0.15);
}

.sr-text-swapped {
    background: rgba(201, 162, 39, 0.1);
}

.sr-text-editor {
    position: absolute;
    z-index: 2000;
    width: 340px;
    max-width: calc(100vw - 16px);
    background: var(--sr-surface);
    border: 1px solid var(--sr-yellow);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.6);
    color: var(--sr-text);
    font-size: 13px;
}

.sr-text-editor h4 {
    margin: 0 0 8px;
    color: var(--sr-yellow);
    font-size: 14px;
}

.sr-text-editor textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--sr-bg);
    border: 1px solid var(--sr-border);
    border-radius: 6px;
    color: var(--sr-text);
    font: inherit;
    font-size: 14px;
    padding: 8px 10px;
    resize: vertical;
}

.sr-text-editor-scope {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
    font-weight: normal;
}

.sr-text-editor-hint,
.sr-text-editor-count {
    margin: 6px 0 0;
    color: var(--sr-text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.sr-text-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.sr-text-editor-actions .sr-btn {
    width: auto;
}
