/* Ghost Ink -- Design-System für App-Shell-Seiten (Login, Dashboard)
   Prinzip: dunkle, ruhige Fläche + ein blasser "Ghost Glow"-Akzent statt
   grellem Neon. Datenzeilen statt Schatten-Karten. Sora für Marke/Zahlen,
   IBM Plex Sans für alles Funktionale. */

:root {
    --gi-bg:            #16171B;
    --gi-surface:       #1D1F24;
    --gi-surface-hover: #262931;
    --gi-border:        #2E3139;
    --gi-text:          #EDEDE9;
    --gi-text-soft:     #94969D;
    --gi-glow:          #8FEAE0;
    --gi-glow-dim:      #4B6E6A;
    --gi-red:           #E2584B;
    --gi-red-wash:      #3A2422;
    --gi-green:         #6FD19A;
    --gi-green-wash:    #21332A;
    --gi-amber:         #E0B15C;
    --gi-font-display:  'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
    --gi-font-body:     'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.ghostink-app {
    margin: 0;
    background: var(--gi-bg);
    color: var(--gi-text);
    font-family: var(--gi-font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body.ghostink-app * {
    box-sizing: border-box;
}

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

/* Topbar */

.ghostink-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.75rem;
    background: var(--gi-surface);
    border-bottom: 1px solid var(--gi-border);
}

.ghostink-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ghostink-mark {
    overflow: visible;
    flex-shrink: 0;
}

.gi-mark-body {
    fill: var(--gi-surface-hover);
    stroke: var(--gi-glow);
    stroke-width: 2;
    stroke-linejoin: round;
}

.gi-mark-eye {
    fill: var(--gi-bg);
}

.gi-mark-mouth {
    stroke: var(--gi-bg);
}

.gi-mark-machine {
    stroke: var(--gi-glow);
    color: var(--gi-glow);
}

.ghostink-wordmark {
    font-family: var(--gi-font-display);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
}

.gi-word-ghost {
    color: var(--gi-text);
}

.gi-word-ink {
    color: var(--gi-glow);
    text-shadow: 0 0 10px rgba(143, 234, 224, 0.55), 0 0 2px rgba(143, 234, 224, 0.8);
}

.ghostink-topbar-user {
    font-size: 0.82rem;
    color: var(--gi-text-soft);
}

.ghostink-topbar-user a {
    color: var(--gi-text);
    margin-left: 0.35rem;
}

/* Tabs */

.ghostink-tabs {
    display: flex;
    gap: 1.5rem;
    padding: 0 1.75rem;
    background: var(--gi-surface);
    border-bottom: 1px solid var(--gi-border);
    overflow-x: auto;
}

.ghostink-tab {
    display: inline-block;
    padding: 0.85rem 0.1rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--gi-text-soft);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.ghostink-tab:hover {
    color: var(--gi-text);
}

.ghostink-tab.is-active {
    color: var(--gi-text);
    border-bottom-color: var(--gi-glow);
}

/* Main content */

.ghostink-main {
    flex: 1;
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.ghostink-page-dashboard .ghostink-main {
    max-width: 84rem;
    padding-top: 2rem;
}

h2.ghostink-page-title {
    font-family: var(--gi-font-display);
    font-weight: 600;
    font-size: 1.4rem;
    margin: 0 0 1.25rem;
}

h2.ghostink-page-title .ghostink-badge {
    vertical-align: middle;
    margin-left: 0.6rem;
}

h3 {
    font-family: var(--gi-font-body);
    font-weight: 600;
    font-size: 0.98rem;
    margin: 2rem 0 0.85rem;
    color: var(--gi-text-soft);
}

p {
    margin: 0 0 1rem;
    max-width: 34rem;
}

.ghostink-page-dashboard p {
    max-width: none;
}

.ghostink-empty,
.ghostink-muted {
    color: var(--gi-text-soft);
}

a {
    color: var(--gi-glow);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Formulare */

label {
    display: block;
    font-size: 0.85rem;
    color: var(--gi-text-soft);
    margin-bottom: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.6em 0.75em;
    font: inherit;
    font-size: 0.92rem;
    color: var(--gi-text);
    background: var(--gi-surface);
    border: 1px solid var(--gi-border);
    border-radius: 8px;
}

input:focus-visible {
    outline: none;
    border-color: var(--gi-glow);
    box-shadow: 0 0 0 3px rgba(143, 234, 224, 0.18);
}

label > input[type="checkbox"] {
    width: auto;
    display: inline-block;
    margin: 0 0.4em 0 0;
}

button {
    display: inline-block;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0C1013;
    background: var(--gi-glow);
    border: none;
    border-radius: 8px;
    padding: 0.65em 1.4em;
    cursor: pointer;
    transition: filter 0.15s ease;
}

button:hover {
    filter: brightness(1.08);
}

button:focus-visible {
    outline: 2px solid var(--gi-glow);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    button {
        transition: none;
    }
}

select,
textarea {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.6em 0.75em;
    font: inherit;
    font-size: 0.92rem;
    color: var(--gi-text);
    background: var(--gi-surface);
    border: 1px solid var(--gi-border);
    border-radius: 8px;
}

select:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: var(--gi-glow);
    box-shadow: 0 0 0 3px rgba(143, 234, 224, 0.18);
}

/* Status-Badges (Projekt-Workflow) */

.ghostink-status-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ghostink-status-form select {
    width: auto;
    margin-top: 0;
    padding: 0.3em 0.5em;
    font-size: 0.8rem;
}

.ghostink-status {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.2em 0.6em;
    border-radius: 5px;
    white-space: nowrap;
}

.ghostink-status-anfrage,
.ghostink-status-entwurf {
    color: var(--gi-text-soft);
    background: var(--gi-surface-hover);
}

.ghostink-status-freigegeben {
    color: var(--gi-glow);
    background: rgba(143, 234, 224, 0.12);
}

.ghostink-status-in_arbeit {
    color: var(--gi-amber);
    background: rgba(224, 177, 92, 0.14);
}

.ghostink-status-abgeschlossen {
    color: var(--gi-green);
    background: var(--gi-green-wash);
}

.ghostink-status-storniert {
    color: var(--gi-red);
    background: var(--gi-red-wash);
}

.ghostink-status-offen {
    color: var(--gi-text-soft);
    background: var(--gi-surface-hover);
}

.ghostink-status-angezahlt {
    color: var(--gi-amber);
    background: rgba(224, 177, 92, 0.14);
}

.ghostink-status-bezahlt {
    color: var(--gi-green);
    background: var(--gi-green-wash);
}

.ghostink-zahlung-form {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ghostink-zahlung-form select,
.ghostink-zahlung-form input,
.ghostink-zahlung-form button {
    width: auto;
    margin-top: 0;
    padding: 0.3em 0.5em;
    font-size: 0.8rem;
}

/* Hinweise (Erfolg/Fehler) */

.ghostink-notice {
    display: block;
    font-size: 0.85rem;
    padding: 0.65em 0.9em;
    border-radius: 6px;
    border-left: 3px solid currentColor;
    margin-bottom: 1.25rem;
}

.ghostink-notice-success {
    color: var(--gi-green);
    background: var(--gi-green-wash);
}

.ghostink-notice-error {
    color: var(--gi-red);
    background: var(--gi-red-wash);
}

.ghostink-login-error {
    color: var(--gi-red);
    font-size: 0.88rem;
}

/* Kundenliste -- Datenzeile mit Avatar + Kennzahlen */

.ghostink-kunden-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 2rem;
    font-size: 0.88rem;
}

.ghostink-kunden-table thead th {
    text-align: left;
    font-weight: 500;
    font-size: 0.78rem;
    color: var(--gi-text-soft);
    padding: 0 0.75rem 0.6rem 0;
    border-bottom: 1px solid var(--gi-border);
}

.ghostink-kunden-table th.is-numeric,
.ghostink-kunden-table td.is-numeric {
    text-align: right;
}

.ghostink-kunden-table tbody tr {
    border-bottom: 1px solid var(--gi-border);
}

.ghostink-kunden-table tbody tr:hover {
    background: var(--gi-surface-hover);
}

.ghostink-kunden-table td {
    padding: 0.7rem 0.75rem 0.7rem 0;
    font-variant-numeric: tabular-nums;
}

.ghostink-kunde-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.ghostink-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ghostink-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gi-surface-hover);
    color: var(--gi-text-soft);
    font-size: 0.75rem;
    font-weight: 600;
}

