/* ============================================================
   Efficient Property Marketing — Brand CSS
   Aperture palette: Red #e8384d | Green #5cb85c | Amber #f5a623 | Salmon #ff8a65
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Outfit:wght@300;400;600&display=swap');

:root {
    --epm-navy:        #232d14;
    --epm-navy-light:  #2e3c1a;
    --epm-olive:       #4b5320;
    --epm-olive-light: #5d6b28;
    --epm-black:       #1a1a1a;
    --epm-charcoal:    #2a2a2a;
    --epm-red:         #e8384d;
    --epm-red-dark:    #c4293c;
    --epm-green:       #5cb85c;
    --epm-amber:       #f5a623;
    --epm-salmon:      #ff8a65;
    --epm-light:       #f0f2f7;
    --epm-border:      #e8ecf0;
    --epm-text:        #232d14;
    --epm-text-muted:  #718096;
    --sidebar-width:   250px;
    --topnav-height:   64px;

    /* Override Bootstrap blue with army olive */
    --bs-primary:        #4b5320;
    --bs-primary-rgb:    75, 83, 32;
    --bs-info:           #6b7a2e;
    --bs-info-rgb:       107, 122, 46;
    --bs-link-color:     #4b5320;
    --bs-link-hover-color: #3a4018;
}

/* Base */
html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 15px; } }

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--epm-text);
    background-color: var(--epm-light);
    margin-bottom: 0;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    z-index: 100;
    background-color: var(--epm-navy);
    box-shadow: 2px 0 12px rgba(0,0,0,0.18);
    transition: margin-left .3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Logo area at top of sidebar */
.sidebar-logo {
    display: block;
    background: transparent;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
    flex-shrink: 0;
}
.sidebar-logo svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Sidebar nav items */
.sidebar .nav-link {
    color: rgba(255,255,255,0.58);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin: 2px 10px;
    transition: all 0.2s ease;
    border-left: none;
}
.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.08);
}
.sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(92, 184, 92, 0.22);
}
.sidebar .nav-link i {
    width: 18px;
    text-align: center;
}

.sidebar-heading {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12rem;
    font-weight: 700;
    color: rgba(255,255,255,0.22);
    padding: 1rem 1.25rem 0.25rem;
}

/* Sidebar bottom spacer — pushes last section to bottom */
.sidebar-spacer { flex: 1; }

/* ── Top Navbar ───────────────────────────────────────────── */
.epm-topnav {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--epm-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 0 1.5rem;
    height: var(--topnav-height);
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.epm-topnav .page-title {
    color: var(--epm-navy);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.epm-topnav .nav-link {
    color: #4a5568 !important;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.9rem !important;
    border-radius: 0.25rem;
    transition: all 0.2s;
}
.epm-topnav .nav-link:hover {
    color: var(--epm-navy) !important;
    background: #f7fafc;
}

/* User pill button */
.epm-user-pill {
    background: #fff;
    border: 1px solid var(--epm-border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--epm-navy);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.epm-user-pill:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: var(--epm-navy);
}
.epm-user-pill i {
    color: var(--epm-text-muted);
    font-size: 0.8rem;
}

.epm-topnav-dots {
    border: 1px solid var(--epm-border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #4a5568;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}
.epm-topnav-dots:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

/* ── Main Content ─────────────────────────────────────────── */
main.epm-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--topnav-height);
    min-height: calc(100vh - var(--topnav-height));
    background-color: var(--epm-light);
    padding: 28px;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--epm-border);
    border-radius: 12px 12px 0 0 !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 14px 20px;
}
.card-header h6,
.card-header .h6 {
    color: var(--epm-navy);
}
.card-header.text-white h6,
.card-header.text-white .h6 {
    color: #fff;
}

/* ── Stat Cards — new design ─────────────────────────────── */
.epm-stat-card {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
    background: #fff;
}
.epm-stat-card .card-body {
    padding: 22px 24px !important;
}
.epm-stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--epm-text-muted);
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: none;
    letter-spacing: 0;
}
.epm-stat-card .stat-value-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.epm-stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}
.stat-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.stat-icon-red    { background: rgba(232,56,77,0.1);   color: var(--epm-red); }
.stat-icon-green  { background: rgba(92,184,92,0.1);   color: var(--epm-green); }
.stat-icon-amber  { background: rgba(245,166,35,0.1);  color: var(--epm-amber); }
.stat-icon-salmon { background: rgba(255,138,101,0.1); color: var(--epm-salmon); }
.stat-icon-navy   { background: rgba(75,83,32,0.1);    color: var(--epm-olive); }

