
/* MicMe colors - light mode */
:root {
    --background: #F2EDF7;  /* softWhite */
    --surface: #FCFAFF;     /* white (elevatedSurface) */
    --foreground: #140D21;  /* black */
    --accent: #754bbe;      /* purple */
    --purple: #754BBE;      /* purple */
    --white: #FCFAFF;       /* white */
    --red: #9E4D45;         /* red */
    --green: #00a652;       /* green */
}

/* MicMe colors - dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #140D21;  /* black */
        --surface: #211438;     /* softBlack (elevatedSurface) */
        --foreground: #F2EDF7;  /* softWhite */
        --accent: #F2EDF7;      /* softwhite */
    }
}

* {
    box-sizing: border-box;
}


body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--foreground);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 18px;    /* MicMeFont.body */
}

/* app.js removes this class to show a screen */
.hidden {
    display: none !important;
}

/* Centers the sign-in / not-authorized cards */
.center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* MicMeBox: 8pt corners + standard 15% shadow */
.card {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(20, 13, 33, 0.15);
    padding: 24px;
    max-width: 480px;
    width: 100%;
}

/* MicMeFont.header */
h1 {
    font-size: 22px;
    font-weight: bold;
    margin: 0 0 12px;
}

.divider {
    height: 1px;
    background: var(--purple);
    margin: 0 0 24px;
}

p {
    margin: 0 0 24px;
    line-height: 1.5;
}

/* Form: 24pt spacing between fields and buttons. */
form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* MicMeTextField: no box, just a 1pt accent underline (50% > 100% when focused) */
input {
    width: 100%;
    border: none;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
    background: transparent;
    color: var(--foreground);
    font: inherit;
    padding: 0 0 8px;
    outline: none;
    caret-color: var(--accent);
}

input:focus {
    border-bottom-color: var(--accent);
}

input::placeholder {
    color: var(--foreground);
    opacity: 0.4;
}

/* Error text: MicMeFont.caption in red, takes no space when empty */
.error {
    color: var(--red);
    font-size: 14px;
    margin: 0;
}

.error:empty {
    display: none;
}

/* MicMeButton(.normal): 200 x 60 purple capsule, white bold 22pt text */
button {
    display: block;
    margin: 0 auto;
    width: 200px;
    height: 60px;
    border: none;
    border-radius: 999px;
    background: var(--purple);
    color: var(--white);
    font-family: inherit;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
}

button:active {
    transform: scale(0.96);
}

button:disabled {
    opacity: 0.4;
    cursor: default;
}

/* MicMeButton (.small): 100 x 36, bold 16pt */
button.compact {
    width: 100px;
    height: 36px;
    font-size: 16px;
    margin: 0;
}

/* Admin top bar: stays pinned while scrolling */
.top-bar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface);
    box-shadow: 0 8px 16px rgba(20, 13, 33, 0.15);
    z-index: 10;
}

.top-bar-title {
    font-size: 22px;
    font-weight: bold;
}

/* Admin functions cards: stacked, centered, 16pt apart */
#admin-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

/* Admin section headers (Users, Moderation, Payments, App) */
.section-title {
    width: 100%;
    max-width: 480px;
    font-size: 30px;
    margin: 16px 0 0;
}

/* Field labels sit above their input */
label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

/* Card result line: green on success, red on failure */
.result {
    margin: 0;
    font-weight: bold;
}

.result:empty,
.output:empty {
    display: none;
}

.result.success { color: var(--green); }
.result.failure { color: var(--red); }

/* Returned data (e.g. a user document) */
.output {
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    background: var(--background);
    font-size: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 400px;
    overflow-y: auto;
}

/* Checkbox + text on one line (inputs are otherwise full-width underlines) */
.checkbox-row {
    flex-direction: row;
    align-items: center;
}

.checkbox-row input {
    width: auto;
    border: none;
    padding: 0;
    accent-color: var(--purple);
}

/* Find-user field in the top bar */
.user-search {
    flex: 1;
    max-width: 400px;
    margin: 0 16px;
}

/* Narrow screens: search drops to its own row under the title */
@media (max-width: 600px) {
    .top-bar {
        flex-wrap: wrap;
    }
    .user-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
        margin: 12px 0 0;
    }
}

/* Results dropdown: hangs under the top bar's right side */
.user-search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 16px;
    width: min(480px, calc(100% - 32px));
    max-height: 60vh;
    overflow-y: auto;
    padding: 0 16px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(20, 13, 33, 0.15);
}

.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--foreground) 10%, transparent);
}

.search-row:last-child {
    border-bottom: none;
}

.search-names {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-uid,
.search-message {
    font-size: 14px;
    opacity: 0.6;
    overflow-wrap: anywhere;
}

.search-message {
    margin: 0;
    padding: 12px 0;
}

/* Dropdowns and multi-line fields (single-line inputs are underlines) */
select,
textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
    border-radius: 8px;
    background: var(--surface);
    color: var(--foreground);
    font: inherit;
    outline: none;
}

select:focus,
textarea:focus {
    border-color: var(--accent);
}

textarea {
    resize: vertical;
}

/* Config cards: current value line */
.config-current {
    margin: 0;
    font-size: 14px;
    opacity: 0.6;
    overflow-wrap: anywhere;
}

.config-current:empty {
    display: none;
}

/* Top-bar title is a link home; keeps the plain text look */
a.top-bar-title {
    color: inherit;
    text-decoration: none;
}

/* Home view: centered card */
#view-home {
    display: flex;
    justify-content: center;
    padding: 16px;
}

/* Two tiles per row */
.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.home-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 80px;
    padding: 16px;
    border-radius: 8px;
    background: var(--purple);
    color: var(--white);
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    transition: transform 0.1s;
}

.home-tile:active {
    transform: scale(0.96);
}

/* Pages not built yet: dimmed, not clickable */
.home-tile.soon {
    opacity: 0.4;
    cursor: default;
}

/* Needs attention (e.g. open bank disputes) */
.home-tile.alert {
    background: var(--red);
    box-shadow: 0 0 12px var(--red);
}

.home-tile small {
    font-size: 14px;
    font-weight: normal;
}

/* List pages (Disputes, later Reports/Verification) */
.page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.list-message {
    opacity: 0.6
}

.list-message:empty {
    display: none;
}

/* A clickable row (overrides the big purple button defaults) */
button.list-row {
    width: 100%;
    height: auto;
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    background: var(--background);
    color: var(--foreground);
    font-size: 16px;
    font-weight: normal;
    text-align: left;
}

/* Label / value pairs in a detail card */
.detail-fields {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 16px;
    margin: 0 0 24px;
}

.detail-fields dt {
    font-size: 14px;
    opacity: 0.6;
}

.detail-fields dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* Dispute chat log (oldest first) */
.chat-log {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    margin: 0 0 24px;
}

.chat-meta {
    font-size: 14px;
    opacity: 0.6;
}

.chat-row p {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.detail-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

/* Detail buttons size to their text, so "Action Taken" fits on one line */
.detail-actions button {
    width: auto;
    padding: 0 16px;
}