@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');
*
{
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: 'Ubuntu', sans-serif;
}

:root 
{
    /* Teal/green medical palette */
    --Lightbrown: #00b894;   /* primary accent/hover */
    --Darkbrown: #006c7f;    /* main text / icons */
    --brown: #20c997;        /* secondary accent */
    --brown1: #e8f9f4;       /* light background */
    --brown2: #d7e6e6;       /* cards / sidebar background */
    --brown3: #d0ece7;       /* borders / subtle lines */
    --white: #ffffff;
}


body 
{
	min-height: 100vh;
	overflow-x: hidden;
}

/* ----------------- Navigation Bar ----------------- */
/* ----------------- Navigation Bar ----------------- */
.logo {
    height: 70px;
    width: 70px;
    margin-top: 5px;
}

.container {
    position: relative;
    width: 100%;
}

.navigation {
    position: fixed;
    width: 300px;
    height: 100%;
    background: var(--brown2);
    border-left: 10px solid var(--brown2);
    transition: 0.3s ease;
    overflow: hidden;
    z-index: 900;
}

.navigation.active {
    width: 80px;
}

.navigation ul {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.navigation ul li {
    position: relative;
    width: 100%;
    list-style: none;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
}

.navigation ul li:hover,
.navigation ul li.hovered {
    background: var(--white);
}

.navigation ul li:nth-child(1) {
    margin-bottom: 40px;
    pointer-events: none;
}

.navigation ul li a {
    position: relative;
    display: flex;
    width: 100%;
    text-decoration: none;
    color: var(--Darkbrown);
}

.navigation ul li:hover a,
.navigation ul li.hovered a {
    color: var(--Darkbrown);
    font-size: larger;
    font-weight: bolder;
}

.navigation ul li a .icon {
    min-width: 60px;
    height: 60px;
    line-height: 70px;
    text-align: center;
}

.navigation ul li a .icon ion-icon {
    font-size: 1.75em;
}

.navigation ul li a .title {
    padding: 0 10px;
    height: 60px;
    line-height: 60px;
    text-align: start;
    white-space: nowrap;
}

/* curve outside */
.navigation ul li:hover a::before,
.navigation ul li.hovered a::before {
    content: '';
    position: absolute;
    right: 0;
    top: -50px;
    width: 50px;
    height: 50px;
    background: transparent;
    border-radius: 50%;
    box-shadow: 35px 35px 0 10px var(--white);
    pointer-events: none;
}

.navigation ul li:hover a::after,
.navigation ul li.hovered a::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: -50px;
    width: 50px;
    height: 50px;
    background: transparent;
    border-radius: 50%;
    box-shadow: 35px -35px 0 10px var(--white);
    pointer-events: none;
}

/* main */
.main {
    position: absolute;
    width: calc(100% - 300px);
    left: 300px;
    min-height: 100vh;
    background: var(--white);
    transition: 0.3s ease;
    margin-top: 12px;
}

.main.active {
    width: calc(100% - 80px);
    left: 80px;
}

/* ----------------- Dashboard Form ----------------- */
.topbar 
{
	width: 100%;
	height: 60px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 10px;
}

.toggle 
{
	position: relative;
	width: 60px;
	height: 60px;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 2.5em;
	cursor: pointer;
    color: var(--Darkbrown);
}

.search 
{
	position: relative;
	width: 400px;
	margin: 0 10px;
}

.search label 
{
	position: relative;
	width: 100%;
}

.search label input 
{
	width: 100%;
	height: 40px;
	border-radius: 40px;
	border-color: var(--brown1);
	padding: 5px 20px;
	padding-left: 35px;
	font-size: 18px;
	outline: none;
	border: 1px solid var(--Darkbrown);
    color: var(--Darkbrown);
}

.search label ion-icon 
{
	position: absolute;
	top: 0;
	left: 10px;
	font-size: 1.2em;
    color: var(--Darkbrown);
}

