/* ── Variables ───────────────────────────────────────── */
:root {
    --accent-red: #c44536;
    --gradient-red: linear-gradient(135deg, #c44536, #d95f4e);
    --dark-bg: #0a0a0a;
    --dark-card: #111111;
    --dark-card-border: rgba(255, 255, 255, 0.07);
    --text-secondary: #a0a0a0;
    --text-muted: #5a5a5a;
}

/* ── Base ────────────────────────────────────────────── */
body {
    font-family: 'Raleway', sans-serif;
    background: var(--dark-bg);
    min-height: 100vh;
    padding: 80px 20px 60px;
}

/* ── Background decorations ──────────────────────────── */
.page-bg-glow {
    position: fixed;
    top: 0;
    right: 0;
    width: 65vw;
    height: 65vh;
    background: radial-gradient(ellipse at 75% 15%, rgba(196, 69, 54, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.page-bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: radial-gradient(ellipse at center, black 5%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, black 5%, transparent 75%);
}

/* ── Navbar ──────────────────────────────────────────── */
.navbar {
    background-color: rgba(10, 10, 10, 0.95) !important;
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-logo-icon {
    height: 40px;
    width: 40px;
    padding: 5px;
    background: var(--gradient-red);
    border-radius: 10px;
    margin-right: 0.75rem;
    object-fit: contain;
}

.navbar-logo-text {
    height: 40px;
}

/* ── Page container ──────────────────────────────────── */
.clients-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ── Header ──────────────────────────────────────────── */
.clients-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.clients-eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--accent-red);
    background: rgba(196, 69, 54, 0.1);
    border: 1px solid rgba(196, 69, 54, 0.25);
    border-radius: 20px;
    padding: 0.35rem 1rem;
    margin-bottom: 1rem;
}

.clients-title {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.clients-title .gradient-text {
    background: linear-gradient(135deg, #c44536, #e07b6e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.clients-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ── Search bar ──────────────────────────────────────── */
.clients-search-wrap {
    position: relative;
    max-width: 480px;
    margin: 0 auto 2rem;
}

.clients-search-wrap i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.clients-search-wrap input {
    width: 100%;
    background: var(--dark-card);
    border: 1px solid var(--dark-card-border);
    border-radius: 50px;
    color: #fff;
    padding: 0.7rem 1rem 0.7rem 2.75rem;
    font-size: 0.9rem;
    font-family: 'Raleway', sans-serif;
    transition: border-color 0.2s;
}

.clients-search-wrap input:focus {
    outline: none;
    border-color: rgba(196, 69, 54, 0.4);
}

.clients-search-wrap input::placeholder {
    color: var(--text-muted);
}

/* ── States ──────────────────────────────────────────── */
.loading-state,
.empty-state,
.error-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.state-icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.empty-state .state-icon-wrap {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--dark-card-border);
    color: var(--text-muted);
}

.error-state .state-icon-wrap {
    background: rgba(196, 69, 54, 0.1);
    border: 1px solid rgba(196, 69, 54, 0.2);
    color: var(--accent-red);
}

.loading-state .spinner-border {
    width: 48px;
    height: 48px;
    border-width: 3px;
    border-color: rgba(196, 69, 54, 0.2);
    border-top-color: var(--accent-red);
    margin-bottom: 1.5rem;
}

.loading-state h3,
.empty-state h3,
.error-state h3 {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p,
.error-state p {
    font-size: 0.9rem;
    max-width: 340px;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn-primary {
    background: var(--gradient-red) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    border-radius: 50px;
    padding: 0.65rem 1.5rem;
    box-shadow: 0 4px 16px rgba(196, 69, 54, 0.3);
    transition: all 0.25s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(196, 69, 54, 0.45);
}

/* ── Client list ─────────────────────────────────────── */
.clients-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Client card ─────────────────────────────────────── */
.client-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-card-border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.client-card:hover {
    border-color: rgba(196, 69, 54, 0.3);
    box-shadow: 0 6px 24px rgba(196, 69, 54, 0.1);
}

.client-card-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
}

.client-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(196, 69, 54, 0.12);
    border: 1px solid rgba(196, 69, 54, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-red);
    font-size: 1rem;
}

.client-info {
    flex: 1;
    min-width: 0;
}

.client-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.97rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-vehicle {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-phone {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

.client-meta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.client-expand-icon {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.client-card.expanded .client-expand-icon {
    transform: rotate(180deg);
}

.client-mod-count {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.color-dot-mini {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.client-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.client-delete-btn:hover {
    color: var(--accent-red);
    background: rgba(196, 69, 54, 0.1);
}

/* ── Client detail (expanded) ────────────────────────── */
.client-detail {
    border-top: 1px solid var(--dark-card-border);
}

.client-detail-inner {
    padding: 1.25rem 1.5rem;
}

.cd-section {
    margin-bottom: 1.25rem;
}

.cd-section:last-child {
    margin-bottom: 0;
}

.cd-section-title {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cd-section-title i {
    color: var(--accent-red);
}

.cd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
}

.cd-field {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}

.cd-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.cd-value {
    color: #fff;
    font-size: 0.88rem;
    font-weight: 500;
}

.cd-notes {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin: 0;
    line-height: 1.55;
}

/* ── Modifications timeline ──────────────────────────── */
.cd-mods {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cd-mod-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
}

.cd-mod-thumb {
    width: 52px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #0a0a0a;
}

.cd-mod-thumb-ph {
    width: 52px;
    height: 42px;
    border-radius: 6px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
}

.cd-mod-info {
    flex: 1;
    min-width: 0;
}

.cd-type-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 0.15rem 0.45rem;
}

.cd-mod-link {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.15s;
}

.cd-mod-link:hover {
    color: var(--accent-red);
}

/* ── Auth Loader ─────────────────────────────────────── */
#authLoader {
    position: fixed;
    inset: 0;
    background: var(--dark-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s;
}

#authLoader.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 576px) {
    .clients-title {
        font-size: 1.8rem;
    }

    .client-card-main {
        padding: 0.85rem 1rem;
    }
}
