/* ==========================================
   whaleInvesotors UGANDA - MAIN STYLESHEET
   Comprehensive responsive design for all devices
   ========================================== */

/* ==========================================
   CSS RESET AND BASE STYLES
   ========================================== */

/* Remove default margins, padding, and set box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Remove tap highlight on iOS devices */
    -webkit-tap-highlight-color: transparent;
    /* Disable callout on iOS */
    -webkit-touch-callout: none;
}

/* ==========================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ========================================== */

:root {
    /* Primary brand colors */
    --primary-color: #4CAF50;      /* Green - main brand color */
    --secondary-color: #2196F3;    /* Blue - secondary actions */
    --danger-color: #f44336;       /* Red - errors, rejections */
    --warning-color: #ff9800;      /* Orange - warnings */
    --success-color: #4CAF50;      /* Green - success states */

    /* Neutral colors */
    --dark-color: #333;            /* Dark text */
    --light-color: #f4f4f4;         /* Light backgrounds */
    --white: #fff;                 /* Pure white */

    /* Layout dimensions */
    --sidebar-width: 250px;        /* Sidebar width for dashboards */

    /* Spacing and sizing */
    --border-radius: 8px;          /* Standard border radius */
    --shadow: 0 2px 10px rgba(0,0,0,0.1);  /* Standard box shadow */
    --transition: all 0.3s ease;   /* Standard transition timing */
}

/* ==========================================
   BASE HTML ELEMENT STYLES
   ========================================== */

html {
    /* Base font size for rem calculations */
    font-size: 16px;
    /* Enable smooth scrolling */
    scroll-behavior: smooth;
}

body {
    /* System font stack for cross-platform compatibility */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    /* Optimal line height for readability */
    line-height: 1.6;
    /* Default text color */
    color: var(--dark-color);
    /* Gradient background for visual appeal */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* Ensure full height coverage */
    min-height: 100vh;
    /* Optimize font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Optimize text rendering */
    text-rendering: optimizeLegibility;
    /* Smooth entrance animation for all pages */
    animation: fadeInUp 0.6s ease-out;
}

/* ==========================================
   LAYOUT CONTAINERS
   ========================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   NAVIGATION STYLES
   ========================================== */

.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    /* Backdrop blur for modern browsers */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    flex-shrink: 0;
}

.logo img {
    width: clamp(34px, 4vw, 44px);
    height: clamp(34px, 4vw, 44px);
    object-fit: cover;
    border-radius: 50px;
    display: block;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.nav-links a:hover {
    color: var(--primary-color);
    background: rgba(76, 175, 80, 0.1);
}

.nav-links .btn {
    margin-left: 1rem;
}

/* ==========================================
   MOBILE HAMBURGER MENU
   ========================================== */

.hamburger {
    /* Hidden by default, shown on mobile via media queries */
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 0.4rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    background: transparent;
    border: none;
}

.hamburger:hover {
    background: rgba(0,0,0,0.05);
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    border-radius: 2px;
    transition: var(--transition);
    transform-origin: center;
}

/* Hamburger animation states */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ==========================================
   BUTTON STYLES
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    /* iOS touch target minimum size */
    min-height: 44px;
    min-width: 44px;
    box-sizing: border-box;
    /* Remove iOS button styling */
    -webkit-appearance: none;
    appearance: none;
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-secondary:hover:not(:disabled) {
    background: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    min-height: 36px;
    min-width: 36px;
}

/* ==========================================
   FORM STYLES
   ========================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-family: inherit;
    transition: var(--transition);
    box-sizing: border-box;
    background: var(--white);
    /* Prevent zoom on iOS when focusing inputs */
    font-size: 16px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group input:invalid,
.form-group select:invalid,
.form-group textarea:invalid {
    border-color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 16px; /* Prevents zoom on iOS */
    font-family: inherit;
    transition: var(--transition);
    box-sizing: border-box;
    background: var(--white);
}

/* ==========================================
   CARD COMPONENT STYLES
   ========================================== */

.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ==========================================
   DASHBOARD LAYOUT STYLES
   ========================================== */

.dashboard {
    display: flex;
    min-height: 100vh;
    padding-top: 60px; /* Account for fixed navbar */
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    position: fixed;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    color: var(--dark-color);
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--primary-color);
    color: var(--white);
}

.sidebar-menu i {
    margin-right: 10px;
    width: 20px;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    background: #f5f5f5;
}

/* ==========================================
   STATISTICS CARDS STYLES
   ========================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--dark-color);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* ==========================================
   TABLE STYLES
   ========================================== */

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
}