.ghostink-kunde-name {
    font-weight: 500;
}

.ghostink-betrag-offen {
    color: var(--gi-red);
    font-weight: 500;
}

.ghostink-betrag-umsatz {
    color: var(--gi-green);
    font-weight: 500;
}

/* Kundenanlage-Formular */

.ghostink-kunde-form {
    max-width: 26rem;
    padding: 1.25rem 1.5rem;
    background: var(--gi-surface);
    border: 1px solid var(--gi-border);
    border-radius: 10px;
    margin-bottom: 2rem;
}

.ghostink-kunde-form h3 {
    margin-top: 0;
}

/* Tätowierer-Liste */

.ghostink-taetowierer-liste {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ghostink-taetowierer-liste li {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gi-border);
    font-size: 0.9rem;
}

.ghostink-btn-stornieren {
    background: transparent;
    color: var(--gi-red);
    border: 1px solid var(--gi-red);
    padding: 0.35em 0.8em;
    font-size: 0.8rem;
}

.ghostink-btn-stornieren:hover {
    background: var(--gi-red-wash);
    filter: none;
}

/* Kunden-Detailansicht */

.ghostink-kunde-detail-kopf {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0 1.5rem;
}

.ghostink-finanz-summary {
    display: flex;
    gap: 2.5rem;
    padding: 1rem 1.25rem;
    background: var(--gi-surface);
    border: 1px solid var(--gi-border);
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.ghostink-profilbild-form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.75rem 0 1.5rem;
}