.user 
{
	position: relative;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
	cursor: pointer;
}

.user img 
{
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}


.cardBox 
{
	position: relative;
	width: 100%;
	padding: 20px;
	display: grid;
	grid-template-columns: repeat(4,1fr);
	grid-gap: 30px;
}

.cardBox .card 
{
	position: relative;
	background: var(--brown2);
	padding: 30px;
	border-radius: 20px;
	/* border: 1px solid var(--Lightbrown); */
	display: flex;
	justify-content: space-between;
	cursor: pointer;
	/* box-shadow: 0 5px 15px var(--Lightbrown); */
	transition: transform 0.3s ease;
}

.cardBox .card .numbers 
{
	position: relative;
	font-weight: 400;
	font-size: 2.5em;
	color: var(--Darkbrown);
}

.cardBox .card .cardName 
{
	color: var(--Lightbrown);
	font-size: 1.1em;
	margin-top: 5px;
}

.cardBox .card .iconBx 
{
	font-size: 3.5em;
	color: var(--Darkbrown);
}

.cardBox .card:hover {
    background: var(--Lightbrown); /* teal on hover */
}

.cardBox .card:hover .numbers,
.cardBox .card:hover .cardName,
.cardBox .card:hover .iconBx {
    color: var(--white);
}

.charts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px;
	margin-top: 10px;
	padding: 15px;
  }
  
  .charts-card {
	background-color: var(--brown2);
	margin-bottom: 20px;
	padding: 25px;

	box-sizing: border-box;
	-webkit-column-break-inside: avoid;
	border-radius: 10px;
	box-shadow: 0 6px 7px -4px var(--brown3);
  }
  
  .chart-title {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--Darkbrown);
  }

  /* Container under the search box */
#medicineResults {
    display: none;           /* hidden by default */
    background: #ffffff;     /* or your themed color */
    border-radius: 6px;
    margin-top: 5px;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0px 2px 6px rgba(0,0,0,0.12);
    padding: 0;
}


/* Empty / error text */
.medicine-empty {
    padding: 10px 14px;
    font-size: 14px;
    color: #6c7a89;
}

/* UL wrapper */
.medicine-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Each row */
.medicine-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.08s ease;
    border-bottom: 1px solid #edf3fb;
}

.medicine-item:last-child {
    border-bottom: none;
}

.medicine-item:hover {
    background: #f0f7ff;
    transform: translateY(-1px);
}

/* Left image */
.medicine-item-left {
    flex: 0 0 auto;
    margin-right: 10px;
}

.medicine-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    background: #f7fafc;
    border: 1px solid #e3eef9;
}

/* Placeholder when no image */
.medicine-thumb.placeholder {
    display: inline-block;
}

/* Right text */
.medicine-item-right {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.medicine-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #12426b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.medicine-item-dose {
    font-size: 12px;
    color: #6b8196;
}
.sales-price-input,
.sales-qty-input {
    width: 70px;
    padding: 3px 6px;
    font-size: 13px;
    text-align: right;
    border: 1px solid #c2d7ec;
    border-radius: 4px;
}

/* When click is loading price */
.medicine-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ---- Sales action buttons (Hold / Resume / Confirm) ---- */

.sales-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

/* Secondary buttons: Hold / Resume Draft */
.secondary-button {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--Lightbrown);
    background: var(--white);
    color: var(--Darkbrown);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.05s ease;
}

