/* ============================================================
   Movr Property Portal — Site Styles
   Brand: Navy #0D1D38 | Red #E12027 | Cream #FFFBF6
   ============================================================ */

:root {
    --movr-navy:       #0D1D38;
    --movr-navy-light: #1a2f55;
    --movr-red:        #E12027;
    --movr-cream:      #FFFBF6;
    --movr-cream-2:    #F5F0EA;
    --movr-border:     #E2DDD7;
    --sidebar-w:       260px;
    --radius:          10px;
    --shadow-sm:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:       0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
}

/* ---- Reset / Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    background: var(--movr-cream);
    color: var(--movr-navy);
    line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

/* ---- App Shell -------------------------------------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---------------------------------------------- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--movr-navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    overflow-y: auto;
    transition: transform .25s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}

.sidebar-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
/*    filter: brightness(0) invert(1);*/
}

.sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255,255,255,.75);
    white-space: nowrap;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.sidebar-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: rgba(255,255,255,.35);
    padding: .5rem 1.25rem .25rem;
    margin: 0;
    text-transform: uppercase;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.25rem;
    color: rgba(255,255,255,.65);
    font-size: .9375rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.07);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.10);
    border-left-color: var(--movr-red);
}

.nav-icon { font-size: 1.05rem; width: 1.2rem; text-align: center; flex-shrink: 0; }

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.sidebar-user { flex: 1; display: flex; align-items: center; gap: .6rem; min-width: 0; }

.user-avatar { font-size: 1.75rem; color: rgba(255,255,255,.55); flex-shrink: 0; }

.user-details { display: flex; flex-direction: column; min-width: 0; }

