/*
 * Tip-Ding — shared stylesheet.
 *
 * Branding (Lastenheft, README): wordmark "Tip-Ding" in a code typeface,
 * Icy Blue #A4D8FF on Gunmetal #35393C, no logo.
 */

:root {
    --gunmetal: #35393c;
    --gunmetal-deep: #2a2d2f;
    --gunmetal-raised: #3e4245;
    --icy: #a4d8ff;
    --icy-soft: rgba(164, 216, 255, 0.16);

    --text: #e7ebee;
    --text-muted: #9aa3a9;
    --line: #4a4f53;

    --danger: #ff9d8d;
    --ok: #a9e6b8;

    --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas,
        "Liberation Mono", monospace;

    --radius: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--gunmetal);
    color: var(--text);
    font-family: var(--mono);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.centered {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

/* ------------------------------------------------------------------ card */

.card {
    width: 100%;
    max-width: 24rem;
    background: var(--gunmetal-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.card.wide {
    max-width: 34rem;
}

/* --------------------------------------------------------------- branding */

.brand {
    margin-bottom: 1.75rem;
    text-align: center;
}

.wordmark {
    margin: 0;
    font-family: var(--mono);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--icy);
}

.tagline {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

h2 {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

/* ----------------------------------------------------------------- forms */

.field {
    margin-bottom: 1rem;
}

label,
.label-text {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--gunmetal-deep);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: var(--icy);
    box-shadow: 0 0 0 3px var(--icy-soft);
}

input:disabled {
    opacity: 0.55;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    cursor: pointer;
}

.toggle input {
    accent-color: var(--icy);
    margin: 0;
}

button {
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}

button.primary {
    width: 100%;
    padding: 0.7rem 1rem;
    font-weight: 700;
    color: var(--gunmetal-deep);
    background: var(--icy);
    border: 1px solid var(--icy);
    border-radius: var(--radius);
    transition: filter 0.12s ease;
}

button.primary:hover:not(:disabled) {
    filter: brightness(1.08);
}

button.primary:disabled {
    opacity: 0.5;
    cursor: default;
}

button.link {
    padding: 0;
    color: var(--icy);
    background: none;
    border: none;
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--icy);
    outline-offset: 2px;
}

/* -------------------------------------------------------------- messages */

.message {
    margin: 0 0 1rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    border-left: 3px solid var(--line);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--gunmetal-deep);
}

.message.error {
    border-left-color: var(--danger);
    color: var(--danger);
}

.message.ok {
    border-left-color: var(--ok);
    color: var(--ok);
}

.message.info {
    border-left-color: var(--icy);
    color: var(--text);
}

.hint {
    margin: 1.25rem 0 0;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.rules {
    margin: -0.5rem 0 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* -------------------------------------------------------------- start page */

.identity {
    margin-bottom: 1.5rem;
}

.identity .username {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--icy);
}

.roles {
    margin: 0;
    padding: 0;
    list-style: none;
}

.roles li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
}

.roles .role-list {
    color: var(--text-muted);
    text-align: right;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
}

a {
    color: var(--icy);
}

[hidden] {
    display: none !important;
}

/* ==========================================================================
   Multi-section pages (staff view and everything that follows)
   ========================================================================== */

body.page {
    padding: 1.5rem 1rem 3rem;
}

.shell {
    max-width: 44rem;
    margin: 0 auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.topbar .wordmark {
    font-size: 1.25rem;
    text-decoration: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.85rem;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.stack .card {
    max-width: none;
    padding: 1.5rem;
}

/* ------------------------------------------------------------ row lists */

.rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rows li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-top: 1px solid var(--line);
}

.rows li > div {
    display: flex;
    flex-direction: column;
}

/* Same row instead of stacked, e.g. "LisaPf (du)". */
.rows li > div.inline-row {
    flex-direction: row;
    align-items: baseline;
    gap: 0.4rem;
}

.group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    font-size: 0.85rem;
}

.group-head:first-child {
    margin-top: 0;
}

/* --------------------------------------------------------- text helpers */

.strong {
    font-weight: 700;
}

.muted {
    color: var(--text-muted);
}

.small {
    font-size: 0.78rem;
}

.block {
    display: block;
    margin-top: 0.75rem;
}

.centered-text {
    text-align: center;
}

.amount {
    font-weight: 700;
    color: var(--icy);
    white-space: nowrap;
}

.amount.negative {
    color: var(--danger);
}

.amount.big {
    font-size: 1.35rem;
}

.badge {
    padding: 0.15rem 0.5rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--gunmetal-deep);
    border: 1px solid var(--line);
    border-radius: 999px;
    white-space: nowrap;
}

/* ----------------------------------------------------- compact controls */

.row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.row input[type="date"] {
    width: auto;
}

.inline-field {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
}

.inline-field input,
.inline-field select {
    width: auto;
}

.inline-field input[type="number"] {
    width: 4.5rem;
    text-align: right;
}

.chip {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--gunmetal-deep);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.chip:hover {
    color: var(--icy);
    border-color: var(--icy);
}

/* Radio group styled as buttons: the input stays focusable for keyboards. */
.segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.segmented label {
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
}

.segmented input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.segmented span {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--gunmetal-deep);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}

.segmented input:checked + span {
    color: var(--icy);
    background: var(--icy-soft);
    border-color: var(--icy);
}

.segmented input:focus-visible + span {
    outline: 2px solid var(--icy);
    outline-offset: 2px;
}

/* --------------------------------------------------------- open payouts */

.pending {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--gunmetal-deep);
    border: 1px solid var(--icy);
    border-radius: var(--radius);
}

.pending-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pending .muted {
    display: block;
    margin: 0.35rem 0 0.9rem;
}