th {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    text-align: left;
    font-weight: 500;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

tr:hover {
    background: #f9f9f9;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #cce5ff;
    color: #004085;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Investment Plans */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.plan-card {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.plan-card:hover {
    transform: translateY(-5px);
}

.plan-card.featured {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
}

.plan-name {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.plan-price span {
    font-size: 1rem;
    color: #666;
}

.plan-features {
    list-style: none;
    margin: 2rem 0;
}

.plan-features li {
    margin-bottom: 0.8rem;
}

.plan-features i {
    color: var(--primary-color);
    margin-right: 10px;
}

/* Hero / Landing */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(1.5rem, 5vw, 3rem);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: 2rem;
    max-width: 560px;
}

.hero-cta {
    padding: 0.8rem 1.5rem;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    display: inline-block;
}

.hero-img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
    max-height: 500px;
}

@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-img {
        max-height: 320px;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
}

/* ==========================================
   ALERT STYLES
   ========================================== */

.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* ==========================================
   RESPONSIVE DESIGN - COMPREHENSIVE CROSS-DEVICE SUPPORT
   ========================================== */

/* Large Desktop (1440px and above) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .hero-grid {
        gap: 4rem;
    }

    .plans-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* Desktop (1024px to 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .container {
        padding: 0 20px;
    }

    .plans-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Small Desktop/Large Tablet (769px to 1023px) */
@media (min-width: 769px) and (max-width: 1023px) {
    .container {
        padding: 0 15px;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .nav-links a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .plan-card.featured {
        transform: scale(1.05);
    }

    .sidebar {
        width: 220px;
    }

    .main-content {
        margin-left: 220px;
    }
}

/* Tablet (601px to 768px) */
@media (min-width: 601px) and (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    /* Navigation */
    .logo {
        font-size: 1.3rem;
    }

    /* Mobile hamburger menu: hide links until toggled */
    .hamburger {
        display: flex;
        gap: 0.3rem;
    }

    .hamburger span {
        width: 22px;
        height: 2.5px;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        padding: 1rem;
        flex-direction: column;
        justify-content: center;
        gap: 0.5rem;
        background: white;
        z-index: 1001;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
        width: 100%;
        border-radius: var(--border-radius);
    }

    /* Ensure sidebar is hidden by default on mobile and only shown when active */
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        width: 250px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 1000;
        background: var(--white);
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        left: 0;
    }

    /* Hero Section */
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-img {
        max-height: 300px;
    }

    /* Dashboard Layout */
    .dashboard {
        padding-top: 60px;
    }

    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        width: 250px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 1000;
        background: var(--white);
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-menu a span {
        display: inline;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    /* Stats and Plans */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .plan-card {
        padding: 1.5rem;
    }

    /* Tables */
    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.8rem 0.5rem;
    }
}

