:root {
    --tf-primary: #2f6f5e;
    --tf-primary-dark: #234f43;
    --tf-bg: #f7f5f1;
    --tf-white: #ffffff;
    --tf-text: #2a2a2a;
    --tf-muted: #6b6b6b;
    --tf-border: #e2e0da;
    --tf-error: #c0392b;
    --tf-radius: 10px;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--tf-bg);
    color: var(--tf-text);
    margin: 0;
    padding: 0;
}

.tf-container {
    max-width: 480px;
    margin: 60px auto;
    background: var(--tf-white);
    padding: 40px;
    border-radius: var(--tf-radius);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.tf-container.tf-wide {
    max-width: 700px;
}

.tf-logo {
    font-weight: 700;
    font-size: 22px;
    color: var(--tf-primary-dark);
    margin-bottom: 8px;
}

.tf-subtitle {
    color: var(--tf-muted);
    margin-bottom: 30px;
    font-size: 14px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 18px;
}

input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tf-border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
}

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

.tf-checkbox-group label {
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.tf-checkbox-group input { width: auto; }

button, .tf-btn {
    background: var(--tf-primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
    width: 100%;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

button:hover, .tf-btn:hover { background: var(--tf-primary-dark); }

.tf-error {
    background: #fdecea;
    color: var(--tf-error);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 16px;
}

.tf-step-indicator {
    font-size: 13px;
    color: var(--tf-muted);
    margin-bottom: 20px;
}

/* --- Chat --- */
.tf-chat-wrapper {
    max-width: 700px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.tf-chat-header {
    background: var(--tf-white);
    padding: 16px 24px;
    border-bottom: 1px solid var(--tf-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tf-msg {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.tf-msg-customer {
    background: var(--tf-primary);
    color: white;
    align-self: flex-end;
}

.tf-msg-admin {
    background: white;
    border: 1px solid var(--tf-border);
    align-self: flex-start;
}

.tf-msg-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
}

.tf-chat-input {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    background: var(--tf-white);
    border-top: 1px solid var(--tf-border);
}

.tf-chat-input textarea {
    flex: 1;
    min-height: 20px;
    max-height: 100px;
}

.tf-chat-input button {
    width: auto;
    margin-top: 0;
}

/* --- Admin --- */
.tf-admin-layout {
    display: flex;
    height: 100vh;
}

.tf-admin-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--tf-border);
    overflow-y: auto;
}

.tf-customer-item {
    padding: 14px 18px;
    border-bottom: 1px solid var(--tf-border);
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.tf-customer-item:hover { background: var(--tf-bg); }
.tf-customer-item.active { background: #eaf2ef; border-left: 3px solid var(--tf-primary); }

.tf-customer-item .name { font-weight: 600; font-size: 14px; }
.tf-customer-item .meta { font-size: 12px; color: var(--tf-muted); margin-top: 2px; }

.tf-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #eaf2ef;
    color: var(--tf-primary-dark);
    margin-top: 4px;
}

.tf-badge.unread { background: var(--tf-error); color: white; }

.tf-admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tf-onboarding-panel {
    background: white;
    border-bottom: 1px solid var(--tf-border);
    padding: 16px 24px;
    font-size: 13px;
}

.tf-onboarding-panel dt { font-weight: 600; color: var(--tf-muted); margin-top: 8px; }
.tf-onboarding-panel dd { margin: 2px 0 0 0; }