.secondary-button:hover {
    background-color: var(--Lightbrown);
    color: var(--white);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

.secondary-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Primary confirm button – keeps same palette but a bit stronger */
.confirm-sale-button {
    padding: 7px 18px;
    border-radius: 20px;
    border: none;
    background: var(--Lightbrown);
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.05s ease;
}

.confirm-sale-button:hover {
    background: var(--brown);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.confirm-sale-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}


/* Small screens (mobiles) */
/* Small screens (mobiles) */
@media (max-width: 768px) {

    body {
        overflow-x: hidden;
    }

    /* Sidebar becomes off-canvas on the left */
    .navigation {
        width: 220px;
        left: 0;
        transform: translateX(-100%);
        z-index: 900;
    }

    /* When JS adds .active, slide it in */
    .navigation.active {
        transform: translateX(0);
    }

    .main {
        width: 100%;
        left: 0;
        margin-top: 0;
        padding: 10px;
    }

    .main.active {
        width: 100%;
        left: 0;
    }

    .topbar {
        position: relative;
        z-index: 950;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
        padding: 8px 8px 0;
        background: var(--white);
    }

    /* 🔥 Always-visible hamburger button */
    .toggle {
        position: fixed;
        top: 12px;
        left: 12px;
        width: 40px;
        height: 40px;
        font-size: 2em;
        border-radius: 50%;
        background: var(--white);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1000; /* above the sidebar */
        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
        color: var(--Darkbrown);
    }

    .search {
        width: 100%;
        order: 3;
        margin: 5px 0 0 0;
    }

    .user {
        width: 36px;
        height: 36px;
    }

    .cardBox {
        grid-template-columns: 1fr;
        padding: 10px 0;
        grid-gap: 15px;
    }

    .cardBox .card {
        padding: 20px;
    }

    .charts {
        grid-template-columns: 1fr;
        padding: 0;
        gap: 10px;
    }

    .charts-card {
        padding: 15px;
    }
}

/* Current Stock page – themed similar to Sales/New Sale */

#page-stock-list {
    display: none; /* shown via Navigation.js */
    padding: 10px 20px 20px;
    font-family: 'Ubuntu', sans-serif;
    color: var(--Darkbrown);
}

#page-dashboard-detail {
    display: none; /* shown via Navigation.js */
    padding: 10px 20px 20px;
    font-family: 'Ubuntu', sans-serif;
    color: var(--Darkbrown);
}

/* Header – follow .sales-header style */

.stocklist-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.stocklist-title h2 {
    font-size: 28px;
    color: var(--Darkbrown);
}

.stocklist-title h2 span {
    color: var(--Lightbrown);
}

.stocklist-subtitle {
    font-size: 13px;
    color: #6c757d;
    margin-top: 4px;
}

/* Search bar – pill style like medicine search */

.stocklist-search {
    position: relative;
    min-width: 260px;
    width: 100%;
    max-width: 320px;
}

.stocklist-search-input {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border-radius: 20px;
    border: 1px solid var(--Lightbrown);
    font-size: 14px;
    background: #fff;
    outline: none;
}

.stocklist-search-input::placeholder {
    color: #999;
}

.stocklist-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #999;
    cursor: pointer;
    display: none; /* toggled by JS */
    user-select: none;
}

.stocklist-search-clear:hover {
    color: #ff4c4c;
}

/* Body – card style like sales-left/center/right */

.stocklist-body {
    background: #f9fafa;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-top: 4px;
}

.stocklist-table-wrapper {
    max-height: calc(100vh - 230px);
    overflow: auto;
    border-radius: 8px;
    border: 1px solid var(--brown3);
    background: #fff;
}

/* Table – reusing feel of .sales-table */

.stocklist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.stocklist-table th,
.stocklist-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--brown3);
    text-align: left;
    white-space: nowrap;
}

.stocklist-table thead th {
    background: var(--brown1);
    position: sticky;
    top: 0;
    z-index: 1;
}

/* “Loading / no data” cell */

.stocklist-empty-cell,
.stocklist-loading-cell {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: #6c757d;
}

/* Footer – page info + pagination */

.stocklist-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    flex-wrap: wrap;
    gap: 6px;
}

.stocklist-page-info {
    color: #666;
}

.stocklist-pagination {
    display: flex;
    gap: 6px;
}

.stocklist-page-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--Lightbrown);
    background: var(--Lightbrown);
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.stocklist-page-btn:hover:not(:disabled) {
    background: var(--brown1);
    color: var(--Darkbrown);
}

