/* TrinkTiger Support - Clean professional UI */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f6fa;
    color: #2d3436;
    line-height: 1.5;
}

/* Navbar */
.navbar {
    background: #2d3436;
    color: #fff;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-brand { font-size: 1.1rem; font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-agent { color: #b2bec3; font-size: 0.9rem; }
.nav-link { color: #dfe6e9; text-decoration: none; font-size: 0.9rem; }
.nav-link:hover { color: #fff; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

/* Login */
.login-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 70vh;
}
.login-card {
    background: #fff; border-radius: 8px; padding: 2.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); width: 100%; max-width: 380px;
    text-align: center;
}
.login-card h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.login-subtitle { color: #636e72; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; text-align: left; }
.form-group label { display: block; font-size: 0.85rem; color: #636e72; margin-bottom: 0.25rem; }
.form-group input {
    width: 100%; padding: 0.6rem 0.75rem; border: 1px solid #dfe6e9;
    border-radius: 6px; font-size: 0.95rem;
}
.form-group input:focus { outline: none; border-color: #0984e3; box-shadow: 0 0 0 2px rgba(9,132,227,0.15); }

/* Alerts */
.alert { padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #ffeaa7; color: #d63031; border: 1px solid #fdcb6e; }

.toast {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 0.85rem 1rem; border-radius: 8px; margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.toast-success { background: #00b894; color: #fff; }
.toast-error { background: #d63031; color: #fff; }
.toast-close {
    background: transparent; border: none; color: inherit; cursor: pointer;
    font-size: 1.1rem; line-height: 1;
}

.readonly-banner {
    background: #ffeaa7;
    color: #6c5b00;
    text-align: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #fdcb6e;
}

/* Buttons */
.btn {
    display: inline-block; padding: 0.5rem 1rem; border: none; border-radius: 6px;
    font-size: 0.9rem; cursor: pointer; text-decoration: none; font-weight: 500;
    transition: background 0.15s;
}
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
.btn-primary { background: #0984e3; color: #fff; }
.btn-primary:hover { background: #0770c2; }
.btn-secondary { background: #dfe6e9; color: #2d3436; }
.btn-secondary:hover { background: #b2bec3; }
.btn-danger { background: #d63031; color: #fff; }
.btn-danger:hover { background: #b71c1c; }
.btn-warning { background: #e17055; color: #fff; }
.btn-warning:hover { background: #c0392b; }
.btn-ghost { background: transparent; color: #636e72; border: 1px solid #dfe6e9; }
.btn-ghost:hover { background: #f5f6fa; }
.btn-full { width: 100%; }
.btn-back { font-size: 0.85rem; }

/* Stats bar */
.stats-bar {
    display: flex; gap: 1.5rem; margin-bottom: 1.5rem;
    background: #fff; padding: 1rem 1.5rem; border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat { text-align: center; }
.stat-num { display: block; font-size: 1.5rem; font-weight: 700; color: #2d3436; }
.stat-label { font-size: 0.8rem; color: #636e72; }

/* Filters */
.filters { margin-bottom: 1rem; }
.filter-form { display: flex; gap: 0.75rem; }
.filter-form select {
    padding: 0.4rem 0.75rem; border: 1px solid #dfe6e9; border-radius: 6px;
    font-size: 0.85rem; background: #fff;
}

/* Queue table */
.queue-table {
    width: 100%; border-collapse: collapse; background: #fff;
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.queue-table th {
    text-align: left; padding: 0.75rem 1rem; background: #f5f6fa;
    font-size: 0.8rem; color: #636e72; text-transform: uppercase; letter-spacing: 0.03em;
}
.queue-table td { padding: 0.75rem 1rem; border-top: 1px solid #f0f0f0; }
.queue-row { cursor: pointer; transition: background 0.1s; }
.queue-row:hover { background: #f8f9ff; }
.sender-name { font-weight: 500; }
.sender-email { font-size: 0.8rem; color: #636e72; }
.td-date { font-size: 0.85rem; color: #636e72; white-space: nowrap; }
.empty-state { text-align: center; color: #b2bec3; padding: 2rem; }

/* Badges */
.badge {
    display: inline-block; padding: 0.15rem 0.6rem; border-radius: 12px;
    font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.badge-new { background: #74b9ff; color: #fff; }
.badge-in-review { background: #ffeaa7; color: #6c5b00; }
.badge-done { background: #55efc4; color: #00695c; }
.badge-skipped { background: #dfe6e9; color: #636e72; }
.badge-open { background: #74b9ff; color: #fff; }
.badge-cancelled { background: #fab1a0; color: #c0392b; }
.badge-closed { background: #dfe6e9; color: #2d3436; }

/* Category badges */
.badge-cat-stornierung { background: #ff7675; color: #fff; }
.badge-cat-retoure { background: #a29bfe; color: #fff; }
.badge-cat-lieferstatus { background: #74b9ff; color: #fff; }
.badge-cat-reklamation { background: #fd79a8; color: #fff; }
.badge-cat-adressaenderung, .badge-cat-adressänderung { background: #fdcb6e; color: #6c5b00; }
.badge-cat-nachlieferung { background: #55efc4; color: #00695c; }
.badge-cat-allgemeine-anfrage { background: #b2bec3; color: #2d3436; }

/* Review layout */
.review-header {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 1.5rem; flex-wrap: wrap;
}
.confidence { font-size: 0.85rem; color: #636e72; }

.review-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.panel {
    background: #fff; border-radius: 8px; padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.panel h2 { font-size: 1rem; color: #636e72; margin-bottom: 0.75rem; }

.email-meta { font-size: 0.85rem; margin-bottom: 1rem; }
.email-meta div { margin-bottom: 0.25rem; }
.email-body { white-space: pre-wrap; font-size: 0.9rem; line-height: 1.6; }

/* Order card */
.order-card { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #f0f0f0; }
.order-card:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.order-detail { font-size: 0.85rem; color: #636e72; }
.items-table { width: 100%; font-size: 0.85rem; margin: 0.5rem 0; border-collapse: collapse; }
.items-table th { text-align: left; padding: 0.3rem 0.5rem; color: #636e72; font-weight: 500; border-bottom: 1px solid #f0f0f0; }
.items-table td { padding: 0.3rem 0.5rem; }
.address { font-size: 0.85rem; color: #636e72; margin-top: 0.5rem; }

/* Drafts */
.panel-drafts { margin-bottom: 1.5rem; }
.draft-textarea {
    width: 100%; padding: 0.75rem; border: 1px solid #dfe6e9; border-radius: 6px;
    font-family: inherit; font-size: 0.9rem; resize: vertical; line-height: 1.6;
}
.draft-textarea:focus { outline: none; border-color: #0984e3; }
.draft-picker {
    display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem;
}
.draft-toggle {
    border: 1px solid #dfe6e9; background: #fff; color: #636e72;
    border-radius: 999px; padding: 0.35rem 0.75rem; cursor: pointer;
    font-size: 0.85rem; transition: all 0.15s ease;
}
.draft-toggle:hover { border-color: #0984e3; color: #0984e3; }
.draft-toggle.is-active { background: #0984e3; border-color: #0984e3; color: #fff; }
.draft-actions { display: flex; gap: 0.75rem; margin-top: 0.75rem; }
.draft-hint { color: #636e72; font-size: 0.85rem; align-self: center; }

/* KB */
.panel-kb { margin-bottom: 1.5rem; }
.panel-kb summary { cursor: pointer; }
.kb-content { white-space: pre-wrap; font-size: 0.85rem; color: #636e72; margin-top: 0.75rem; }

/* Action bar */
.action-bar {
    display: flex; gap: 0.75rem; flex-wrap: wrap;
    padding: 1rem 0; border-top: 1px solid #dfe6e9;
}
.action-form { display: inline; }

/* Modal */
body.modal-open { overflow: hidden; }
.modal[hidden] { display: none !important; }
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 52, 54, 0.45);
    padding: 1rem;
    z-index: 50;
}
.modal-card {
    width: min(100%, 420px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(45, 52, 54, 0.2);
    padding: 1.25rem;
}
.modal-card h2 {
    font-size: 1.1rem;
    color: #2d3436;
    margin-bottom: 0.75rem;
}
.modal-card p {
    color: #636e72;
    margin-bottom: 1rem;
}
.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .review-grid { grid-template-columns: 1fr; }
    .stats-bar { flex-wrap: wrap; }
    .action-bar { flex-direction: column; }
    .action-bar .btn { width: 100%; text-align: center; }
    .modal-actions {
        flex-direction: column;
    }
    .modal-actions .btn {
        width: 100%;
    }
}