.ghostink-profilbild-form input[type="file"] {
    font-size: 0.82rem;
    color: var(--gi-text-soft);
}

/* Bilder-Galerie (Projekt-Detail) */

.ghostink-bild-galerie {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.ghostink-bild-thumb {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--gi-border);
    display: block;
}

.ghostink-upload-form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}

.ghostink-upload-form input[type="file"] {
    font-size: 0.82rem;
    color: var(--gi-text-soft);
}

/* Notizen-/Nachrichtenverlauf */

.ghostink-verlauf {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ghostink-verlauf-eintrag {
    padding: 0.7rem 0.9rem;
    background: var(--gi-surface);
    border: 1px solid var(--gi-border);
    border-radius: 8px;
}

.ghostink-verlauf-eintrag p {
    margin: 0.3rem 0 0;
    max-width: none;
}

.ghostink-verlauf-meta {
    font-size: 0.78rem;
    color: var(--gi-text-soft);
}

.ghostink-verlauf-kunde {
    border-left: 3px solid var(--gi-glow);
}

.ghostink-verlauf-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 34rem;
    margin-bottom: 2rem;
}

.ghostink-verlauf-form textarea {
    width: 100%;
}

.ghostink-verlauf-form button {
    align-self: flex-start;
}

/* Formulare als Dialog-Overlay */

.ghostink-open-dialog-btn {
    margin-bottom: 1.5rem;
}

dialog.ghostink-dialog {
    border: 1px solid var(--gi-border);
    border-radius: 12px;
    background: var(--gi-surface);
    color: var(--gi-text);
    padding: 0;
    width: min(30rem, 92vw);
}

dialog.ghostink-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

dialog.ghostink-dialog .ghostink-dialog-inner {
    padding: 1.5rem;
}

dialog.ghostink-dialog .ghostink-dialog-close {
    background: transparent;
    color: var(--gi-text-soft);
    border: none;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    float: right;
    cursor: pointer;
}

dialog.ghostink-dialog .ghostink-dialog-close:hover {
    color: var(--gi-text);
}

dialog.ghostink-dialog h3 {
    margin-top: 0;
    border-top: none;
}

/* Zahnrad-Menü (Besitzer-Einstellungen) */

.ghostink-gear {
    position: relative;
}

.ghostink-gear > summary {
    list-style: none;
    cursor: pointer;
    font-size: 1.05rem;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    color: var(--gi-text-soft);
}

.ghostink-gear > summary::-webkit-details-marker {
    display: none;
}

.ghostink-gear[open] > summary,
.ghostink-gear > summary:hover {
    background: var(--gi-surface-hover);
    color: var(--gi-text);
}

.ghostink-gear-menu {
    position: absolute;
    right: 0;
    top: 2.3rem;
    background: var(--gi-surface);
    border: 1px solid var(--gi-border);
    border-radius: 8px;
    padding: 0.4rem;
    min-width: 13rem;
    z-index: 20;
}

.ghostink-gear-menu button {
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--gi-text);
    border: none;
    padding: 0.55rem 0.6rem;
    border-radius: 6px;
    font-weight: 400;
    font-size: 0.88rem;
}

.ghostink-gear-menu button:hover {
    background: var(--gi-surface-hover);
}

.ghostink-studio-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ghostink-studio-logo-heading {
    max-height: 56px;
    max-width: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}

.ghostink-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--gi-red);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 0.4rem;
}