/* Large Mobile (481px to 600px) */
@media (min-width: 481px) and (max-width: 600px) {
    .container {
        padding: 0 10px;
    }

    /* Typography */
    h1 {
        font-size: 1.8rem !important;
    }

    h2 {
        font-size: 1.4rem !important;
    }

    h3 {
        font-size: 1.2rem !important;
    }

    /* Navigation */
    .navbar {
        padding: 0.8rem 0;
    }

    .logo {
        font-size: 1.2rem;
    }

    /* Mobile hamburger menu overlay */
    .hamburger {
        display: flex;
        gap: 0.3rem;
    }

    .hamburger span {
        width: 20px;
        height: 2.5px;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        padding: 1rem;
        gap: 0.5rem;
        flex-direction: column;
        justify-content: center;
        background: white;
        z-index: 1001;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    /* Hero */
    .hero {
        padding: 60px 0 !important;
    }

    .hero-content h1 {
        font-size: 1.6rem;
    }

    .hero-img {
        max-height: 250px;
    }

    /* Dashboard */
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        width: 240px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 1000;
        background: var(--white);
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-menu a {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    .main-content {
        padding: 1rem;
    }

    /* Cards and Grids */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .plans-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .plan-card {
        padding: 1.5rem;
        text-align: center;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    /* Forms */
    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-control {
        font-size: 16px;
        padding: 1rem;
    }

    /* Buttons */
    .btn {
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Tables */
    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.7rem 0.4rem;
    }

    /* Modal */
    .modal-content {
        margin: 10px;
        max-width: none;
        width: calc(100vw - 20px);
    }
}

/* Small Mobile (361px to 480px) */
@media (min-width: 361px) and (max-width: 480px) {
    .container {
        padding: 0 8px;
    }

    /* Typography */
    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.2rem !important;
    }

    h3 {
        font-size: 1.1rem !important;
    }

    /* Navigation */
    .navbar {
        padding: 0.7rem 0;
    }

    .logo {
        font-size: 1.1rem;
    }

    /* Mobile hamburger menu overlay */
    .hamburger {
        display: flex;
        gap: 0.3rem;
    }

    .hamburger span {
        width: 20px;
        height: 2px;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        padding: 0.8rem;
        gap: 0.5rem;
        flex-direction: column;
        justify-content: center;
        background: white;
        z-index: 1001;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 0.7rem;
        font-size: 0.85rem;
    }

    /* Hero */
    .hero {
        padding: 50px 0 !important;
    }

    .hero-content h1 {
        font-size: 1.4rem;
    }

    .hero-content p {
        font-size: 0.95rem;
    }

    .hero-img {
        max-height: 200px;
    }

    /* Dashboard */
    .sidebar {
        width: 100vw;
    }

    .sidebar-menu a {
        padding: 1rem;
        font-size: 1rem;
    }

    .main-content {
        padding: 0.8rem;
    }

    /* Cards */
    .card {
        padding: 1rem;
        margin-bottom: 0.8rem;
    }

    .stats-grid,
    .plans-grid {
        gap: 0.8rem;
    }

    .plan-card {
        padding: 1.2rem;
    }

    .plan-price {
        font-size: 1.3rem;
    }

    /* Forms */
    .form-group {
        margin-bottom: 1.2rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-control {
        padding: 0.9rem;
    }

    /* Buttons */
    .btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .btn-sm {
        padding: 0.6rem 1rem;
        min-height: 40px;
    }

    /* Tables */
    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.6rem 0.3rem;
    }

    /* Modal */
    .modal-content {
        margin: 5px;
        padding: 1.5rem;
        width: calc(100vw - 10px);
    }
}

/* Extra Small Mobile (320px to 360px) */
@media (max-width: 360px) {
    .container {
        padding: 0 6px;
    }

    /* Base font size adjustment for very small screens */
    html {
        font-size: 14px;
    }

    /* Typography */
    h1 {
        font-size: 1.3rem !important;
    }

    h2 {
        font-size: 1.1rem !important;
    }

    h3 {
        font-size: 1rem !important;
    }

    /* Navigation */
    .navbar {
        padding: 0.6rem 0;
    }

    .logo {
        font-size: 1rem;
    }

    /* Mobile hamburger menu overlay */
    .hamburger {
        display: flex;
        padding: 0.4rem;
        gap: 0.3rem;
    }

    .hamburger span {
        width: 18px;
        height: 2px;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        padding: 0.6rem;
        gap: 0.5rem;
        flex-direction: column;
        justify-content: center;
        background: white;
        z-index: 1001;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 0.6rem;
        font-size: 0.8rem;
    }

    /* Hero */
    .hero {
        padding: 40px 0 !important;
    }

    .hero-content h1 {
        font-size: 1.2rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    .hero-cta {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

    .hero-img {
        max-height: 180px;
    }

    /* Dashboard */
    .sidebar {
        position: fixed;
        left: -100vw;
        top: 0;
        width: 100vw;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 1000;
        background: var(--white);
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-menu a {
        padding: 0.9rem 0.8rem;
        font-size: 0.95rem;
    }

    .main-content {
        padding: 0.6rem;
    }

    /* Cards */
    .card {
        padding: 0.9rem;
        border-radius: 6px;
    }

    .stats-grid,
    .plans-grid {
        gap: 0.6rem;
    }

    .plan-card {
        padding: 1rem;
    }

    .plan-price {
        font-size: 1.2rem;
    }

    .stat-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    /* Forms */
    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-control {
        padding: 0.8rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Buttons */
    .btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .btn-sm {
        padding: 0.5rem 0.8rem;
        min-height: 36px;
    }

    /* Tables - make scrollable on very small screens */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.75rem;
        min-width: 600px; /* Force horizontal scroll */
    }

    th, td {
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
    }

    /* Modal */
    .modal-content {
        margin: 5px;
        padding: 1.2rem;
        width: calc(100vw - 10px);
        max-height: calc(100vh - 10px);
    }

    .modal-header {
        margin-bottom: 1rem;
    }

    .close {
        font-size: 1.2rem;
        padding: 0.5rem;
    }
}

/* ==========================================
   LANDSCAPE ORIENTATION ADJUSTMENTS
   ========================================== */

@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 30px 0 !important;
    }

    .hero-content h1 {
        font-size: 1.2rem;
    }

    .hero-img {
        max-height: 150px;
    }

    .sidebar {
        width: 200px;
    }

    .main-content {
        padding: 0.8rem;
    }
}

/* ==========================================
   HIGH DPI DISPLAYS OPTIMIZATION
   ========================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    .navbar,
    .hamburger,
    .sidebar-toggle,
    .btn {
        display: none !important;
    }

    .sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.p-2 {
    padding: 2rem;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   MOBILE MONEY ICON COLORS
   ========================================== */

.mtn-color {
    color: #ffcc00; /* MTN Yellow */
}

.airtel-color {
    color: #ed1c24; /* Airtel Red */
}

/* Added for fully wired dynamic admin and user pages */
.sidebar-toggle {
  display: none;
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0.8rem;
  cursor: pointer;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  font-size: 1.2rem;
}
.sidebar-overlay {
    display: none;
}
.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.summary-card,
.total-calculator {
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  margin-bottom: 1.5rem;
}
.summary-grid,
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.summary-item,
.calc-item {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
}
.summary-value,
.calc-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-color);
}
.summary-label,
.calc-label {
  color: #64748b;
  font-size: 0.9rem;
  margin-top: 0.3rem;
}
.search-container {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.search-input,
.filter-select {
  padding: 0.8rem 0.95rem;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  min-width: 190px;
  background: #fff;
}
.search-input { flex: 1 1 260px; }
.table-container { overflow-x: auto; }
.table-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.action-btn {
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
}
.btn-view { background: #e0f2fe; color: #0369a1; }
.btn-approve { background: #dcfce7; color: #166534; }
.btn-reject { background: #fee2e2; color: #991b1b; }
.btn-process { background: #ede9fe; color: #6d28d9; }
.btn-complete { background: #d1fae5; color: #065f46; }
.period-selector { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.period-btn {
  border: 1px solid #dbe2ea;
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}
.period-btn.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.info-list { display: grid; gap: 0.85rem; }
.info-item {
  padding: 0.9rem 1rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.flex-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.5rem; }
.flex-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.5rem; }
.inline-balance {
  background: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 0.9rem;
}
.plan-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.profile-avatar {
  width: 42px;
  height: 42px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.mtn-color { color: #f59e0b; }
.airtel-color { color: #dc2626; }
.bank-color { color: #2563eb; }
.card-muted { color: #64748b; font-size: 0.92rem; }
.copy-field { width: 100%; padding: 0.8rem; border: 1px solid #ddd; border-radius: 5px; font-size: 0.9rem; }
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
        top: 10px;
        left: 10px;
        z-index: 1101;
    }

    .dashboard {
        padding-top: 0;
    }

    .dashboard .sidebar {
        left: 0;
        top: 0;
        width: min(82vw, 280px);
        height: 100vh;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        z-index: 1100;
    }

    .dashboard .sidebar.active,
    .dashboard .sidebar.visible {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        border: 0;
        padding: 0;
        margin: 0;
        background: rgba(0, 0, 0, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
        z-index: 1090;
    }

    .sidebar-overlay.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .dashboard .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

  .flex-grid-2,
  .flex-grid-3 { grid-template-columns: 1fr; }
}

/* Final mobile nav override: keep hamburger toggle deterministic on pages using #hamburger/#navLinks */
@media (max-width: 768px) {
    .navbar .container {
        position: relative;
    }

    .hamburger {
        display: flex;
        position: relative;
        z-index: 1202;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        left: 12px;
        right: 12px;
        width: auto;
        height: auto;
        max-height: calc(100vh - 90px);
        overflow-y: auto;
        padding: 0.9rem;
        margin: 0;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
        z-index: 1201;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a,
    .nav-links .btn {
        width: 100%;
        margin-left: 0;
    }
}


.btn-fail {
  background: var(--danger-color);
  color: white;
}

/* Home page plans: keep 3 cards evenly spaced on desktop */
.home-plans-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.home-plans-grid .plan-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.home-plans-grid .plan-features {
    flex: 1;
}

.home-plans-grid .btn {
    margin-top: auto;
}

/* User/Admin dashboard sidebars: hidden by default, toggle with hamburger */
.collapsible-dashboard {
    padding-top: 0;
}

.collapsible-dashboard .sidebar-toggle {
    display: block;
    top: 10px;
    left: 10px;
    z-index: 1201;
}

.collapsible-dashboard .sidebar {
    left: 0;
    top: 0;
    width: min(82vw, 280px);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    z-index: 1200;
}

.collapsible-dashboard .sidebar.active,
.collapsible-dashboard .sidebar.visible {
    transform: translateX(0);
}

.sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    z-index: 1190;
}

.sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.collapsible-dashboard .main-content {
    margin-left: 0;
    width: 100%;
}

body.sidebar-open {
    overflow: hidden;
}

@media (max-width: 1023px) {
    .home-plans-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .home-plans-grid {
        grid-template-columns: 1fr;
    }
}
