/* ==========================
   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;
    padding: 30px;
    overflow-y: auto;
}

/* ==========================
   Main Content Styles (Same as Home Page)
   ========================== */
.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;
    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;
}


/* Container for controls */
.inventory-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Small search bar */
.inventory-search {
    display: flex;
    align-items: center;
    background-color: #f0f0f0; /* subtle background */
    border-radius: 12px;
    padding: 5px 10px;
    flex: 1 1 300px; /* responsive width */
}

.inventory-search input {
    border: none;
    outline: none;
    padding: 8px 10px;
    font-size: 1rem;
    border-radius: 12px 0 0 12px;
    flex: 1;
    background-color: transparent;
}

.inventory-search button {
    background-color: #50c878; /* green accent */
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.inventory-search button:hover {
    background-color: #45b86a;
}

/* Add Medicine Button */
.add-medicine-btn {
    background: #020a1a;
    color: #fff;
    font-weight: bold;
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s, transform 0.2s;
}

.add-medicine-btn:hover {
    background: rgb(46, 3, 56);
    transform: translateY(-2px);
}


/* ==========================
   Inventory Table
   ========================== */
.table-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
}

.inventory-table th, .inventory-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: 0.9rem;
}

.inventory-table th {
    background-color: #f0f0f0;
}

.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    text-align: center;
    color: #fff;
}

.status.healthy-stock { background-color: #00bfa5; } /* Distinct Teal */
.status.near-expiry { background-color: #50c878; } /* Green */
.status.critical { background-color: #c41425; } /* Red */
.status.damaged-stock { background-color: #007777; } /* Blue */
.status.expired { background-color: #8e0404; } /* Grey */

.alert-dot {
    font-size: 1rem;
    margin-right: 5px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 5px;
    font-size: 1rem;
}
.action-btn.delete { color: #dc3545; }
.action-btn.edit { color: #50c878; }

/* ================================
   STATUS COLOR SYSTEM
=================================== */
.status {
    padding: 5px 12px;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Color logic based on your official system */
.healthy { background-color: #0aa8a8; }            /* 🔵 Teal */
.near-expiry { background-color: #2ecc71; }        /* 🟢 Green */
.expiring-soon { background-color: #c50505; }      /* 🔴 Red */
.critical { background-color: #c70039; }           /* 🔴 Darker Critical */
.damaged { background-color: #007bff; }            /* 🔵 Blue */
.expired { background-color: #9d0505; }               /* ❌ Black */

/* ================================
   Pagination
=================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
}

.page-btn {
    padding: 8px 15px;
    border-radius: 8px;
    background-color: #d6d6d6;
    color: rgb(8, 8, 8);
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.page-btn:hover {
    background-color: #2c0149;
    color: white;
}

.page-btn.active {
    background: #140222;
    font-weight: bold;
    color:rgb(249, 249, 249);
}

/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/* ======================================
   SMART INVENTORY SUMMARY CARDS
======================================== */
.inventory-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    margin-top: 30px;
}

/* Card Container */
.summary-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0px 3px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.2s, box-shadow 0.3s;
    border-left: 7px solid transparent;
}

/* Hover Effect */
.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0px 7px 16px rgba(0,0,0,0.12);
}

/* Card Icons */
.card-icon {
    width: 55px;
    height: 55px;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: #fff;
}

/* Card Text */
.card-details h3 {
    margin: 0;
    font-size: 1rem;
    color: #555;
    font-weight: 600;
}

.card-details .count {
    margin-top: 5px;
    font-size: 2rem;
    font-weight: 700;
    color: #090a0c;
}

/* ======================================
   COLOR SYSTEM (Matches your codes)
   🔵 Teal - Healthy Stock
   🟢 Green - Near Expiry
   🔴 Red - Critical Expiry
   🔵 Blue - Damaged Stock
   ❌ Dark Red - Fully Expired
======================================== */

/* Total Inventory */
.card-icon.total {
    background: linear-gradient(135deg, #140222, #2f005a);
}
.summary-card.total { border-left-color: #2f005a; }

/* 🔵 Healthy Stock */
.card-icon.healthy { background-color: #008c95; }
.summary-card.healthy { border-left-color: #008c95; }

/* 🟢 Near Expiry (Monitor) */
.card-icon.near-expiry { background-color: #1ca700; }
.summary-card.near-expiry { border-left-color: #1ca700; }

/* 🔴 Critical Expiry (Urgent) */
.card-icon.critical-expiry { background-color: #c70039; }
.summary-card.critical-expiry { border-left-color: #c70039; }

/* 🔵 Damaged Stock */
.card-icon.damaged { background-color: #0047ab; }
.summary-card.damaged { border-left-color: #0047ab; }

/* ❌ Expired (Remove Immediately) */
.card-icon.expired { background-color: #8b0000; }
.summary-card.expired { border-left-color: #8b0000; }

/* ============================
   STATUS TAG NEW DOT SYSTEM
===============================*/

.status-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Small circle */
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Colors based on your official system */
.dot.healthy { background-color: #0aa8a8; }        /* Teal */
.dot.expiring-soon { background-color: #c50505; }  /* Red */
.dot.near-expiry { background-color: #2ecc71; }    /* Green */
.dot.critical { background-color: #c70039; }        /* Dark Red */
.dot.damaged { background-color: #0047ab; }         /* Blue */

/* Expired uses image instead */
.expired-icon {
    width: 12px;
    height: 12px;
    object-fit: contain;
    opacity: 0.9;
}

/* ============================
 HORIZONTAL INVENTORY GUIDE
=========================== */

.inventory-color-summary-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    background: #ffffff;
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: rgba(0, 0, 0, 0.06) 0px 4px 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* dot colors */
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.healthy { background-color: #0aa8a8; }
.dot.expiring-soon { background-color: #c50505; }
.dot.near-expiry { background-color: #2ecc71; }
.dot.critical { background-color: #c70039; }
.dot.damaged { background-color: #0047ab; }

.expired-icon {
    width: 12px;
    height: 12px;
    opacity: 0.9;
}

/*Simulation Buttons*/
.simulation-buttons {
    margin-top:15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.simulate-btn {
    background-color: #50c878; /* matches green accent */
    color: #fff;
    font-weight: bold;
    padding: 8px 15px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.simulate-btn:hover {
    background-color: #45b86a;
    transform: translateY(-2px);
}
