/* ==========================================================================
   RWB+ App-like UI — Mobile-First / PWA style design system
   Shared across index.php and every included page (about/contact/market/...)
   ========================================================================== */

:root {
    --app-primary: #176507;
    --app-primary-light: #6db86b;
    --app-gradient: linear-gradient(135deg, #6db86b 0%, #176507 100%);
    --app-radius-sm: 0.75rem;
    --app-radius: 1.25rem;
    --app-radius-lg: 1.75rem;
    --app-shadow: 0 8px 24px rgba(23, 101, 7, 0.10);
    --app-shadow-lg: 0 16px 40px rgba(23, 101, 7, 0.16);
    --bottom-nav-height: 98px;
}

/* Extra corner-radius utilities (Bootstrap 5.0 only ships up to .rounded-3) */
.rounded-4 { border-radius: var(--app-radius) !important; }
.rounded-5 { border-radius: var(--app-radius-lg) !important; }

/* ---- App Card ---- */
.app-card {
    background: #fff;
    border: none;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--app-shadow-lg);
}

.app-card-header {
    background: var(--app-gradient);
    color: #fff;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.app-card-body {
    padding: 1.5rem;
}

/* ---- Section wrapper: gives every page the same mobile-first gutters ---- */
.app-section {
    padding: 1.75rem 0;
}

/* ---- App-style gradient hero (reusable on sub-pages) ---- */
.app-hero {
    background: var(--app-gradient);
    border-radius: 0 0 var(--app-radius-lg) var(--app-radius-lg);
    color: #fff;
    padding: 1.75rem 1.25rem 2.25rem;
    box-shadow: var(--app-shadow-lg);
}

/* ---- Buttons feel more "tappable" / app-like ---- */
.btn {
    border-radius: 50px;
}

.btn-square,
.back-to-top {
    border-radius: var(--app-radius-sm);
}

/* ---- Bottom Navigation Bar (mobile / PWA style) ---- */
.bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    height: var(--bottom-nav-height);
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
}

.bottom-nav .bottom-nav-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: var(--bottom-nav-height);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #8a8f98;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.2s ease, transform 0.2s ease;
}

.bottom-nav-item i {
    font-size: 1.95rem;
    line-height: 1;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--app-primary);
    transform: translateY(-2px);
}

.bottom-nav-item.nav-cta {
    color: #fff;
}

.bottom-nav-item.nav-cta .bottom-nav-cta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-top: -38px;
    border-radius: 50%;
    background: var(--app-gradient);
    box-shadow: var(--app-shadow-lg);
    color: #fff;
}

.bottom-nav-item.nav-cta .bottom-nav-cta-icon i {
    font-size: 1.8rem;
}

.bottom-nav-item.nav-cta.active,
.bottom-nav-item.nav-cta:hover {
    color: var(--app-primary);
}

@media (max-width: 991.98px) {
    .bottom-nav {
        display: block;
    }

    body {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0));
    }

    .back-to-top {
        bottom: calc(var(--bottom-nav-height) + 16px) !important;
    }
}

/* ---- Dashboard stat tiles (soft pastel KPI cards) ---- */
.stat-tile {
    display: block;
    border-radius: 1.5rem;
    padding: 1.5rem 1.6rem;
    color: #fff;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 150px;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

a.stat-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
    color: #fff;
}

.stat-tile::before {
    content: '';
    position: absolute;
    right: -35px;
    bottom: -45px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.stat-tile::after {
    content: '';
    position: absolute;
    right: 20px;
    bottom: -55px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.stat-tile .stat-tile-icon {
    position: absolute;
    top: 1.4rem;
    right: 1.4rem;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    z-index: 1;
}

.stat-tile .stat-tile-label {
    font-size: 0.92rem;
    font-weight: 600;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    margin-bottom: 1.1rem;
    padding-right: 3rem;
}

.stat-tile .stat-tile-value {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.15;
    position: relative;
    z-index: 1;
    word-break: break-word;
}

.stat-tile .stat-tile-caption {
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.85;
    position: relative;
    z-index: 1;
    margin-top: 0.6rem;
}

.stat-tile.tile-success { background: linear-gradient(135deg, #6ee7b7 0%, #10b981 100%); }
.stat-tile.tile-warning { background: linear-gradient(135deg, #fdba74 0%, #f97316 100%); }
.stat-tile.tile-primary { background: linear-gradient(135deg, #93c5fd 0%, #3b82f6 100%); }
.stat-tile.tile-danger  { background: linear-gradient(135deg, #fda4af 0%, #f43f5e 100%); }
.stat-tile.tile-info    { background: linear-gradient(135deg, #67e8f9 0%, #0891b2 100%); }
.stat-tile.tile-purple  { background: linear-gradient(135deg, #c4b5fd 0%, #8b5cf6 100%); }

/* ---- Dashboard section card (chart / list containers) : plain, minimal ---- */
.dash-card {
    border: none;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    background: #fff;
    height: 100%;
}

.dash-card-header {
    padding: 1.5rem 1.5rem 0.5rem;
    color: #1e293b;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.dash-card-header i {
    color: #8b5cf6;
    margin-right: 0.5rem;
}

.dash-card-body {
    padding: 1.5rem;
}

/* ---- Custom chart legend (replaces Chart.js built-in legend) ---- */
.dash-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.dash-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
}

.dash-legend-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dash-progress-row {
    margin-bottom: 1rem;
}

.dash-progress-row .progress {
    border-radius: 50px;
    height: 28px;
    background: rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.dash-progress-row .progress-bar {
    border-radius: 50px;
    font-weight: 700;
}
