html, body {
    -webkit-overflow-scrolling: touch;
    height: 100%;
    overflow-x: hidden;
}
body {
  padding-top: env(safe-area-inset-top);
}
* { margin:0; padding:0; box-sizing:border-box; font-family:'Inter',sans-serif; }
body { background: linear-gradient(180deg, #f0f2f5 0%, #e6e9ef 100%);
       color: #333; }

/* Container */
.container { display:flex; min-height:auto; max-width:1200px; margin:auto; }

/* Sidebar */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0F2747 0%, #163B63 100%);
    color: #ffffff;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 4px 0 18px rgba(0,0,0,0.12);
    position: relative;
    overflow: hidden;
}

/* Subtle background effect */
.sidebar::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    top: -60px;
    right: -60px;
}


/* Logo Area */
.sidebar .logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.sidebar .logo img {
    height: 85px;
    width: auto;
    border-radius: 14px;
    background: #ffffff;
    padding: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}


/* Navigation Buttons */
.sidebar button {
    position: relative;
    background: transparent;
    border: 1px solid transparent;
    color: #dbeafe;
    text-align: left;
    padding: 13px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s ease;
    z-index: 1;
}


/* Hover Effect */
.sidebar button:hover {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    transform: translateX(5px);
    border-color: rgba(255,255,255,0.15);
}


/* Active Menu */
.sidebar button.active {
    background: linear-gradient(135deg,#F97316,#EA580C);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(234,88,12,0.35);
}


/* Active Left Indicator */
.sidebar button.active::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 10px;
    height: 32px;
    width: 4px;
    background: #FB923C;
    border-radius: 0 5px 5px 0;
}


/* Icon Styling */
.sidebar button svg,
.sidebar button i {
    font-size: 18px;
    opacity: 0.9;
}


/* Bottom Profile / Footer Area */
.sidebar .footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.15);
    color: #cbd5e1;
    font-size: 13px;
}

/* Main */
.main { flex:1; padding:20px; display:flex; flex-direction:column; gap:20px; }

