/* ============================================================
   Travel CRM - WhatsApp Style Theme
   ============================================================ */

:root {
    --primary: #075E54;
    --primary-light: #128C7E;
    --accent: #25D366;
    --bg-light: #F0F2F5;
    --bubble-out: #DCF8C6;
    --bubble-in: #FFFFFF;
    --text-dark: #1F2C33;
    --text-muted: #667781;
    --border-color: #E0E0E0;
    --danger: #E53935;
    --warning: #FB8C00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
}

body {
    background: var(--bg-light);
    color: var(--text-dark);
}

a {
    text-decoration: none;
    color: var(--primary-light);
}

/* ---------------- AUTH PAGES ---------------- */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.auth-card {
    background: #fff;
    width: 380px;
    padding: 40px 35px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    text-align: center;
}

.auth-card h1 {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 6px;
}

.auth-card p.subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 25px;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

.auth-card input:focus {
    border-color: var(--primary-light);
}

.otp-input {
    text-align: center;
    font-size: 22px;
    letter-spacing: 8px;
    font-weight: 600;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background: var(--primary-light);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--primary);
}

.btn-secondary {
    background: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
}

.btn-small {
    width: auto;
    padding: 6px 14px;
    font-size: 13px;
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    text-align: left;
}

.alert-error {
    background: #FDECEA;
    color: var(--danger);
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #c3e6cb;
}

/* ---------------- LAYOUT (HEADER + SIDEBAR) ---------------- */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.topbar {
    background: var(--primary);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 220px;
    right: 0;
    z-index: 10;
}

.topbar .brand {
    font-size: 18px;
    font-weight: 600;
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.topbar .user-info .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

.sidebar {
    width: 220px;
    background: #fff;
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    padding-top: 70px;
    z-index: 20;
}

.sidebar .logo {
    text-align: center;
    padding: 10px 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--text-dark);
    font-size: 14px;
    border-left: 4px solid transparent;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: var(--bg-light);
    border-left-color: var(--primary-light);
    color: var(--primary-light);
    font-weight: 600;
}

.main-content {
    margin-left: 220px;
    margin-top: 60px;
    padding: 25px;
    width: calc(100% - 220px);
}

/* ---------------- LEAD VIEW (CHAT STYLE) ---------------- */

.lead-board {
    display: flex;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    min-height: 600px;
}

.lead-list {
    width: 320px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    max-height: 750px;
}

.lead-list-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
}

.lead-list-item:hover,
.lead-list-item.active {
    background: var(--bg-light);
}

.lead-list-item .name {
    font-weight: 600;
    font-size: 14px;
}

.lead-list-item .meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.lead-detail {
    flex: 1;
    padding: 20px;
}

.lead-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.notes-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 8px;
}

.note-bubble {
    background: var(--bubble-out);
    padding: 10px 14px;
    border-radius: 8px;
    max-width: 75%;
    align-self: flex-end;
    font-size: 13px;
}

.note-bubble .meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

/* ---------------- TABLES & BADGES ---------------- */

.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

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

table th, table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background: var(--bg-light);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.badge-new { background: #1976D2; }
.badge-contacted { background: var(--warning); }
.badge-quoted { background: #8E24AA; }
.badge-booked { background: var(--accent); }
.badge-lost { background: var(--danger); }
.badge-breached { background: var(--danger); }
.badge-ok { background: var(--accent); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-box {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-box .value {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
}

.stat-box .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

form .form-group {
    margin-bottom: 15px;
}

form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
}

form input, form select, form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .topbar { left: 0; }
    .main-content { margin-left: 0; width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .lead-board { flex-direction: column; }
    .lead-list { width: 100%; }
}