.user-name {
    font-size: .875rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role { font-size: .75rem; color: rgba(255,255,255,.45); }

.btn-logout {
    color: rgba(255,255,255,.55);
    font-size: 1.15rem;
    transition: color .15s;
    flex-shrink: 0;
    padding: .25rem;
}
.btn-logout:hover { color: var(--movr-red); }

/* ---- Sidebar overlay (mobile) ----------------------------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1030;
}

/* ---- Main wrapper ----------------------------------------- */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ---- Mobile top bar --------------------------------------- */
.mobile-topbar {
    background: var(--movr-navy);
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.btn-menu-toggle {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}

.mobile-logo {
    height: 26px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* ---- Main content ----------------------------------------- */
.main-content {
    flex: 1;
    padding: 2rem 2rem 3rem;
    background: var(--movr-cream);
}

/* ---- Page header ------------------------------------------ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--movr-navy);
    margin: 0;
}

.page-subtitle { color: #6b7280; font-size: .9375rem; }

.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.page-actions .btn {
    font-size: .875rem;
    font-weight: 500;
    padding: .45rem .9rem;
    border-radius: 8px;
}

/* ---- Filter tabs ------------------------------------------ */
.filter-bar { display: flex; align-items: center; }

.filter-tabs {
    display: inline-flex;
    background: var(--movr-cream-2);
    border: 1px solid var(--movr-border);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem 1rem;
    border-radius: 7px;
    font-size: .875rem;
    font-weight: 500;
    color: #6b7280;
    transition: all .15s;
}

.filter-tab:hover { color: var(--movr-navy); background: rgba(13,29,56,.06); }

.filter-tab.active {
    background: #fff;
    color: var(--movr-navy);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.tab-count {
    background: rgba(13,29,56,.08);
    color: var(--movr-navy);
    font-size: .75rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
}

.filter-tab.active .tab-count { background: var(--movr-red); color: #fff; }

/* ---- Moves table card ------------------------------------- */
.moves-card {
    background: #fff;
    border: 1px solid var(--movr-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.moves-table { margin: 0; }

.moves-table thead th {
    background: var(--movr-cream-2);
    color: #374151;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--movr-border);
    white-space: nowrap;
}

.moves-table tbody td {
    padding: .875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f3f0ec;
    font-size: .9375rem;
}

.moves-table tbody tr:last-child td { border-bottom: none; }

.move-row { transition: background .12s; }
.move-row:hover td { background: #fdf9f5; }
.move-row.row-flagged td { background: #fff7f7; }
.move-row.row-flagged:hover td { background: #ffefef; }

.customer-cell { display: flex; align-items: center; gap: .4rem; }
.customer-name { font-weight: 600; color: var(--movr-navy); }
.pickup-unit { display: block; margin-top: .1rem; }

.flag-indicator { line-height: 1; }

/* ---- Row actions ------------------------------------------ */
.row-actions { display: flex; gap: .4rem; justify-content: flex-end; }

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .35rem .75rem;
    border-radius: 7px;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1;
    transition: all .15s;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-view {
    background: var(--movr-navy);
    color: #fff;
}
.btn-view:hover { background: var(--movr-navy-light); color: #fff; }

.btn-flag {
    background: transparent;
    color: #9ca3af;
    border-color: var(--movr-border);
    font-size: .9rem;
    padding: .35rem .55rem;
}
.btn-flag:hover { border-color: var(--movr-red); color: var(--movr-red); background: #fff5f5; }
.btn-flag.btn-flag-active { background: #fff5f5; color: var(--movr-red); border-color: #fca5a5; }

/* ---- Status badges ---------------------------------------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: .25rem .65rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.badge-status-green  { background: #dcfce7; color: #15803d; }
.badge-status-amber  { background: #fef9c3; color: #92400e; }
.badge-status-red    { background: #fee2e2; color: #b91c1c; }

/* ---- Move type badge -------------------------------------- */
.move-type-badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 6px;
    background: rgba(13,29,56,.08);
    color: var(--movr-navy);
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ---- Time window text ------------------------------------- */
.time-window-text { color: #4b5563; font-size: .875rem; }

/* ---- Empty state ------------------------------------------ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
}
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .75rem; }
.empty-state p { font-size: 1rem; margin: 0; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body { background: var(--movr-navy); min-height: 100vh; margin: 0; }

.login-page {
    display: flex;
    min-height: 100vh;
}

.login-left {
    flex: 1;
    background: var(--movr-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.login-left-content { max-width: 420px; }

.login-brand-logo {
    height: 40px;
/*    filter: brightness(0) invert(1);*/
}

.login-tagline {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-top: .5rem;
}

.login-sub {
    color: rgba(255,255,255,.6);
    font-size: 1rem;
    margin-top: .75rem;
    line-height: 1.6;
}

.login-features { display: flex; flex-direction: column; gap: .6rem; }

.login-feature {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: rgba(255,255,255,.75);
    font-size: .9375rem;
}

.login-feature i { color: #4ade80; font-size: 1rem; flex-shrink: 0; }

.login-right {
    width: 460px;
    background: var(--movr-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    flex-shrink: 0;
}

.login-card { width: 100%; max-width: 380px; }

.login-logo-mobile {
    height: 32px;
    display: block;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--movr-navy);
    margin: 0;
}

.login-subtitle { color: #6b7280; margin-top: .25rem; margin-bottom: 1.5rem; }

.login-card .form-label { font-weight: 600; color: var(--movr-navy); font-size: .875rem; }

.login-card .input-group-text {
    background: var(--movr-cream-2);
    border-color: var(--movr-border);
    color: #6b7280;
}

.login-card .form-control {
    border-color: var(--movr-border);
    background: #fff;
    font-size: .9375rem;
}

.login-card .form-control:focus {
    border-color: var(--movr-navy);
    box-shadow: 0 0 0 3px rgba(13,29,56,.12);
}

.btn-login {
    background: var(--movr-navy);
    border-color: var(--movr-navy);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: .7rem 1.5rem;
    border-radius: 9px;
    transition: all .15s;
}

.btn-login:hover {
    background: var(--movr-navy-light);
    border-color: var(--movr-navy-light);
    color: #fff;
}

.login-demo-hint {
    background: rgba(13,29,56,.06);
    border-radius: 8px;
    padding: .75rem 1rem;
}

.login-demo-hint code {
    background: rgba(13,29,56,.1);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: .8rem;
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: #6b7280;
    font-size: .875rem;
    font-weight: 500;
    transition: color .15s;
}
.back-link:hover { color: var(--movr-navy); }

.detail-header { padding-bottom: 1rem; border-bottom: 1px solid var(--movr-border); }
.detail-header-main h1 { font-weight: 800; }

.alert-flag {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    color: #7f1d1d;
}
.alert-flag i { font-size: 1.1rem; flex-shrink: 0; margin-top: .1rem; }
.alert-flag strong { display: block; margin-bottom: .2rem; }

.detail-card {
    background: #fff;
    border: 1px solid var(--movr-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.detail-card-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 1.25rem;
    background: var(--movr-cream-2);
    border-bottom: 1px solid var(--movr-border);
    font-size: 1rem;
}

.detail-card-header i { font-size: 1.1rem; color: var(--movr-navy); }
.detail-card-header h5 { margin: 0; font-weight: 700; color: var(--movr-navy); font-size: 1rem; }

.building-notes-header { align-items: flex-start; }

.detail-card-body { padding: 1.25rem; }

.detail-list { display: flex; flex-direction: column; gap: .5rem; margin: 0; }

.detail-row {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    padding: .4rem 0;
    border-bottom: 1px solid #f3f0ec;
}
.detail-row:last-child { border-bottom: none; }

.detail-row dt {
    font-size: .8125rem;
    font-weight: 600;
    color: #6b7280;
    min-width: 150px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.detail-row dd { margin: 0; font-size: .9375rem; color: var(--movr-navy); }

.address-block { font-size: .9375rem; }

.access-notes {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-top: 1rem;
    font-size: .875rem;
    color: #78350f;
}
.access-notes-label {
    font-weight: 700;
    margin-bottom: .25rem;
    font-size: .8125rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.badge-pill {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .775rem;
    font-weight: 600;
    background: rgba(13,29,56,.08);
    color: var(--movr-navy);
}
.badge-pill.badge-warning-soft { background: #fef9c3; color: #92400e; }

/* ---- Process timeline ------------------------------------- */
.process-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .25rem;
}

.process-step {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .7rem;
    border-radius: 20px;
    font-size: .8125rem;
    font-weight: 500;
}

.step-done { background: #dcfce7; color: #166534; }
.step-pending { background: #f3f4f6; color: #6b7280; }
.step-skipped { background: #fef9c3; color: #78350f; }

.step-indicator { font-size: .9rem; flex-shrink: 0; }
.step-label { white-space: nowrap; }
.step-time { color: inherit; opacity: .7; margin-left: .25rem; }

/* ============================================================
   FLAG MODAL
   ============================================================ */
.flag-modal-icon { font-size: 1.1rem; }

.modal-content {
    border-radius: 14px;
    border: 1px solid var(--movr-border);
}

.modal-header { padding: 1.25rem 1.5rem 1rem; }
.modal-body { padding: 0 1.5rem 1rem; }
.modal-footer { padding: 0 1.5rem 1.25rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,.3);
    }
    .sidebar-overlay.show {
        display: block;
    }
    .main-wrapper {
        margin-left: 0;
    }
    .main-content {
        padding: 1.25rem 1rem 2rem;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .detail-row dt { min-width: 120px; }
    .login-right { width: 100%; }
}

@media (max-width: 575.98px) {
    .filter-tabs { width: 100%; }
    .filter-tab { flex: 1; justify-content: center; }
    .moves-table thead th:nth-child(4),
    .moves-table tbody td:nth-child(4) { display: none; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; justify-content: center; }
}

/* ============================================================
   BOOTSTRAP OVERRIDES
   ============================================================ */
.btn:focus, .btn:active:focus, .form-control:focus {
    box-shadow: 0 0 0 3px rgba(13,29,56,.15);
}

.btn-outline-dark {
    border-color: #d1ccc7;
    color: var(--movr-navy);
}
.btn-outline-dark:hover {
    background: var(--movr-navy);
    border-color: var(--movr-navy);
    color: #fff;
}