.ghostink-offen-warnung {
    border-left: 2px solid var(--gi-amber);
    padding-left: 0.6rem !important;
}

.ghostink-termine-bereich {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.ghostink-termine-main {
    flex: 1;
    min-width: 0;
}

.ghostink-wochen-sidebar {
    width: 210px;
    flex-shrink: 0;
    background: var(--gi-surface);
    border: 1px solid var(--gi-border);
    border-radius: 10px;
    padding: 0.9rem;
}

.ghostink-wochen-sidebar h4 {
    margin: 0 0 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gi-text-soft);
}

.ghostink-wochen-tag {
    display: flex;
    justify-content: space-between;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--gi-text);
    text-decoration: none;
}

.ghostink-wochen-tag:hover {
    background: var(--gi-surface-hover);
}

.ghostink-wochen-tag.is-active {
    background: var(--gi-surface-hover);
    color: var(--gi-glow);
}

.ghostink-wochen-anzahl {
    color: var(--gi-text-soft);
}

.ghostink-wochen-tag.is-active .ghostink-wochen-anzahl {
    color: var(--gi-glow);
}

@media (max-width: 40rem) {
    .ghostink-termine-bereich {
        flex-direction: column;
    }
    .ghostink-wochen-sidebar {
        width: 100%;
    }
}

.ghostink-page-with-sidebar {
    display: flex;
    gap: 1.75rem;
    align-items: flex-start;
}

.ghostink-page-main {
    flex: 1;
    min-width: 0;
}

.ghostink-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--gi-surface);
    border: 1px solid var(--gi-border);
    border-radius: 10px;
    padding: 1rem;
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
}

.ghostink-sidebar-ansicht-umschalter {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.ghostink-sidebar-umschalt-btn {
    flex: 1;
    text-align: center;
    padding: 0.35rem 0;
    border-radius: 6px;
    background: var(--gi-surface-hover);
    color: var(--gi-text-soft);
    text-decoration: none;
    font-size: 0.78rem;
}

.ghostink-sidebar-umschalt-btn.is-active {
    background: var(--gi-glow);
    color: #0C1013;
    font-weight: 600;
}

.ghostink-sidebar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--gi-text-soft);
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--gi-border);
}

.ghostink-sidebar-nav a {
    color: var(--gi-text);
    text-decoration: none;
    padding: 0.2rem 0.4rem;
}

.ghostink-sidebar-tag {
    margin-bottom: 1rem;
}

.ghostink-sidebar-tag-datum {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gi-text-soft);
    margin-bottom: 0.4rem;
}

.ghostink-sidebar-termin {
    display: flex;
    gap: 0.5rem;
    padding: 0.45rem 0.4rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--gi-text);
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

.ghostink-sidebar-termin:hover {
    background: var(--gi-surface-hover);
    text-decoration: none;
}

.ghostink-sidebar-termin-zeit {
    color: var(--gi-glow);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.ghostink-sidebar-termin-titel {
    line-height: 1.3;
}

@media (max-width: 60rem) {
    .ghostink-page-with-sidebar {
        flex-direction: column;
    }
    .ghostink-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }
}

/* Übersicht-Dashboard */

.ghostink-tagesnav {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1rem;
    background: var(--gi-surface);
    border: 1px solid var(--gi-border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.ghostink-tagesnav strong {
    flex: 1;
    text-align: center;
}

.ghostink-uebersicht-liste {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

.ghostink-uebersicht-liste li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--gi-border);
    font-size: 0.9rem;
}

/* Login */

.ghostink-login-form {
    max-width: 24rem;
}

@media (max-width: 40rem) {
    .ghostink-main,
    .ghostink-page-dashboard .ghostink-main {
        padding: 1.5rem 1rem 3rem;
    }
    .ghostink-topbar {
        padding: 0.9rem 1rem;
        flex-wrap: wrap;
    }
    .ghostink-tabs {
        padding: 0 1rem;
    }
    .ghostink-kunden-table thead {
        display: none;
    }
    .ghostink-kunden-table,
    .ghostink-kunden-table tbody,
    .ghostink-kunden-table tr,
    .ghostink-kunden-table td {
        display: block;
        width: 100%;
    }
    .ghostink-kunden-table tr {
        padding: 0.75rem 0;
    }
    .ghostink-kunden-table td.is-numeric {
        text-align: left;
    }
    .ghostink-kunden-table td:not(:first-child)::before {
        content: attr(data-label) ": ";
        color: var(--gi-text-soft);
    }
}