.stocklist-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sortable header styling */

.stocklist-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.stocklist-sortable::after {
    content: "";
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.5;
}

.stocklist-sortable.stocklist-sort-asc::after {
    content: "▲";
}

.stocklist-sortable.stocklist-sort-desc::after {
    content: "▼";
}


/* Mobile tweaks – header stacks nicely */

@media (max-width: 768px) {
    #page-stock-list {
        padding: 10px 10px 16px;
    }

    .stocklist-header {
        align-items: flex-start;
    }

    .stocklist-search {
        max-width: 100%;
    }

    .stocklist-table-wrapper {
        max-height: calc(100vh - 250px);
    }
}

.stocklist-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
@media (max-width: 768px) {
    .stocklist-right {
        align-items: stretch;
    }
}



/* =========================
   Mobile Overrides for Sales
   ========================= */

@media (max-width: 768px) {

  /* Prevent double padding: main already has padding in Dashboard.css */
  .sales-section {
    padding: 0 !important;
  }

  /* Give each panel breathing room without huge side margin */
  .sales-layout {
    gap: 10px;
    margin-top: 8px;
  }

  .sales-left,
  .sales-center,
  .sales-right {
    padding: 12px;
    border-radius: 12px;
  }

  /* Header stacks naturally */
  .sales-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 0;
  }

  .sales-header h2 {
    font-size: 22px;
  }

  .sales-meta {
    text-align: left;
    font-size: 12px;
  }

  /* Bigger search input (mobile thumb friendly) */
  .sales-search-input {
    font-size: 16px;        /* prevents zoom + improves readability */
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 10px;
  }

  /* Clear button stays centered */
  .clear-search-btn {
    top: 50%;
    right: 12px;
    font-size: 22px;
  }

  /* Results list is easier to tap */
  .medicine-results {
    max-height: 45vh;
    padding: 6px;
  }

  .medicine-item {
    padding: 10px 10px;
    font-size: 14px;
  }

  /* Cart table: horizontal scroll instead of squishing columns */
  .sales-center {
    overflow: hidden;
  }

  .sales-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .sales-qty-input {
    width: 74px;
    padding: 8px 8px;
    font-size: 15px;
  }

  /* Payment fields bigger */
  .sales-payment select,
  .sales-payment input,
  .sales-totals input {
    font-size: 16px;
    padding: 10px 10px;
  }

  .sales-totals input {
    width: 130px;
  }

  /* Actions stack nicely */
  .sales-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
  }

  .secondary-button,
  .confirm-sale-button {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-size: 16px;
  }
}

/* ==========================================
   Mobile: remove double padding on table pages
   ========================================== */
@media (max-width: 768px) {

  /* main already has padding; remove section padding */
  #page-stock-list,
  #page-dashboard-detail {
    padding: 0 !important;
  }

  /* reduce header side spacing */
  .stocklist-header {
    margin: 6px 0 8px;
    gap: 8px;
  }

  /* make table card use full width */
  .stocklist-body {
    padding: 10px;
    border-radius: 12px;
  }

  /* make wrapper full width */
  .stocklist-table-wrapper {
    border-radius: 10px;
  }
}


@media (max-width: 768px) {
  table {
    font-size: 12px;
  }

  .stocklist-table-wrapper,
  .stockin-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}





/* Subtle medical background pattern */
:root{
  --bg-tint: rgba(20, 83, 45, 0.04);   /* adjust */
  --bg-line: rgba(20, 83, 45, 0.06);   /* adjust */
}

html, body {
  height: 100%;
}



/* Make your main content area slightly “carded” */
.app-content, .content-wrapper, .main-content, #DashboardForm, #page-dashboard-detail, #page-stock-list {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(2px);
  border-radius: 12px;
}

.wrapper, .content, .container, .container-fluid {
  background: transparent !important;
}


