/* ================================================================
   JOSUA CARWASH — Global Design System
   Theme: Minimalist monochrome + yellow-orange accent
   No build step required — plain CSS.
================================================================ */

/* ================================================================
   DESIGN TOKENS
================================================================ */
:root {
    /* Surface */
    --c-bg:            #F5F5F5;
    --c-surface:       #FFFFFF;
    --c-surface-alt:   #FAFAFA;
    --c-border:        #E8E8E8;
    --c-border-light:  #F0F0F0;

    /* Text */
    --c-text-primary:   #111111;
    --c-text-secondary: #777777;
    --c-text-muted:     #AAAAAA;

    /* Brand accent — yellow-orange */
    --c-accent:        #F59E0B;
    --c-accent-dark:   #D97706;
    --c-accent-light:  #FFFBEB;
    --c-accent-mid:    #FDE68A;

    /* Radii */
    --r-sm:   6px;
    --r-md:   12px;
    --r-lg:   20px;
    --r-pill: 999px;

    /* Shadows */
    --shadow-card: 0 1px 3px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);

    /* Page spacing */
    --page-pad: clamp(1rem, 4vw, 2.5rem);
}

/* ================================================================
   BASE
================================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--c-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--c-text-primary);
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ================================================================
   LAYOUT
================================================================ */
.page-wrapper {
    padding: var(--page-pad);
}

/* ================================================================
   NAVBAR
================================================================ */
.app-navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-border);
    padding: 0.875rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-navbar-brand {
    display: inline-flex;
    align-items: center;
    height: 52px;
    overflow: hidden;
    text-decoration: none;
    white-space: nowrap;
}

.app-navbar-brand img {
    width: 180px;
    height: 60px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.app-navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.user-pill {
    background: var(--c-accent-light);
    border: 1px solid var(--c-accent-mid);
    padding: 5px 10px 5px 14px;
    border-radius: var(--r-pill);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1;
}

.user-pill-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-primary);
}

.user-pill-role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--c-accent-dark);
}

.user-menu-pill {
    position: relative;
}

.user-role-menu {
    position: relative;
}

.user-role-menu > summary {
    list-style: none;
}

.user-role-menu > summary::-webkit-details-marker {
    display: none;
}

.user-pill-role {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}

.role-chevron {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--c-accent-dark);
    border-bottom: 1.5px solid var(--c-accent-dark);
    transform: rotate(45deg) translateY(-1px);
    transition: transform 0.2s ease;
}

.user-role-menu[open] .role-chevron {
    transform: rotate(225deg) translateY(-1px);
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 150px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    box-shadow: var(--shadow-card);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 120;
}

.user-menu-item {
    width: 100%;
    display: block;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--c-text-primary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.user-menu-item:hover {
    background: var(--c-surface-alt);
}

.user-menu-item-danger {
    color: #DC2626;
}

.user-menu-item-danger:hover {
    background: #FEF2F2;
    color: #B91C1C;
}

.user-menu-form {
    margin: 0;
}

/* ================================================================
   PAGE HEADER
================================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-breadcrumb {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--c-text-muted);
    margin-bottom: 4px;
}

.page-title {
    font-family: 'LEMONMILK', sans-serif;
    font-size: clamp(1.4rem, 4vw, 1.9rem);
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--c-text-primary);
    margin: 0;
    line-height: 1;
}

/* ================================================================
   CARD
================================================================ */
.card-base,
.modern-card {
    background: var(--c-surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--c-border-light);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ================================================================
   BUTTONS
================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--c-text-primary);
    color: #fff;
}

.btn-primary:hover {
    background: #333;
    color: #fff;
}

.btn-accent {
    background: var(--c-accent);
    color: var(--c-text-primary);
}

.btn-accent:hover {
    background: var(--c-accent-dark);
    color: var(--c-text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--c-text-secondary);
    border: 1px solid var(--c-border);
}

.btn-ghost:hover {
    border-color: var(--c-text-primary);
    color: var(--c-text-primary);
}

