/* TYN CRM - Stylesheet */

:root {
    --red:    #db1917;
    --gold:   #B78F44;
    --dark:   #272727;
    --light:  #e4e3e3;
    --cream:  #f5f0e8;
    --white:  #ffffff;
    --text:   #272727;
    --muted:  #6b7280;
    --border: #e4e3e3;
    --radius: 8px;
    --shadow: 0 1px 4px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    background: var(--cream);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header ---- */
.header {
    background: var(--dark);
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.header-logo .your {
    background: var(--gold);
    color: var(--dark);
    font-size: 11px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-logo .crm-badge {
    color: var(--red);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.8;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-nav a, .header-nav button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.header-nav a:hover, .header-nav button:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.header-nav a.active {
    background: var(--red);
    border-color: var(--red);
}

.header-user {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    margin-left: 8px;
}

/* ---- Layout ---- */
.layout {
    display: flex;
    height: calc(100vh - 52px);
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ---- Filter Bar ---- */
.filter-bar {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-btn {
    background: var(--cream);
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    transition: background 0.15s;
}

.filter-btn.active {
    background: var(--dark);
    color: white;
}

/* ---- Lead Liste ---- */
.lead-list {
    overflow-y: auto;
    flex: 1;
}

.lead-item {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
}

.lead-item:hover { background: #fafafa; }
.lead-item.active { background: var(--cream); }

.lead-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.lead-name {
    font-weight: 700;
    font-size: 14px;
}

.lead-phone {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
}

.lead-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.status-badge {
    display: inline-block;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 10px;
    font-weight: 700;
    color: white;
}

.today-badge {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #92400e;
    display: inline-block;
    margin-top: 2px;
}

.overdue-badge {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #991b1b;
    display: inline-block;
    margin-top: 2px;
}

/* ---- Kontaktkarte ---- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.contact-name {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.info-block {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 10px 14px;
}

.info-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.info-value {
    font-size: 13px;
    font-weight: 600;
}

/* ---- Anruf Historie ---- */
.anruf-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.anruf-item:last-child { border-bottom: none; }

.anruf-nummer {
    background: var(--dark);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.anruf-content { flex: 1; }

.anruf-meta {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.anruf-ergebnis {
    background: var(--cream);
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 600;
}

.anruf-notiz {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}

.anruf-count {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
}

/* ---- Gespräche ---- */
.gespraech-item {
    border-left: 3px solid var(--gold);
    padding-left: 14px;
    margin-bottom: 20px;
}

.gespraech-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.typ-badge {
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 10px;
    font-weight: 700;
    color: white;
}

.gespraech-felder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

/* ---- Fortschritt ---- */
.progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.step-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
    color: white;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    border: none;
    border-radius: var(--radius);
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
    text-decoration: none;
}

.btn:hover { opacity: 0.85; text-decoration: none; }

.btn-primary { background: var(--red); color: white; }
.btn-dark    { background: var(--dark); color: white; }
.btn-light   { background: var(--light); color: var(--dark); }
.btn-gold    { background: var(--gold); color: white; }
.btn-sm      { padding: 5px 12px; font-size: 12px; }
.btn-block   { display: block; width: 100%; text-align: center; }

/* ---- Formulare ---- */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: white;
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ---- Login ---- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .tune { font-size: 20px; font-weight: 800; color: var(--dark); }
.login-logo .your {
    background: var(--gold);
    color: var(--dark);
    font-size: 12px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 3px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 4px;
}
.login-logo .network { font-size: 20px; font-weight: 800; color: var(--dark); }

.error-msg {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    color: #991b1b;
    margin-bottom: 16px;
}

/* ---- Leere Zustände ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
}

.empty-state p { font-size: 14px; }

/* ---- Utility ---- */
.text-muted  { color: var(--muted); }
.text-small  { font-size: 12px; }
.font-bold   { font-weight: 700; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mb-8        { margin-bottom: 8px; }
.mb-16       { margin-bottom: 16px; }
.flex        { display: flex; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full      { width: 100%; }

/* ---- Aufnahme ---- */
.recording-badge {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 10px;
    font-weight: 700;
}

/* ---- Schnellaktionen ---- */
.quick-action {
    width: 100%;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    margin-bottom: 8px;
    color: var(--dark);
    transition: background 0.15s;
    display: block;
    text-decoration: none;
}

.quick-action:hover {
    background: var(--light);
    text-decoration: none;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar { width: 100%; }
    .layout  { flex-direction: column; }
    .contact-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .gespraech-felder { grid-template-columns: 1fr; }
}
