/* ==========================================================================
   Google Fonts Import
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&family=Poppins:wght@300;400;500;600&family=Roboto:wght@400;500;700&display=swap');

/* ==========================================================================
   Global Variables (Adjustable via PHP)
   ========================================================================== */
:root {
    /* Primary Colors */
    --primary-deep-brown: #3B2417;
    --accent-premium-gold: #C9A227;
    
    /* Neutral Colors */
    --bg-white: #FFFFFF;
    --text-charcoal: #333333;
    --border-grey: #E5E5E5;

    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --font-data: 'Roboto', sans-serif;
}

/* ==========================================================================
   Base Elements
   ========================================================================== */
body {
    font-family: var(--font-body);
    color: var(--text-charcoal);
    background-color: #f4f7f6; /* Slight off-white for contrast against cards */
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-deep-brown);
    font-weight: 600;
    margin-bottom: 1rem;
}

p {
    font-family: var(--font-body);
    color: var(--text-charcoal);
    line-height: 1.6;
}

a {
    color: var(--primary-deep-brown);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-premium-gold);
}

/* ==========================================================================
   Layout Components (Sidebar, Header, Cards)
   ========================================================================== */
.sidebar, .top-header {
    background-color: var(--primary-deep-brown);
    color: var(--bg-white);
}

.sidebar a {
    color: var(--bg-white);
}

.sidebar a:hover, .sidebar a.active {
    color: var(--accent-premium-gold);
}

.logo-text {
    font-family: var(--font-heading);
    color: var(--bg-white);
}

.crm-card {
    background-color: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    background: var(--bg-white);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

.dashboard-hero h2 {
    font-size: clamp(1.8rem, 2.2vw, 2.6rem);
    margin-bottom: 0.35rem;
}

.dashboard-hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.summary-card,
.dashboard-card {
    background: var(--bg-white);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(229, 229, 229, 0.7);
    padding: 1.5rem;
}

.summary-card {
    min-height: 170px;
}

.summary-card .summary-title {
    font-size: 0.82rem;
    color: var(--text-charcoal);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.summary-card .summary-value {
    font-size: 1.95rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-data);
}

.summary-card .summary-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 1.25rem;
}

.summary-card .summary-note {
    font-size: 0.9rem;
}

.dashboard-card h5,
.dashboard-card h6 {
    margin-bottom: 1rem;
    color: var(--primary-deep-brown);
}

.metric-item,
.activity-row,
.product-row,
.staff-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-item:last-child,
.activity-row:last-child,
.product-row:last-child,
.staff-row:last-child {
    margin-bottom: 0;
}

.metric-item .label,
.product-row .label,
.staff-row .label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.metric-item .value,
.product-row .value,
.staff-row .value {
    font-weight: 700;
    color: var(--text-charcoal);
}

.badge-pill {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-pill-success {
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
}

.badge-pill-warning {
    background: rgba(255, 193, 7, 0.16);
    color: #ad8b00;
}

.badge-pill-danger {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.dashboard-list-card .list-row {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(229, 229, 229, 0.7);
}

.dashboard-list-card .list-row:last-child {
    border-bottom: none;
}

.dashboard-list-card .list-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.dashboard-list-card .list-subtitle {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.dashboard-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-charcoal);
    background: rgba(220, 53, 69, 0.06);
}

.fab-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999;
    background: var(--primary-deep-brown);
    color: #ffffff;
    border-radius: 999px;
    padding: 0.95rem 1.6rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.fab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.18);
}

@media (max-width: 1200px) {
    .dashboard-hero {
        padding: 1.9rem 1.5rem;
        gap: 1rem;
    }

    .dashboard-hero-actions {
        justify-content: flex-start;
        width: 100%;
        gap: 0.85rem;
        flex-wrap: wrap;
    }

    .dashboard-hero-actions a {
        flex: 1 1 170px;
        min-width: 140px;
    }
}

@media (max-width: 991px) {
    .dashboard-hero {
        padding: 1.75rem 1.2rem;
        margin-bottom: 1.25rem;
    }

    .dashboard-hero h2 {
        font-size: 2rem;
    }
}

@media (max-width: 767px) {
    body {
        min-height: 100vh;
    }

    .main-content {
        padding: 1rem 0.9rem 1.25rem;
    }

    .container-fluid {
        padding: 0;
    }

    .dashboard-hero {
        padding: 1.25rem 1rem;
        margin-bottom: 1rem;
        border-radius: 24px;
    }

    .summary-card,
    .dashboard-card {
        border-radius: 24px;
        padding: 1.25rem;
    }

    .dashboard-card h5,
    .dashboard-card h6 {
        font-size: 1rem;
    }

    .dashboard-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-hero-actions a {
        width: 100%;
    }

    .main-content .row > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .row.g-4,
    .row.g-3 {
        gap: 1rem !important;
    }

    .dashboard-hero .text-muted-custom,
    .dashboard-card .text-muted-custom {
        font-size: 0.95rem;
    }

    .dashboard-list-card .list-row {
        border-radius: 20px;
        padding: 1rem;
        background: #ffffff;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
        border: 1px solid rgba(226,232,240,0.8);
        margin-bottom: 0.85rem;
    }
    .dashboard-list-card .list-row:last-child {
        margin-bottom: 0;
    }

    .dashboard-card .metric-item,
    .dashboard-card .activity-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .dashboard-card .metric-item .value,
    .dashboard-card .activity-row .value {
        text-align: left;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary {
    background-color: var(--primary-deep-brown) !important;
    border-color: var(--primary-deep-brown) !important;
    font-family: var(--font-heading);
    color: var(--bg-white) !important;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--accent-premium-gold) !important;
    border-color: var(--accent-premium-gold) !important;
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
.form-control, .form-select {
    border: 1px solid var(--border-grey);
    font-family: var(--font-body);
    color: var(--text-charcoal);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-premium-gold);
    box-shadow: 0 0 0 0.2rem rgba(201, 162, 39, 0.25);
}

/* ==========================================================================
   Tables & Data (Dashboards, Numbers)
   ========================================================================== */
.table, .dashboard-stats, .metric-number {
    font-family: var(--font-data);
    color: var(--text-charcoal);
}

.table th {
    font-family: var(--font-heading);
    color: var(--primary-deep-brown);
    border-bottom: 2px solid var(--border-grey);
}

.table td, .table th {
    border-color: var(--border-grey);
    vertical-align: middle;
}

/* ==========================================================================
   Utilities (Notifications, Icons, Highlights)
   ========================================================================== */
.icon-accent, .notification-dot, .highlight-text {
    color: var(--accent-premium-gold);
}

.divider {
    border-top: 1px solid var(--border-grey);
    margin: 1rem 0;
}