/* ================================================================
   BADGES
================================================================ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-default {
    background: #F0F0F0;
    color: var(--c-text-secondary);
}

.badge-accent {
    background: var(--c-accent-light);
    color: var(--c-accent-dark);
    border: 1px solid var(--c-accent-mid);
}

.badge-success {
    background: #F0FDF4;
    color: #16A34A;
}

.badge-danger {
    background: #FFF1F2;
    color: #E11D48;
}

/* ================================================================
   FORMS
================================================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-surface);
    color: var(--c-text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23777' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-error {
    font-size: 12px;
    color: #E11D48;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding-top: 0.5rem;
    flex-wrap: wrap;
}

.alert-error {
    background: #FFF1F2;
    border: 1px solid #FECDD3;
    border-left: 3px solid #E11D48;
    border-radius: var(--r-md);
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 13px;
    color: #9F1239;
}

.alert-error ul { margin: 0; padding-left: 1.25rem; }
.alert-error li { margin-bottom: 2px; }

/* ================================================================
   AUTH PAGES
================================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: url('/images/background/carwash.jpg') center center / cover no-repeat;
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.auth-card {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--r-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

/* Scoped text overrides so labels/inputs are always readable on the glass card */
.auth-card .form-label {
    color: #333333;
}

.auth-card .form-input,
.auth-card .form-select {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.18);
    color: #111111;
}

.auth-card .form-input::placeholder {
    color: #999999;
}

.auth-card .form-input:focus,
.auth-card .form-select:focus {
    background: #ffffff;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.auth-logo img {
    width: 180px;
    height: 100px;
    object-fit: cover;
    object-position: center;
}

.auth-subtitle {
    font-size: 12px;
    color: #555555;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem;
}

.auth-divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    margin: 1.5rem 0;
}

.auth-card p,
.auth-card p a {
    color: #444444;
}

.auth-card p a {
    color: var(--c-accent-dark);
    font-weight: 600;
    text-decoration: none;
}

/* ================================================================
   DATA TABLE
================================================================ */
.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--c-text-muted);
    border-bottom: 2px solid var(--c-border-light);
    white-space: nowrap;
}

.modern-table tbody tr {
    transition: background 0.15s;
}

.modern-table tbody tr:hover {
    background: var(--c-surface-alt);
}

.modern-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--c-border-light);
    font-size: 13px;
    vertical-align: middle;
    color: var(--c-text-primary);
}

.modern-table tfoot td {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--c-text-secondary);
    background: var(--c-surface-alt);
}

.table-footer-info {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--c-border-light);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-text-muted);
}

/* ================================================================
   ACTION ICON
================================================================ */
.action-icon,
.action-icon-circle {
    width: 30px;
    height: 30px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    padding: 0;
}

.action-icon:hover,
.action-icon-circle:hover {
    background: var(--c-text-primary);
    color: #fff;
    border-color: var(--c-text-primary);
}

.action-icon.danger:hover,
.action-icon-circle.danger:hover {
    background: #E11D48;
    border-color: #E11D48;
    color: #fff;
}

/* ================================================================
   MOBILE LIST VIEW
   .desktop-table  — visible on desktop, hidden on mobile
   .mobile-list    — hidden on desktop, shown on mobile
================================================================ */
.mobile-list { display: none; }

.list-item {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text-primary);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.list-item-sub {
    font-size: 12px;
    color: var(--c-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-sub .sep {
    margin: 0 6px;
    color: var(--c-border);
}

@media (max-width: 639px) {
    .desktop-table { display: none; }
    .mobile-list   { display: flex; flex-direction: column; gap: 0.5rem; }

    .page-wrapper  { padding: 1rem; }
    .app-navbar    { padding: 0.75rem 1rem; }
    .app-navbar-brand {
        height: 44px;
    }
    .app-navbar-brand img {
        width: 150px;
        height: 45px;
    }
    .user-pill {
        display: flex;
        max-width: calc(100vw - 140px);
        padding: 4px 8px 4px 10px;
        gap: 6px;
    }
    .user-pill-name {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .user-pill-role {
        font-size: 9px;
        letter-spacing: 0.6px;
    }
}
