/* ================================
   Basis
================================ */

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

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #e5e7eb;
    background: #020617;
}

/* Standard-Body Hintergrund */
body {
    background: radial-gradient(circle at top, #4c1d95 0, #020617 45%, #000 100%);
    min-height: 100vh;
}

/* Links */
a {
    color: #a855f7;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ================================
   Buttons
================================ */

.btn-primary {
    border: none;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #f9fafb;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 12px 30px rgba(88, 28, 135, 0.7);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-outline {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    padding: 7px 12px;
    font-size: 13px;
    color: #e5e7eb;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-outline:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: #a855f7;
}

.btn-ghost {
    border-radius: 999px;
    border: none;
    padding: 7px 12px;
    font-size: 13px;
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.7);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-ghost:hover {
    background: rgba(55, 65, 81, 0.9);
}

/* Kleine Buttons */
.btn-small {
    padding: 4px 9px;
    font-size: 12px;
    border-radius: 999px;
}

/* ================================
   Formulare
================================ */

.form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

label {
    font-size: 13px;
    color: #d1d5db;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
    padding: 8px 10px;
    color: #e5e7eb;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder,
textarea::placeholder {
    color: #6b7280;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.4);
    background: rgba(15, 23, 42, 0.98);
}

textarea {
    min-height: 140px;
    resize: vertical;
}

/* Multi-Choice Container (z.B. Elemente) */
.choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.choice-pill {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.9);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.choice-pill input[type="checkbox"] {
    accent-color: #a855f7;
}

.choice-pill:hover {
    border-color: #a855f7;
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.4);
}

/* ================================
   Alerts
================================ */

.alert {
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
}

.alert-error {
    background: rgba(127, 29, 29, 0.9);
    color: #fecaca;
    border: 1px solid rgba(254, 202, 202, 0.6);
}

.alert-success {
    background: rgba(22, 101, 52, 0.8);
    color: #bbf7d0;
    border: 1px solid rgba(74, 222, 128, 0.6);
}

/* ================================
   Login-Seite
================================ */

.login-body {
    margin: 0;
    min-height: 100vh;
    font-family: inherit;
    background: radial-gradient(circle at top, #6d28d9 0, #111827 45%, #020617 100%);
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.login-bg-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.18), transparent 55%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.14), transparent 55%);
    z-index: 0;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 16px;
    box-sizing: border-box;
}

.login-card {
    background: rgba(15, 23, 42, 0.92);
    border-radius: 18px;
    padding: 24px 24px 20px;
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.85),
        0 0 0 1px rgba(148, 163, 184, 0.25);
    backdrop-filter: blur(16px);
}

.login-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.login-logo-circle {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0, #f9a8ff 0, #7c3aed 40%, #4c1d95 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #f9fafb;
    font-size: 18px;
    flex-shrink: 0;
}

.login-title {
    margin: 0;
    font-size: 20px;
    color: #e5e7eb;
}

.login-subtitle {
    margin: 2px 0 0;
    font-size: 13px;
    color: #9ca3af;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.login-form label {
    font-size: 13px;
    color: #d1d5db;
}

.login-form input {
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
    padding: 9px 11px;
    color: #e5e7eb;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-form input::placeholder {
    color: #6b7280;
}

.login-form input:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.4);
    background: rgba(15, 23, 42, 0.98);
}

.login-button {
    margin-top: 6px;
    width: 100%;
}

.login-footer-note {
    margin-top: 14px;
    font-size: 11px;
    color: #6b7280;
    text-align: center;
}

/* ================================
   Dashboard / Yugen Layout
================================ */

.yugen-body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #4c1d95 0, #020617 45%, #000 100%);
    color: #e5e7eb;
}

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

/* Topbar bleibt oben full-width */
.yugen-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.yugen-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.yugen-logo-circle {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0, #f9a8ff 0, #7c3aed 40%, #4c1d95 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #f9fafb;
    font-size: 15px;
    flex-shrink: 0;
}

.yugen-topbar-title-wrap {
    display: flex;
    flex-direction: column;
}

.yugen-topbar-title {
    font-size: 15px;
    font-weight: 600;
}

.yugen-topbar-subtitle {
    font-size: 11px;
    color: #9ca3af;
}

.yugen-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.yugen-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.45);
}

.yugen-user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.yugen-user-name {
    font-size: 13px;
}

/* Main Content – unter der Topbar, mittig */

.yugen-main {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    justify-content: center;   /* Inhalt mittig */
}

.yugen-section {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.9);
    padding: 18px 18px 20px;
}

.yugen-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
}

.yugen-section-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.yugen-section-description {
    margin: 4px 0 0;
    font-size: 13px;
    color: #9ca3af;
}

/* ================================
   Grid / Dorf-Karten
================================ */

.yugen-grid {
    display: grid;
    gap: 16px;
}

.villages-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    justify-content: center;      /* Karten mittig */
}

.village-card {
    position: relative;
    background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.2), rgba(15, 23, 42, 0.95));
    border-radius: 16px;
    padding: 14px 14px 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
    text-decoration: none;
    color: inherit;
}

.village-card:hover {
    transform: translateY(-2px);
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: 0 18px 40px rgba(88, 28, 135, 0.9);
    text-decoration: none;
}

.village-card-header {
    display: flex;
    justify-content: flex-end;
}

.village-card-body {
    margin-top: 8px;
}

.village-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.village-description {
    margin: 4px 0 0;
    font-size: 13px;
    color: #9ca3af;
}

.village-card-footer {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #a5b4fc;
}

.village-link-text {
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 11px;
}

.village-link-arrow {
    font-size: 15px;
}

/* Badges */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid transparent;
}

.badge-konoha {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.45);
    color: #bbf7d0;
}

.badge-suna {
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.45);
    color: #facc15;
}

.badge-neutral {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.45);
    color: #e5e7eb;
}

/* ================================
   Tabellen / Listen (für Akten etc.)
================================ */

.table-wrapper {
    margin-top: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.4);
    overflow: hidden;
}

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

thead {
    background: rgba(15, 23, 42, 0.95);
}

thead th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 500;
    color: #9ca3af;
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
}

tbody tr {
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(30, 64, 175, 0.25);
}

td {
    padding: 7px 10px;
}

/* Status-Tags (z.B. Polizei Akten) */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}

.status-open {
    background: rgba(22, 163, 74, 0.15);
    color: #bbf7d0;
    border: 1px solid rgba(22, 163, 74, 0.7);
}

.status-in-progress {
    background: rgba(234, 179, 8, 0.15);
    color: #fef3c7;
    border: 1px solid rgba(234, 179, 8, 0.7);
}

.status-closed {
    background: rgba(185, 28, 28, 0.15);
    color: #fecaca;
    border: 1px solid rgba(185, 28, 28, 0.7);
}

/* ================================
   Empty State
================================ */

.yugen-empty-state {
    border-radius: 16px;
    padding: 18px 16px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px dashed rgba(148, 163, 184, 0.6);
    text-align: center;
}

.yugen-empty-state h2 {
    margin: 0 0 6px;
    font-size: 16px;
}

.yugen-empty-state p {
    margin: 0;
    font-size: 13px;
    color: #9ca3af;
}

/* ================================
   Responsive
================================ */

@media (max-width: 640px) {
    .yugen-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .yugen-topbar-right {
        align-self: stretch;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .yugen-main {
        padding: 16px 10px;
    }

    .login-card {
        padding: 20px 18px 18px;
    }
}
