:root {
    --primary: #b8941e;
    --primary-dark: #8b6a0f;
    --bg: #f7f4ea;
    --surface: #ffffff;
    --text: #1f2430;
    --muted: #677085;
    --border: #e7dcc0;
    --success: #1f8f5f;
    --danger: #b84040;
    --cold: #7d8aa5;
    --warm: #b8941e;
    --hot: #d95f2a;
    --converted: #1f8f5f;
    --shadow: 0 18px 40px rgba(31, 36, 48, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(180deg, #fcfbf7 0%, var(--bg) 100%);
    color: var(--text);
}

.admin-shell {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-kicker {
    margin: 0 0 0.5rem;
    color: var(--primary-dark);
    font-weight: 800;
}

.admin-header h1 {
    margin: 0;
    font-size: 2rem;
}

.admin-subtitle {
    margin: 0.65rem 0 0;
    color: var(--muted);
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.session-badge {
    background: rgba(184, 148, 30, 0.12);
    color: var(--primary-dark);
    border: 1px solid rgba(184, 148, 30, 0.22);
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font-weight: 800;
    white-space: nowrap;
}

.back-link {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
}

.flash-message {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    font-weight: 700;
}

.flash-success {
    background: rgba(31, 143, 95, 0.1);
    color: var(--success);
}

.flash-error {
    background: rgba(184, 64, 64, 0.1);
    color: var(--danger);
}

.login-panel,
.table-panel,
.super-admin-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.login-panel {
    max-width: 520px;
    margin: 3rem auto 0;
    padding: 2rem;
}

.login-panel h2 {
    margin-top: 0;
}

.login-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

.login-form label,
.status-form {
    display: grid;
    gap: 0.45rem;
}

.login-form input,
.status-form select,
.status-form input,
.status-form textarea {
    width: 100%;
    border: 1px solid #d8cdaa;
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    font: inherit;
    color: var(--text);
    background: #fffdfa;
}

.assigned-select {
    min-width: 135px;
}

.status-form textarea {
    resize: vertical;
    min-height: 88px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.45rem;
    font-weight: 700;
}

.stat-card strong {
    font-size: 2rem;
}

.stat-card.cold strong { color: var(--cold); }
.stat-card.warm strong { color: var(--warm); }
.stat-card.hot strong { color: var(--hot); }
.stat-card.converted strong { color: var(--converted); }

.table-panel {
    padding: 1.25rem;
}

.super-admin-panel {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.user-management-grid {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 1rem;
}

.user-form-card,
.users-list-card {
    border: 1px solid #efe5c9;
    border-radius: 18px;
    padding: 1rem;
    background: #fffdfa;
}

.user-form-card h3,
.users-list-card h3 {
    margin: 0 0 1rem;
}

.user-management-form,
.inline-user-form {
    display: grid;
    gap: 0.85rem;
}

.user-management-form label {
    display: grid;
    gap: 0.45rem;
}

.user-management-form input,
.users-table input {
    width: 100%;
    border: 1px solid #d8cdaa;
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    font: inherit;
    color: var(--text);
    background: #fff;
}

.users-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    border-bottom: 1px solid #efe5c9;
    padding: 0.85rem 0.7rem;
    text-align: right;
    vertical-align: middle;
}

.users-table thead th {
    background: #fcf7e8;
    color: var(--primary-dark);
}

.compact-empty {
    padding: 1.5rem 0.75rem;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.table-header h2 {
    margin: 0;
}

.table-header p {
    margin: 0;
    color: var(--muted);
}

.table-wrapper {
    overflow: auto;
}

.leads-table {
    width: 100%;
    min-width: 1450px;
    border-collapse: collapse;
}

.leads-table th,
.leads-table td {
    border-bottom: 1px solid #efe5c9;
    padding: 0.9rem 0.7rem;
    vertical-align: top;
    text-align: right;
}

.leads-table thead th {
    position: sticky;
    top: 0;
    background: #fcf7e8;
    color: var(--primary-dark);
    font-size: 0.95rem;
    z-index: 1;
}

.leads-table tbody tr:nth-child(even) td {
    background: #fffdfa;
}

.hotels-cell {
    min-width: 220px;
    line-height: 1.7;
}

.status-select.status-cold {
    border-color: rgba(125, 138, 165, 0.45);
}

.status-select.status-warm {
    border-color: rgba(184, 148, 30, 0.55);
}

.status-select.status-hot {
    border-color: rgba(217, 95, 42, 0.45);
}

.status-select.status-converted {
    border-color: rgba(31, 143, 95, 0.45);
}

.score-input {
    min-width: 110px;
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
}

.btn-secondary {
    background: #1f2430;
    color: #fff;
}

.btn-small {
    width: 100%;
    min-width: 90px;
}

.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-management-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-header,
    .table-header,
    .admin-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-shell {
        padding: 1.25rem 0.75rem 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-panel,
    .table-panel {
        border-radius: 18px;
    }
}
