/* ==========================
   Global Styles
   ========================== */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f8; /* Page background */
}

.dashboard {
    display: flex; /* Sidebar + main content side by side */
    height: 100vh; /* Full height viewport */
}

/* ==========================
   Sidebar company logo & alignment
   ========================== */
.company-logo {
    width: 250px;       /* Bigger logo */
    height: auto;       /* Maintain aspect ratio */
    object-fit: contain;
    display: block;
    margin-top: -60px;
    margin-bottom: -75px;
    margin-left:-25px;
}


/* ==========================
   Sidebar Styles
   ========================== */
.sidebar {
    width: 200px; /* Sidebar width */
    background-color: #140222; /* Purple primary color */
    color: #fff;
    display: flex;
    flex-direction: column; /* Stack links vertically */
    padding: 20px;
}

/* Navigation links */
.sidebar a {
    text-decoration: none; /* Remove underline */
    color: #fff; /* White text */
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px; /* Rounded edges */
    transition: all 0.3s; /* Smooth hover/active transitions */
    font-size: 0.9rem; /* Slightly smaller font size */
    display: flex;
    align-items: center;
}

.sidebar a i {
    margin-right: 10px; /* Space between icon and text */
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* Hover effect on links */
.sidebar a:hover {
    background-color: #291a29; /* Slightly darker purple */
}

/* Active tab highlight */
.sidebar a.active {
    background: linear-gradient(to right, #50c878, #008080); /* Emerald to teal gradient */
    color: #fff;
}

/* ==========================
   Sidebar Divider Line
   ========================== */
.sidebar .divider {
    height: 1px;
    background-color: #f2f1f2; /* Slightly lighter/darker purple line */
    margin: 15px 0; /* Space above and below */
    border-radius: 2px;
}

/* ==========================
   Logout Button
   ========================== */
.sidebar .logout-btn {
    margin-top: auto; /* Push to bottom of sidebar */
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    background-color: #300830; /* Matches hover color */
    transition: background 0.3s, transform 0.2s;
}

.sidebar .logout-btn i {
    font-size: 1.1rem;
}

/* Hover effect for logout */
.sidebar .logout-btn:hover {
    background: rgb(13, 2, 25); /* Emerald to teal */
    transform: translateY(-2px);
}

/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/* ==========================
   Main Content Styles
   ========================== */
.main-content {
    flex: 1; /* Take remaining space */
    background-color: #fff; /* White background for content */
    padding: 30px;
    overflow-y: auto; /* Scroll if content overflows */
}

.main-header {
    margin-top: 20px;
    display: flex;
    justify-content: space-between; /* Left title/welcome, right date */
    align-items: flex-start;
    margin-bottom: 25px;
    flex-wrap: wrap; /* For responsiveness on smaller screens */
    margin-bottom:20px;
}

.main-header-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.main-header-left h1 {
    font-size: 2.7rem; /* Big title */
    font-weight: bold;
    color: #090a0c;
    margin: 0;
}

.main-header-left p {
    font-size: 1rem;
    font-weight: 480;
    color: #555;
    margin: 0;
}

/* Date / last updated on the right */
.main-header-right {
    font-size: 0.9rem;
    color: #777;
    white-space: nowrap; /* Prevent wrapping */
    margin-bottom:10px;
}

/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/* ==========================
   Top Stats Cards - Color Coded
   ========================== */
.top-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Base card style */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    border: 3px solid transparent; /* Base outline, will override per status */
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Hover lift */
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* Card title */
.card h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}

/* Card number */
.card p {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Small text */
.card small {
    color: #666;
    font-size: 0.85rem;
}

/* Card icons */
.card-icon {
    font-size: 2rem;
}


/* ==========================
   Status specific left stripe & icon colors
   ========================== */

/* Healthy Stock - Teal */
.card-teal { 
    border-left: 4px solid #029b9b;  /* True teal */
}
.card-teal .card-icon { color: #008080; }

/* Near Expiry - Green */
.card-green { 
    border-left: 4px solid #28a745; 
}
.card-green .card-icon { color: #28a745; }

/* Critical Expiry - Red */
.card-red { 
    border-left: 4px solid #dc3545; 
}
.card-red .card-icon { color: #dc3545; }

/* Damaged Stock - Blue */
.card-blue { 
    border-left: 4px solid #2196f3; 
}
.card-blue .card-icon { color: #2196f3; }

/* Expired Products - X Icon Red */
.card-expired { 
    border-left: 4px solid #ff0000; 
}
.card-expired .card-icon { color: #ff0000; }

.expired-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/* ==========================
   Table Styles
   ========================== */

.table-name{
    font-size: 1.9rem;
    font-weight: bold;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dddddd; /* Subtle row separation */
}

/* Table header background */
table th {
    background-color: #f0f0f0;
}

/* Status badges */
.status {
    padding: 5px 10px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.85rem;
    text-align: center;
}

/* Status colors */
.in-stock { background-color: #28a745; } /* Green */
.low-stock { background-color: #ffc107; color: #000; } /* Yellow */
.expiring { background-color: #dc3545; } /* Red */

/* ==========================
   Sidebar link icons
   ========================== */
.sidebar a i {
    margin-right: 10px; /* Space between icon and text */
    width: 20px; /* Optional: aligns icons uniformly */
    text-align: center;
}

/* Optional: Make icons slightly larger */
.sidebar a i {
    font-size: 1.1rem;
}

.expired-icon-small {
    width: 18px;
    height: 18px;
    margin-right: 5px;
    vertical-align: middle;
}

/* Status Dots (for Attention Table) */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

/* Colors */
.dot-teal { background: #008080; }
.dot-green { background: #50c878; }
.dot-red { background: #e74c3c; }
.dot-blue { background: #3498db; }
.dot-grey { background: #95a5a6; }



/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/* ==========================
   New Search Block
   ========================== */
.inventory-search-module {
    margin-bottom: 30px;
}

/* Rounded block container */
.search-block {
    background-color: #140222; /* Match navbar color */
    border-radius: 20px;
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-left:-10px;
}

/* Search block title */
.search-block h2 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: bold; /* Extra bold */
    color: #fff;
}

/* Search input container with icons */
.search-input-container {
    display: flex;
    align-items: center;
    background-color: #291a29; /* Slightly lighter than navbar for input */
    border-radius: 15px;
    padding: 10px 15px;
    gap: 10px;
}

/* Input styling */
.search-input-container input#main-search {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    background: transparent;
    color: #fff;
}

/* Placeholder text color */
.search-input-container input#main-search::placeholder {
    color: #ccc;
}

/* Search icon inside input */
.search-icon {
    font-size: 1.2rem;
    color: #fefffe; /* Emerald for accent */
}

/* Filter icon inside input */
.filter-icon {
    font-size: 1.2rem;
    color: #f4f8f5;
    cursor: pointer;
}

/* Common filter buttons container */
.common-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Individual small filter buttons */
.filter-btn-small {
    padding: 8px 15px;
    border: none;
    border-radius: 12px;
    background: white;
    color: #0d0d0d;
    font-weight:550;
    cursor: pointer;
    font-size: 0.8rem;
    transition: transform 0.3s, background 0.3s;
}

.filter-btn-small:hover {
    transform: translateY(-1px);
    background: #291a29;
    color: white;
}

/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/* ==========================
   Attention Required Container
   ========================== */
.attention-container {
    background-color: #f0f4f8; /* Light background */
    border-radius: 12px;
    padding: 15px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* Header fixed */
.attention-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    background-color: #f0f4f8;
    padding-bottom: 10px;
    z-index: 5;
}

.attention-header h3 {
    font-size: 1.7rem;
    font-weight: bold;
    color: #050505;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Color summary wrapper */
.color-summary-wrapper {
    background-color: #140222; /* Same as navbar */
    padding: 15px 25px;
    border-radius: 50px;
}

.color-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: #fff;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
}

.color-item .stripe {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

/* Color stripes */
.stripe.teal { background-color: #008080; }
.stripe.green { background-color: #28a745; }
.stripe.red { background-color: #dc3545; }
.stripe.blue { background-color: #2196f3; }
.stripe.expired { background-color: #ff0000; }

/* Scrollable medicine list */
.attention-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: 400px;
    padding-right: 5px;
}

/* Row cards */
.attention-row {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    /* Remove fixed height */
    min-height: 55px;   /* optional minimum to prevent too small */
    padding: 8px 10px;  /* give some padding for comfort */
    border-left: 6px solid transparent; /* Default stroke */
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* Row border based on status */
.card-red { border-left-color: #dc3545; }
.card-green { border-left-color: #28a745; }
.card-teal { border-left-color: #008080; }
.card-blue { border-left-color: #2196f3; }
.card-expired { border-left-color: #ff0000; }

.row-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.medicine-name {
    font-weight: bold;
    font-size: 0.95rem;
    margin: 0;
}
.medicine-info {
    font-size: 0.8rem;
    color: #555;
    margin: 0;
}

.row-extra {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 0.8rem;
}
.medicine-status, .medicine-stock { margin: 0; }

/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/* Bottom Summary Card */
.bottom-summary-card {
    display: flex;
    justify-content: space-between;
    background-color: #140222; /* Same as navbar */
    border-radius: 12px;
    padding: 20px 30px;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    margin-top: 30px;
    align-items: center;
    gap: 40px; /* space between circle and expenditure cards */
}

/* Inventory Usage */
.inventory-usage {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* Circle Chart */
.circle-chart {
    width: 100px;
    height: 100px;
    position: relative;
}

.circle-bg {
    fill: none;
    stroke: #555;
    stroke-width: 3.8;
}

.circle {
    fill: none;
    stroke: #50c878;
    stroke-width: 3.8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dasharray 1s ease;
}

.circle-text {
    font-size: 0.6em;
    text-anchor: middle;
    fill: #fff;
}

/* Inventory status text */
.inventory-status h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
}

.inventory-status p {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    color: #ddd;
}

/* Horizontal Expenditures Section */
.expenditures-horizontal {
    display: flex;
    gap: 20px;
}

.expenditure-card {
    background-color: #1f0147; /* slightly lighter than navbar for contrast */
    padding: 15px 25px;
    border-radius: 12px;
    text-align: center;
    min-width: 120px;
}

.expenditure-card h5 {
    margin: 0;
    font-size: 0.85rem;
    color: #ccc;
}

.expenditure-card p {
    margin: 5px 0 0 0;
    font-size: 1.3rem;
    font-weight: bold;
    color: #50c878; /* highlight numbers in teal */
}

/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

.simulation-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.simulation-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background-color: #140222;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
}

.simulation-buttons button:hover {
    background-color: #291a29;
    transform: translateY(-2px);
}

/* Flash animation using current background color */
.flash-row {
    animation: flashAnimation 1s ease-in-out;
}

@keyframes flashAnimation {
    0% { background-color: var(--flash-color); }
    50% { background-color: transparent; }
    100% { background-color: transparent; }
}