/* Header / Welcome */
.header { display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; gap:10px; }
.header-left { display:flex; align-items:flex-start; gap:10px; }
.header-left img { height:80px; width:auto; border-radius:8px; display:none; } 
.header-left h1 { font-size:20px; margin-right:15px; }
.header-left p { font-size:13px; color:#555; margin-top:2px; }
.user-menu { position:relative; cursor:pointer; }
.user-menu span { font-weight:500; }
.user-dropdown { display:none; position:absolute; top:100%; right:0; background:#fff; color:#333; box-shadow:0 2px 8px rgba(0,0,0,0.15); border-radius:8px; overflow:hidden; }
.user-dropdown a { display:block; padding:10px 15px; font-size:14px; color:#333; text-decoration:none; }
.user-dropdown a:hover { background:#f0f0f0; }


/* Welcome fixed at top only */
.welcome-msg-fixed {
     position: static;           /* desktop: normal flow    */
    top: 50px;                  /* sticks at the top       */
    background: #f0f2f5;     /* same as page background */
    z-index: 999;             /* above everything else   */
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
}

.welcome-msg-fixed h1 { font-size:22px; margin:0; }
.welcome-msg-fixed p { font-size:14px; color:#555; margin:2px 0 0 0; }

/* Hide by default (desktop) */
.mobile-user-name {
    display: none;
}

.page-location-desktop{
    display:flex;
    align-items:center;
    gap:8px;
    margin-left:20px;
    color:#6b7280;
    font-size:14px;
    font-weight:500;
}

.page-location-desktop i{
    color:#ff6f00;
    font-size:12px;
}

.page-location{
    display:flex;
    align-items:center;
    gap:8px;
    
    margin-left:20px;
    color:#022366;
    font-size:12px;
    font-weight:500;
    
}

.page-location i{
    color:#EA580C;
    font-size:12px;
}

.mobile-user-name small{
    display:block;
    color:#6b7280;
    font-size:12px;
    margin-top:2px;
}

 

/* ===================================
   STYLE STATS
=================================== */

.stat-box{
    position:relative;
    flex:1;
    min-width:100px;

    background:#fff;
    border-radius:16px;
    padding:20px;

    border:1px solid #e5e7eb;

    box-shadow:0 2px 10px rgba(0,0,0,.05);

    transition:all .3s ease;
    overflow:hidden;
    cursor:pointer;
}

.stat-box::before{
    content:'';
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:4px;
}

/* Individual Colors */

.stat-box:nth-child(1)::before{
    background:#2563eb;   /* Total Active - Blue */
}

.stat-box:nth-child(2)::before{
    background:#0ea5e9;   /* This Month Renewal - Sky Blue */
}

.stat-box:nth-child(3)::before{
    background:#f59e0b;   /* Next 30 Days - Amber */
}

.stat-box:nth-child(4)::before{
    background:#dc2626;   /* Expired Policies - Red */
}

.stat-box:nth-child(5)::before{
    background:#16a34a;   /* Premium Due - Green */
}

.stat-box:nth-child(6)::before{
    background:#6366f1;   /* Motor Renewal - Indigo */
}

.stat-box:nth-child(7)::before{
    background:#ec4899;   /* Health Renewal - Pink */
}

.stat-box:nth-child(8)::before{
    background:#7c3aed;   /* Life Renewal - Violet */
}

.stat-box:nth-child(9)::before{
    background:#64748b;   /* Other Renewal - Slate */
}

/* Icon */

.stat-box i{
    width:52px;
    height:52px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:14px;

    background:#EDF4FF;
    color:#1F4E79;

    font-size:22px;

    box-shadow:0 8px 18px rgba(31,78,121,.12);

    transition:all .3s ease;
}

.stat-box:hover i{
    background:#1F4E79;
    color:#fff;
    transform:scale(1.08) rotate(5deg);
}



/* ===================================
CARDS
=================================== */

.dashboard-cards{
    display:flex;
    gap:10px;

    
    padding: 5px 12px;
    background:#f0f2f5;

    border-bottom:1px solid #ddd;
}

/* Card */

.dashboard-cards .stat-box{
    flex:1;

    min-height:80px;

    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;

    padding:12px;

   background: #ffffff;

    border:1px solid #e5e7eb;
    border-radius:12px;

    box-shadow:0 2px 8px rgba(0,0,0,.05);

    transition:all .3s ease;

    cursor:pointer;
}

/* Hover */

.dashboard-cards .stat-box:hover{
   background: linear-gradient(135deg, #163A5F, #1F4E79);
    border-color:#EA580C;

    transform:translateY(-4px);

    box-shadow:0 10px 25px rgba(255,153,0,.25);
}

/* Icon */

.dashboard-cards .stat-box i{
    font-size:20px;
    color:#1F4E79;

    margin-bottom:5px;

    transition:all .3s ease;
}

/* Number */

.dashboard-cards .stat-box h2{
    font-size:20px;
    font-weight:600;

    color:#EA580C;

    margin:0;

    transition:all .3s ease;
}

/* Label */

.dashboard-cards .stat-box p{
    font-size:12px;
    font-weight:400;

    color:#1F4E79;

    margin:2px 0 0;

    transition:all .3s ease;
}

/* Hover Text */

.dashboard-cards .stat-box:hover i,
.dashboard-cards .stat-box:hover h2,
.dashboard-cards .stat-box:hover p{
    color:#fff;
}

/* ===================================
   FLOATING STATS
=================================== */

.floating-stats{
    display:flex;
    gap:10px;

   

    padding:10px;
    background:#f0f2f5;

    border-bottom:1px solid #ddd;
}

/* Card */

.floating-stats .stat-box{
    flex:1;

    min-height:80px;

    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;

    padding:12px;

   background: #ffffff;

    border:1px solid #e5e7eb;
    border-radius:12px;

    box-shadow:0 2px 8px rgba(0,0,0,.05);

    transition:all .3s ease;

    cursor:pointer;
}

/* Hover */

.floating-stats .stat-box:hover{
   background: linear-gradient(135deg, #163A5F, #1F4E79);
    border-color:#EA580C;

    transform:translateY(-4px);

    box-shadow:0 10px 25px rgba(255,153,0,.25);
}

/* Icon */

.floating-stats .stat-box i{
    font-size:20px;
    color:#23354d;

    margin-bottom:5px;

    transition:all .3s ease;
}

/* Number */

.floating-stats .stat-box h2{
    font-size:20px;
    font-weight:600;

    color:#EA580C;

    margin:0;

    transition:all .3s ease;
}

/* Label */

.floating-stats .stat-box p{
    font-size:12px;
    font-weight:400;

    color:#64748b;

    margin:2px 0 0;

    transition:all .3s ease;
}

/* Hover Text */

.floating-stats .stat-box:hover i,
.floating-stats .stat-box:hover h2,
.floating-stats .stat-box:hover p{
    color:#fff;
}

.trend{
    display:inline-flex;
    align-items:center;
    gap:5px;

    font-size:12px;
    font-weight:600;

    padding:4px 10px;
    border-radius:20px;
}

.stat-box .trend i{
    width:auto;
    height:auto;
    display:inline-block;
    border-radius:0;
    font-size:11px;
    background:none;
    color:inherit;
    box-shadow:none;
    margin:0;
}

.trend.profit{
    background:#e5f6b3;
    color:#16A34A;
}

.trend.loss{
    background:#FEE2E2;
    color:#DC2626;
}
/* ==========================
   Responsive Stats Cards
========================== */

@media (max-width:768px){

    .dashboard-cards{
        display:flex;
        margin-top: -25px;
        flex-wrap:wrap;
        gap:8px;
        padding:8px;
    }

    .dashboard-cards .stat-box{
        flex:0 0 calc(33.333% - 6px);
        min-height:70px;
        min-width:0;
        padding:10px;
        border-radius:12px;
    }

    .dashboard-cards .stat-box i{
        width:36px;
        height:36px;
        font-size:18px;
        margin-bottom:8px;
    }

    .dashboard-cards .stat-box h2{
        font-size:18px;
        line-height:1.1;
        margin:0;
    }

    .dashboard-cards .stat-box p{
        font-size:11px;
        line-height:1.2;
        font-weight:500;
        text-align:center;
        margin-top:4px;
        white-space:normal;
    }

    /*Floating-stats*/
     .floating-stats{
        display:flex;
        flex-wrap:wrap;
        gap:8px;
        padding:8px;
    }

    .floating-stats .stat-box{
        flex:0 0 calc(33.333% - 6px);
        min-height:70px;
        min-width:0;
        padding:10px;
        border-radius:12px;
    }

    .floating-stats .stat-box i{
        width:36px;
        height:36px;
        font-size:18px;
        margin-bottom:8px;
    }

    .floating-stats .stat-box h2{
        font-size:18px;
        line-height:1.1;
        margin:0;
    }

    .floating-stats .stat-box p{
        font-size:12px;
        line-height:1.2;
        font-weight:500;
        text-align:center;
        margin-top:4px;
        white-space:normal;
    }

    .stat-box .trend i{
    width:auto;
    height:auto;
    display:inline-block;
    border-radius:0;
    font-size:11px;
    background:none;
    color:inherit;
    box-shadow:none;
    margin:0;
}
  .trend{
        font-size:10px;
        padding:3px 7px;
        gap:3px;
    }

    .stat-box .trend i{
        font-size:9px;
    }
 
   .page-location-desktop{
        display:none;
    } 
}


/* Small Phones */

@media (max-width:480px){

    .dashboard-cards{
        gap:6px;
        margin-top: -25px;
        padding:6px;
    }

    .dashboard-cards .stat-box{
        flex:0 0 calc(33.333% - 4px);
        min-height:65px;
        padding:8px;
    }

    .dashboard-cards .stat-box i{
        width:32px;
        height:32px;
        font-size:16px;
    }

    .dashboard-cards .stat-box h2{
        font-size:16px;
    }

    .dashboard-cards .stat-box p{
        font-size:12px;
    }

    /*  floating-stats */

    .floating-stats{
        gap:6px;
        padding:6px;
    }

    .floating-stats .stat-box{
        flex:0 0 calc(33.333% - 4px);
        min-height:65px;
        padding:8px;
    }

    .floating-stats .stat-box i{
        width:32px;
        height:32px;
        font-size:16px;
    }

    .floating-stats .stat-box h2{
        font-size:16px;
    }

    .floating-stats .stat-box p{
        font-size:10px;
    }

.stat-box .trend i{
    width:auto;
    height:auto;
    display:inline-block;
    border-radius:0;
    font-size:11px;
    background:none;
    color:inherit;
    box-shadow:none;
    margin:0;
}
  .trend{
        font-size:10px;
        padding:3px 7px;
        gap:3px;
    }

    .stat-box .trend i{
        font-size:9px;
    }
    .page-location-desktop{
        display:none;
    }

}


.new{    background:#dbeafe;    color:#1e40af;}
.contacted{    background:#fed7aa;    color:#9a3412;}
.pending{    background:#fef3c7;    color:#92400e;}
.closed{    background:#dcfce7;    color:#166534;}

/* Policy Status */
.active{    background:#dcfce7;    color:#166534;}
.expired{    background:#fee2e2;    color:#991b1b;}

/* Commissions Status */
.paid{    background:#dcfce7;  /* soft green */    color:#166534;}

/* ==========================
   Enterprise Table
========================== */

.table-section{

    background:#fff;

    border:1px solid #E5E7EB;

    border-radius:18px;

    padding:20px;

    box-shadow:0 8px 24px rgba(15,23,42,.06);

    overflow-x:auto;

}


/* Title */

.table-section h3{

    margin:0 0 18px;

    font-size:18px;

    font-weight:600;

    color:#1F4E79;

}


/* Table */

.table-section table{

    width:100%;

    min-width:700px;

    border-collapse:separate;

    border-spacing:0;

    font-family:'Poppins',sans-serif;

}


/* Header */

.table-section thead th{
 
    
    text-align:left;
    
    background:#F8FAFC;

    color:#475569;

    font-size:13px;

    font-weight:600;

    text-transform:uppercase;

    letter-spacing:.5px;

    padding:12px 14px;

    border-bottom:2px solid #E2E8F0;

    white-space:nowrap;

}


/* Body */

.table-section tbody td{

    padding:12px 14px;
    
    text-align:left;

    font-size:13px;

    font-weight:500;

    color:#334155;

    border-bottom:1px solid #EDF2F7;

    transition:.25s;

}


/* Rows */

.table-section tbody tr{

    transition:.25s;

}


/* Alternate Rows */

.table-section tbody tr:nth-child(even){

    background:#FAFBFC;

}


/* Hover */

.table-section tbody tr:hover{

    background:#EEF5FF;

}


/* Rounded Header */

.table-section thead th:first-child{

    border-top-left-radius:12px;

}

.table-section thead th:last-child{

    border-top-right-radius:12px;

}


/* Scrollbar */

.table-section::-webkit-scrollbar{

    height:8px;

}

.table-section::-webkit-scrollbar-thumb{

    background:#CBD5E1;

    border-radius:20px;

}

.table-section::-webkit-scrollbar-thumb:hover{

    background:#94A3B8;

}


/* Mobile */

@media(max-width:768px){

    .table-section{
       
         padding:12px;

    }

    .table-section h3{

        font-size:16px;

    }

    .table-section table{

        min-width:100%;

    }

.table-section td{
        white-space:normal;
    word-break:break-word;
    }
    .table-section th{padding:8px 10px;

        font-size:12px;

    }
    .table-section td{

        padding:8px 10px;

        font-size:12px;

    }
.page-location-desktop{
        display:none;
    }
}

.status{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:5px 12px;
    border-radius:30px;
    font-size:11px;
    font-weight:600;
}

.status.success{
    background:#DCFCE7;
    color:#15803D;
}

.status.pending{
    background:#FEF3C7;
    color:#B45309;
}

.status.cancelled{
    background:#FEE2E2;
    color:#B91C1C;
}

.status.info{
    background:#DBEAFE;
    color:#1D4ED8;
}
.fab { display:none; position:fixed; bottom:80px; right:15px; width:45px; height:45px; border-radius:50%; background:#EA580C; color:#fff; display:flex; align-items:center; justify-content:center; font-size:28px; cursor:pointer; box-shadow:0 4px 12px rgba(0,0,0,0.2); z-index:1000; }
.fab:hover { transform: translateY(-2px); }

/* Bottom Nav */
.bottom-nav { display:none; }
.bottom-nav button { background:none; border:none; font-size:12px; color:#555; cursor:pointer; 
                            display:flex; flex-direction:column; align-items:center; }
.bottom-nav i { font-size:20px; margin-bottom:2px; }
.bottom-nav .active{
    color:#EA580C;
}

/* Responsive */
@media(max-width:1024px){
 body{
        padding-bottom:80px;
    }
 .bottom-nav {
        display:flex;
        justify-content:space-around;
        background:#fff;
        padding:10px 0;
        border-top:1px solid #ddd;
        position:fixed;
        bottom:0;
        width:100%;
        z-index:100;
    }
    .container {
    display: block; /* mobile */
  }
    .sidebar { display:none; }
    .header-left img { display:block; } 
   
    .fab { display:flex; }
 
    .bottom-nav{
    position:fixed;
    display:flex;
    justify-content:space-around;
    align-items:center;
    background:rgba(255,255,255,0.85);
    backdrop-filter:blur(20px);
    -webkit-backdrop-filter:blur(20px);
    border:1px solid rgba(255,255,255,0.4);
    padding:10px 6px;
    box-shadow:
        0 8px 30px rgba(0,0,0,0.12),
        0 1px 2px rgba(255,255,255,0.8) inset;
    z-index:9999;
}

.bottom-nav button{
    flex:1;
    background:none;
    border:none;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    color: #030562;
    font-size:10px;
    font-weight:500;
    padding:6px 0;
    border-radius:14px;
    transition:all .25s ease;
}

.bottom-nav i{
    font-size:20px;
    margin-bottom:4px;
}

.bottom-nav button.active{
   font-size:12px;
     color: #EA580C;
   
}

.bottom-nav button:active{
    transform:scale(.95);
}

.page-location-desktop{
        display:none;
    }
}

@media(max-width:767px){
    .container {
    display: block; /* mobile */
  }
    .header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #f0f2f5;
    padding: 8px;
    border-bottom: 1px solid #750e0e;
    gap: 5px;
}

.header-left {
   display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
     
    
}

.header-left img {
    height: 50px;
    width: auto;
    border-radius: 8px;
}

.header-left div {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.header-left h1 {
      margin: 0 0 0 auto;   /* Pushes username to the right */
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    padding: 10px 12px;
}

.header-left p {
    font-size: 11px;
    margin: 0;
}

/* Username below the header */

.mobile-user-name {
    width: 100%;
    display: flex;
    margin-top: -15px;
    justify-content:flex-start;
    align-items:center;
    padding: 5px 12px;
    background: #f0f2f5;
    
}

.mobile-user-name h1 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
}
    .user-menu { display:none !important; }
    .welcome-msg-fixed {       position: static;    }
    .stats { flex-wrap:wrap; gap:10px; margin-top:10px; }
    .stat-box { flex:1 1 45%; padding:10px; font-size:12px; }
    .stat-box i { font-size:18px; }
    .stat-box h2 { font-size:16px; }
    .stat-box p { font-size:10px;   /* more readable */
        font-weight:400; }

    .table-section table { text-align:left;font-size:12px; min-width:100%; font-weight:500; }
    
    .table-section th { font-size:12px; padding:12px 10px; font-weight:500;   }
    .table-section td { font-size:11px;       font-weight: 500;
    color: #1F4E79;               /* Darker color for better contrast */
    -webkit-font-smoothing: antialiased;  /* For sharper text on iOS/Safari */
    -moz-osx-font-smoothing: grayscale;   /* For sharper text on Firefox/macOS */  }
    /* row touch feel */
    .table-section tr{        transition:0.2s;    }
    
    
    .page-location-desktop{
        display:none;
    }

.page-location{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    width:100%;
    margin:0;
    color:#022366;
    font-size:12px;
    font-weight:500;
}}

@media(max-width:480px){
    .container {
    display: block; /* mobile */
  }
    .stat-box { flex:1 1 100%; }
    .dashboard-cards .stat-box i { font-size:14px; }
    .dashboard-cards .stat-box h2 { font-size:12px; }
    .dashboard-cards .stat-box p { font-size:10px; font-weight:400;}
    .dashboard-cards { gap:3px; padding:3px 5px; }

    .floating-stats .stat-box i { font-size:14px; }
    .floating-stats .stat-box h2 { font-size:12px; }
    .floating-stats .stat-box p { font-size:10px; font-weight:400;}
    .floating-stats { gap:3px; padding:3px 5px; }

    .header-left h1 { font-size:12px; }
    .header-left p { font-size:10px; }
    .table-section table { font-size:10px;  line-height:1.5; font-weight:500;}
    .table-section th { padding:3px 5px; }
    .table-section td { padding:3px 5px; }
   /* Username bottom right */
.header-right{
position:absolute;
right:12px;
bottom:5px;
}
}