/* ============================================================
   PhoneData Modul-Design
   1:1 aus den Central-Modulen uebernommen (verwaltung.html,
   phonedata.html), damit eine neue App exakt wie die bestehenden
   Module aussieht. Werte NICHT frei aendern — bei Aenderungen an
   den Modulen hier mitziehen.
   ============================================================ */

:root {
    --pd-primary: #6A5F91;
    --pd-secondary: #4A3B7A;
    --pd-accent: #8B82B9;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    background-attachment: fixed;
    color: #e6edf3;
    min-height: 100vh;
    margin: 0;
}

/* ---------- Kopfbereich ---------- */
header {
    background: linear-gradient(135deg, var(--pd-primary), var(--pd-secondary));
    padding: 1.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, .5);
    position: relative;
}

header h1 {
    font-size: 1.5rem;
    color: #fff;
    font-weight: 800;
    margin-bottom: .3rem;
}

header p {
    color: rgba(255, 255, 255, .7);
    font-size: .85rem;
}

header .back {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: rgba(255, 255, 255, .8);
    text-decoration: none;
    font-size: .85rem;
    padding: .4rem .9rem;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    transition: .2s;
}

header .back:hover { background: rgba(255, 255, 255, .18); }

/* ---------- Benutzer-Menue oben rechts ---------- */
.pd-user-menu {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
}

.pd-user-btn {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    color: #fff;
    font-size: .82rem;
    padding: .4rem .9rem;
    cursor: pointer;
    transition: .2s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.pd-user-btn:hover { background: rgba(255, 255, 255, .2); }

.pd-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: .5rem;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    z-index: 300;
    display: none;
}

.pd-dropdown.open { display: block; }

.pd-dropdown-header {
    padding: .4rem .7rem;
    font-size: .78rem;
    color: #8b949e;
    border-bottom: 1px solid #30363d;
    margin-bottom: .3rem;
}

.pd-dropdown-item {
    padding: .5rem .7rem;
    border-radius: 6px;
    font-size: .82rem;
    cursor: pointer;
    color: #e6edf3;
    transition: .15s;
    text-decoration: none;
    display: block;
}

.pd-dropdown-item:hover { background: rgba(106, 95, 145, .2); }

.pd-dropdown-item.danger { color: #f85149; }

.pd-dropdown-item.danger:hover { background: rgba(248, 81, 73, .15); }

/* ---------- Inhalt ---------- */
main {
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.pd-card {
    background: rgba(22, 27, 34, .85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(106, 95, 145, .2);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.pd-card h2 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: .8rem;
}

.pd-card h3 {
    font-size: .9rem;
    color: var(--pd-accent);
    margin: 0 0 .6rem;
}

/* ---------- Reiter (Unterstrich-Stil) ---------- */
.tab-nav {
    display: flex;
    gap: .25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #30363d;
    padding-bottom: .5rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    color: #8b949e;
    padding: .5rem .9rem;
    font-size: .85rem;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-family: inherit;
}

.tab-btn:hover { color: #e6edf3; }

.tab-btn.active {
    color: var(--pd-primary);
    background: rgba(106, 95, 145, .12);
    border-bottom: 2px solid var(--pd-primary);
}

/* ---------- Buttons ---------- */
.btn {
    padding: .5rem 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    transition: .2s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-family: inherit;
}

.btn-primary { background: var(--pd-primary); color: #fff; }
.btn-primary:hover { background: var(--pd-accent); }

.btn-danger {
    background: rgba(248, 81, 73, .15);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, .3);
}
.btn-danger:hover { background: rgba(248, 81, 73, .25); }

.btn-success {
    background: rgba(63, 185, 80, .15);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, .3);
}
.btn-success:hover { background: rgba(63, 185, 80, .25); }

.btn-outline {
    background: none;
    border: 1px solid #30363d;
    color: #8b949e;
}
.btn-outline:hover { border-color: var(--pd-primary); color: #e6edf3; }

.btn-sm { padding: .3rem .7rem; font-size: .78rem; }

.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Formularfelder ---------- */
.pd-card label {
    display: block;
    font-size: .75rem;
    color: #8b949e;
    margin-bottom: .25rem;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.pd-card input[type="text"],
.pd-card input[type="date"],
.pd-card input[type="file"],
.pd-card select {
    width: 100%;
    padding: .5rem .7rem;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #e6edf3;
    font-size: .85rem;
    font-family: inherit;
}

.pd-card input:focus,
.pd-card select:focus {
    outline: none;
    border-color: var(--pd-primary);
}

.pd-field { margin-bottom: .8rem; }

/* ---------- Tabellen ---------- */
table { width: 100%; border-collapse: collapse; font-size: .85rem; }

th {
    text-align: left;
    padding: .6rem .5rem;
    color: #8b949e;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

td { padding: .6rem .5rem; border-bottom: 1px solid rgba(255, 255, 255, .04); }

/* ---------- Statusmarken ---------- */
.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-pending { background: rgba(240, 136, 62, .18); color: #f0883e; }
.badge-active { background: rgba(63, 185, 80, .18); color: #3fb950; }
.badge-inactive { background: rgba(248, 81, 73, .18); color: #f85149; }
.badge-sent { background: rgba(88, 166, 255, .18); color: #58a6ff; }

/* ---------- Sonstiges ---------- */
.empty { color: #8b949e; text-align: center; padding: 2rem; font-style: italic; }

.login-prompt {
    background: rgba(22, 27, 34, .85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(106, 95, 145, .2);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    max-width: 520px;
    margin: 3rem auto;
}

.login-prompt h2 { color: #fff; margin-bottom: .8rem; }

.ico { width: 1rem; height: 1rem; flex: none; }
.tab-btn .ico { width: 1.05rem; height: 1.05rem; }
.btn-sm .ico { width: .85rem; height: .85rem; }