/* Legacy left-border stat cards (kept for compat) */
.stat-card-red    { border-left: 4px solid var(--epm-red) !important; }
.stat-card-green  { border-left: 4px solid var(--epm-green) !important; }
.stat-card-amber  { border-left: 4px solid var(--epm-amber) !important; }
.stat-card-salmon { border-left: 4px solid var(--epm-salmon) !important; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-epm-primary {
    background-color: var(--epm-red);
    border-color: var(--epm-red);
    color: #fff;
    font-weight: 700;
    border-radius: 8px;
}
.btn-epm-primary:hover {
    background-color: var(--epm-red-dark);
    border-color: var(--epm-red-dark);
    color: #fff;
}
.btn-outline-epm {
    border-color: var(--epm-red);
    color: var(--epm-red);
    font-weight: 600;
    border-radius: 8px;
}
.btn-outline-epm:hover {
    background-color: var(--epm-red);
    color: #fff;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge-pending    { background-color: var(--epm-amber) !important; color: #1a1a1a !important; }
.badge-confirmed  { background-color: #17a2b8 !important; }
.badge-inprogress { background-color: #4e73df !important; }
.badge-completed  { background-color: var(--epm-green) !important; }
.badge-cancelled  { background-color: var(--epm-red) !important; }

/* ── Tables ───────────────────────────────────────────────── */
.table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--epm-text-muted);
    border-bottom-width: 1px;
}
.table tbody tr:hover {
    background-color: rgba(26,37,64,0.025);
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert { border-radius: 10px; font-weight: 600; font-size: 0.875rem; }

/* ── Aperture accent line (decorative) ───────────────────── */
.epm-aperture-bar {
    height: 4px;
    background: linear-gradient(90deg,
        var(--epm-red) 0%,
        var(--epm-amber) 33%,
        var(--epm-green) 66%,
        var(--epm-salmon) 100%);
    border-radius: 2px;
}

/* ── Focus ring ──────────────────────────────────────────── */
.btn:focus, .form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(232,56,77,0.2);
    border-color: var(--epm-red);
    outline: none;
}

/* ── Utility ─────────────────────────────────────────────── */
.text-epm-red    { color: var(--epm-red) !important; }
.text-epm-green  { color: var(--epm-green) !important; }
.text-epm-amber  { color: var(--epm-amber) !important; }
.text-epm-salmon { color: var(--epm-salmon) !important; }
.text-epm-navy   { color: var(--epm-navy) !important; }
.text-xs  { font-size: 0.72rem; }
.text-gray-300 { color: #d1d1d1 !important; }
.text-gray-800 { color: #4a5568 !important; }
.fw-700 { font-weight: 700 !important; }

/* Legacy compat */
.border-left-primary { border-left: 0.25rem solid var(--epm-olive) !important; }
.border-left-success { border-left: 0.25rem solid var(--epm-green) !important; }
.border-left-info    { border-left: 0.25rem solid var(--epm-olive-light) !important; }
.border-left-warning { border-left: 0.25rem solid var(--epm-amber) !important; }
.border-left-danger  { border-left: 0.25rem solid var(--epm-red) !important; }
.text-white-75 { color: rgba(255,255,255,0.75) !important; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    .sidebar.show {
        margin-left: 0;
    }
    main.epm-main {
        margin-left: 0;
        padding: 16px;
    }
    .epm-topnav {
        left: 0;
    }
    .sidebar-toggle-btn {
        display: inline-flex !important;
    }
}
.sidebar-toggle-btn { display: none; }

/* ── Bootstrap blue → Army olive overrides ───────────────── */
.bg-primary                  { background-color: var(--epm-olive) !important; }
.bg-info                     { background-color: var(--epm-olive-light) !important; }
.text-primary                { color: var(--epm-olive) !important; }
.text-info                   { color: var(--epm-olive-light) !important; }
.border-primary              { border-color: var(--epm-olive) !important; }

.btn-primary {
    background-color: var(--epm-olive);
    border-color: var(--epm-olive);
    color: #fff;
    font-weight: 700;
    border-radius: 8px;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--epm-navy-light);
    border-color: var(--epm-navy-light);
    color: #fff;
}
.btn-outline-primary {
    border-color: var(--epm-olive);
    color: var(--epm-olive);
    font-weight: 600;
    border-radius: 8px;
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background-color: var(--epm-olive);
    border-color: var(--epm-olive);
    color: #fff;
}
.btn-info {
    background-color: var(--epm-olive-light);
    border-color: var(--epm-olive-light);
    color: #fff;
}
.btn-outline-info {
    border-color: var(--epm-olive-light);
    color: var(--epm-olive-light);
}
a { color: var(--epm-olive); }
a:hover { color: var(--epm-navy); }

/* Fix focus ring for olive */
.btn:focus, .form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(75,83,32,0.2);
    border-color: var(--epm-olive);
    outline: none;
}
