/* ==========================================
   PHARMLEDGE GLOBAL STYLES
   ========================================== */

:root {

    --primary: #67c9a5;
    --primary-dark: #3eaa82;
    --primary-light: #e8f8f2;

    --secondary: #70c8e8;
    --secondary-light: #eaf8fc;

    --background: #f7fbfa;
    --surface: #ffffff;

    --text: #18332f;
    --text-secondary: #657875;
    --text-light: #8a9b98;

    --border: #e1ece9;

    --success: #38a879;
    --warning: #e5a93d;
    --danger: #df6262;

    --shadow:
        0 10px 35px rgba(40, 100, 85, 0.08);

    --radius: 16px;

    --transition: 0.25s ease;
}


/* ==========================================
   RESET
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    font-family: "Inter", sans-serif;

    background:
        linear-gradient(
            135deg,
            #f8fcfb 0%,
            #f4fbfd 100%
        );

    color: var(--text);

    min-height: 100vh;
}


button,
input,
textarea,
select {
    font-family: inherit;
}


button {
    cursor: pointer;
}


a {
    text-decoration: none;
    color: inherit;
}


/* ==========================================
   AUTH PAGE
   ========================================== */

.auth-page {
    min-height: 100vh;
}


.auth-container {
    min-height: 100vh;

    display: grid;

    grid-template-columns:
        minmax(0, 1.05fr)
        minmax(400px, 0.95fr);
}


/* ==========================================
   BRAND SIDE
   ========================================== */

.auth-brand {

    position: relative;

    display: flex;
    flex-direction: column;

    justify-content: center;

    padding: 70px 9%;

    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            #e9f9f3 0%,
            #eefaff 100%
        );
}


.auth-brand::before {

    content: "";

    position: absolute;

    width: 420px;
    height: 420px;

    border-radius: 50%;

    background:
        rgba(103, 201, 165, 0.13);

    top: -160px;
    right: -120px;
}


.auth-brand::after {

    content: "";

    position: absolute;

    width: 300px;
    height: 300px;

    border-radius: 50%;

    background:
        rgba(112, 200, 232, 0.12);

    bottom: -120px;
    left: -100px;
}


/* ==========================================
   LOGO
   ========================================== */

.brand-logo,
.mobile-logo {

    display: flex;

    align-items: center;

    gap: 11px;

    font-size: 23px;

    font-weight: 800;

    letter-spacing: -0.7px;
}


.brand-logo {
    position: absolute;
    top: 45px;
    left: 9%;
}


.brand-logo span span,
.mobile-logo span span {
    color: var(--primary-dark);
}


.brand-icon {

    width: 39px;
    height: 39px;

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

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );

    color: white;

    font-size: 20px;

    box-shadow:
        0 7px 18px
        rgba(80, 180, 150, 0.25);
}


/* ==========================================
   BRAND CONTENT
   ========================================== */

.brand-content {
    position: relative;
    z-index: 2;

    max-width: 620px;
}


.eyebrow {

    color: var(--primary-dark);

    font-size: 12px;

    font-weight: 800;

    letter-spacing: 1.7px;

    margin-bottom: 20px;
}


.brand-content h1 {

    font-size: clamp(42px, 5vw, 67px);

    line-height: 1.05;

    letter-spacing: -3px;

    margin-bottom: 25px;
}


.brand-content h1 span {

    display: block;

    background:
        linear-gradient(
            90deg,
            var(--primary-dark),
            #45a9cc
        );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}


.brand-content > p {

    max-width: 530px;

    color: var(--text-secondary);

    font-size: 17px;

    line-height: 1.7;
}


/* ==========================================
   FEATURES
   ========================================== */

.brand-features {

    position: relative;

    z-index: 2;

    display: flex;

    flex-wrap: wrap;

    gap: 12px;

    margin-top: 45px;
}


.feature-item {

    display: flex;

    align-items: center;

    gap: 9px;

    padding: 10px 15px;

    background: rgba(255,255,255,0.72);

    border: 1px solid
        rgba(255,255,255,0.8);

    border-radius: 50px;

    color: var(--text-secondary);

    font-size: 13px;

    font-weight: 600;
}


.feature-icon {

    width: 21px;
    height: 21px;

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

    border-radius: 50%;

    background: var(--primary-light);

    color: var(--success);

    font-size: 12px;

    font-weight: 800;
}


/* ==========================================
   FORM SECTION
   ========================================== */

.auth-form-section {

    display: flex;

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

    padding: 40px;
}


.auth-card {

    width: 100%;

    max-width: 450px;

    padding: 42px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 24px;

    box-shadow: var(--shadow);
}


.mobile-logo {
    display: none;
}


.form-heading {
    margin-bottom: 30px;
}


.form-heading h2 {

    font-size: 29px;

    letter-spacing: -1px;

    margin-bottom: 8px;
}


.form-heading p {

    color: var(--text-secondary);

    font-size: 14px;
}


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

.form-group {
    margin-bottom: 21px;
}


.form-group label {

    display: block;

    font-size: 13px;

    font-weight: 600;

    margin-bottom: 8px;
}


.label-row {

    display: flex;
    justify-content: space-between;
}


.form-group input {

    width: 100%;

    height: 49px;

    padding: 0 15px;

    border: 1px solid var(--border);

    border-radius: 11px;

    outline: none;

    background: #fbfdfc;

    color: var(--text);

    font-size: 14px;

    transition: var(--transition);
}


.form-group input::placeholder {
    color: #a5b3b0;
}


.form-group input:focus {

    border-color: var(--primary);

    background: white;

    box-shadow:
        0 0 0 4px
        rgba(103, 201, 165, 0.12);
}


/* ==========================================
   BUTTONS
   ========================================== */

.btn {

    border: none;

    border-radius: 11px;

    height: 49px;

    padding: 0 22px;

    font-size: 14px;

    font-weight: 700;

    transition: var(--transition);
}


.btn-primary {

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--primary-dark),
            var(--primary)
        );

    box-shadow:
        0 8px 18px
        rgba(72, 174, 135, 0.18);
}


.btn-primary:hover {

    transform: translateY(-1px);

    box-shadow:
        0 11px 23px
        rgba(72, 174, 135, 0.25);
}


.btn-primary:disabled {

    opacity: 0.65;

    cursor: not-allowed;

    transform: none;
}


.btn-full {
    width: 100%;
}


/* ==========================================
   MESSAGES
   ========================================== */

.auth-message {

    padding: 12px 14px;

    border-radius: 10px;

    font-size: 13px;

    margin-bottom: 20px;

    font-weight: 500;
}


.auth-message.hidden {
    display: none;
}


.auth-message.error {

    display: block;

    background: #fff0f0;

    color: var(--danger);

    border: 1px solid #f6d5d5;
}


.auth-message.success {

    display: block;

    background: var(--primary-light);

    color: var(--success);

    border: 1px solid #cceee0;
}


/* ==========================================
   DIVIDER
   ========================================== */

.auth-divider {

    display: flex;

    align-items: center;

    gap: 13px;

    margin: 27px 0;

    color: #a2afad;

    font-size: 10px;

    font-weight: 700;
}


.auth-divider::before,
.auth-divider::after {

    content: "";

    flex: 1;

    height: 1px;

    background: var(--border);
}


/* ==========================================
   AUTH SWITCH
   ========================================== */

.auth-switch {

    text-align: center;

    color: var(--text-secondary);

    font-size: 13px;
}


.auth-switch a {

    color: var(--primary-dark);

    font-weight: 700;
}


.auth-switch a:hover {
    text-decoration: underline;
}


/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 900px) {

    .auth-container {

        grid-template-columns: 1fr;
    }


    .auth-brand {

        display: none;
    }


    .auth-form-section {

        min-height: 100vh;

        padding: 25px;
    }


    .mobile-logo {

        display: flex;

        justify-content: center;

        margin-bottom: 35px;
    }


    .auth-card {

        padding: 34px 28px;
    }
}


@media (max-width: 480px) {

    .auth-form-section {
        padding: 15px;
    }


    .auth-card {

        padding: 28px 20px;

        border-radius: 18px;

        box-shadow: none;

        border: none;
    }


    .form-heading h2 {
        font-size: 25px;
    }
}

/* ==========================================
   PHARMLEDGE APP LAYOUT
   ========================================== */

.app-page {
    background: #f7fbfa;
    display: flex;
}


/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    width: 250px;
    height: 100vh;

    position: fixed;
    left: 0;
    top: 0;

    display: flex;
    flex-direction: column;

    background: #ffffff;
    border-right: 1px solid var(--border);

    z-index: 100;
}


.sidebar-logo {
    height: 90px;

    display: flex;
    align-items: center;

    gap: 11px;

    padding: 0 25px;

    font-size: 21px;
    font-weight: 800;

    letter-spacing: -0.6px;
}


.sidebar-logo > span > span {
    color: var(--primary-dark);
}


/* ==========================================
   SIDEBAR NAV
   ========================================== */

.sidebar-nav {
    padding: 20px 14px;

    flex: 1;

    overflow-y: auto;
}


.nav-label {
    padding: 12px 13px 8px;

    color: #9aaba8;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1.4px;
}


.nav-item {
    display: flex;
    align-items: center;

    gap: 13px;

    height: 46px;

    padding: 0 13px;

    margin: 4px 0;

    border-radius: 11px;

    color: var(--text-secondary);

    font-size: 13px;

    font-weight: 600;

    transition: var(--transition);
}


.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}


.nav-item.active {
    background:
        linear-gradient(
            100deg,
            #e8f8f2,
            #edfafd
        );

    color: var(--primary-dark);

    font-weight: 700;
}


.nav-icon {
    width: 25px;

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

    font-size: 17px;
}


/* ==========================================
   SIDEBAR BOTTOM
   ========================================== */

.sidebar-bottom {
    padding: 16px;

    border-top: 1px solid var(--border);
}


.sidebar-user {
    display: flex;

    align-items: center;

    gap: 10px;

    padding: 8px 4px 15px;
}


.user-avatar {
    width: 38px;
    height: 38px;

    min-width: 38px;

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

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );

    color: white;

    font-size: 14px;

    font-weight: 800;
}


.sidebar-user-info {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;
}


.sidebar-user-info strong {
    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.sidebar-user-info span {
    color: var(--text-light);

    font-size: 10px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.logout-btn {
    width: 100%;

    height: 40px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: #ffffff;

    color: var(--text-secondary);

    font-size: 12px;

    font-weight: 600;

    transition: var(--transition);
}


.logout-btn span {
    margin-right: 6px;
}


.logout-btn:hover {
    border-color: #f0cccc;

    background: #fff5f5;

    color: var(--danger);
}


/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    width: calc(100% - 250px);

    margin-left: 250px;

    min-height: 100vh;
}


/* ==========================================
   TOPBAR
   ========================================== */

.topbar {
    height: 90px;

    display: flex;
    align-items: center;

    justify-content: space-between;

    padding: 0 38px;

    background: rgba(255,255,255,0.88);

    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(12px);

    position: sticky;
    top: 0;

    z-index: 50;
}


.topbar-title h1 {
    font-size: 23px;

    letter-spacing: -0.7px;
}


.topbar-title p {
    color: var(--text-secondary);

    font-size: 11px;

    margin-top: 5px;
}


.topbar-user {
    display: flex;

    align-items: center;

    gap: 10px;
}


.topbar-user > div:last-child {
    display: flex;
    flex-direction: column;

    gap: 3px;
}


.topbar-user strong {
    font-size: 12px;
}


.topbar-user span {
    color: var(--text-light);

    font-size: 10px;
}


.mobile-menu-btn {
    display: none;

    width: 40px;
    height: 40px;

    border: 1px solid var(--border);

    border-radius: 10px;

    background: white;

    color: var(--text);

    font-size: 18px;
}


/* ==========================================
   DASHBOARD CONTENT
   ========================================== */

.dashboard-content {
    max-width: 1500px;

    margin: 0 auto;

    padding: 30px 38px 50px;
}


/* ==========================================
   WELCOME CARD
   ========================================== */

.welcome-card {
    min-height: 165px;

    position: relative;

    overflow: hidden;

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

    padding: 30px 35px;

    margin-bottom: 24px;

    border-radius: 18px;

    background:
        linear-gradient(
            120deg,
            #e7f8f1,
            #eaf8fc
        );

    border: 1px solid #dcefeb;
}


.welcome-card::before {
    content: "";

    position: absolute;

    width: 230px;
    height: 230px;

    border-radius: 50%;

    right: 50px;
    top: -150px;

    background:
        rgba(103,201,165,0.13);
}


.welcome-card::after {
    content: "";

    position: absolute;

    width: 170px;
    height: 170px;

    border-radius: 50%;

    right: -50px;
    bottom: -90px;

    background:
        rgba(112,200,232,0.15);
}


.welcome-small {
    color: var(--primary-dark);

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1.4px;

    margin-bottom: 9px;
}


.welcome-card h2 {
    font-size: 25px;

    letter-spacing: -0.8px;

    margin-bottom: 7px;
}


.welcome-card h2 span {
    color: var(--primary-dark);
}


.welcome-card p:last-child {
    color: var(--text-secondary);

    font-size: 12px;
}


.welcome-decoration {
    position: relative;

    z-index: 2;

    width: 82px;
    height: 82px;

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

    border-radius: 24px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );

    color: white;

    font-size: 38px;

    font-weight: 400;

    box-shadow:
        0 15px 30px
        rgba(70,170,145,0.18);

    transform: rotate(5deg);
}


/* ==========================================
   STATISTICS
   ========================================== */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 24px;
}


.stat-card {
    padding: 21px;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: 15px;

    box-shadow:
        0 5px 20px
        rgba(40,100,85,0.045);

    transition: var(--transition);
}


.stat-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 10px 28px
        rgba(40,100,85,0.08);
}


.stat-card-top {
    display: flex;

    justify-content: space-between;

    margin-bottom: 18px;
}


.stat-icon {
    width: 40px;
    height: 40px;

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

    border-radius: 11px;

    font-size: 18px;
}


.stat-icon.green {
    background: #e8f8f2;
}


.stat-icon.blue {
    background: #eaf8fc;
}


.stat-icon.cyan {
    background: #edf9fa;

    color: #39a4b9;

    font-size: 18px;

    font-weight: 800;
}


.stat-icon.purple {
    background: #f1effd;
}


.stat-card > p {
    color: var(--text-secondary);

    font-size: 11px;

    font-weight: 600;

    margin-bottom: 5px;
}


.stat-card h3 {
    font-size: 25px;

    letter-spacing: -0.7px;

    margin-bottom: 5px;
}


.stat-description {
    color: var(--text-light);

    font-size: 10px;
}


/* ==========================================
   DASHBOARD GRID
   ========================================== */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 24px;
}


.dashboard-card {
    background: white;

    border: 1px solid var(--border);

    border-radius: 15px;

    overflow: hidden;

    box-shadow:
        0 5px 20px
        rgba(40,100,85,0.045);
}


.card-header {
    min-height: 76px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 18px 21px;

    border-bottom: 1px solid var(--border);
}


.card-header h3 {
    font-size: 14px;

    letter-spacing: -0.2px;

    margin-bottom: 4px;
}


.card-header p {
    color: var(--text-light);

    font-size: 10px;
}


.card-header > a {
    color: var(--primary-dark);

    font-size: 11px;

    font-weight: 700;
}


.card-header > a:hover {
    text-decoration: underline;
}


/* ==========================================
   ALERT LIST
   ========================================== */

.alert-list {
    padding: 5px 20px;
}


.alert-item {
    min-height: 65px;

    display: flex;

    align-items: center;

    gap: 11px;

    border-bottom: 1px solid #edf2f0;
}


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


.alert-item-icon {
    width: 31px;
    height: 31px;

    min-width: 31px;

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

    border-radius: 9px;

    font-weight: 800;

    font-size: 12px;
}


.alert-item-icon.warning {
    background: #fff6df;

    color: var(--warning);
}


.alert-item-icon.danger {
    background: #fff0f0;

    color: var(--danger);
}


.alert-item-content {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 4px;
}


.alert-item-content strong {
    font-size: 11px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.alert-item-content span {
    color: var(--text-light);

    font-size: 10px;
}


.stock-badge {
    padding: 5px 8px;

    border-radius: 6px;

    font-size: 9px;

    font-weight: 700;
}


.stock-badge.warning {
    background: #fff6df;

    color: var(--warning);
}


.expiry-date {
    color: var(--danger);

    font-size: 10px;

    font-weight: 700;

    white-space: nowrap;
}


/* ==========================================
   EMPTY / LOADING STATES
   ========================================== */

.loading-state {
    min-height: 100px;

    display: flex;

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

    color: var(--text-light);

    font-size: 11px;
}


.empty-state {
    min-height: 120px;

    display: flex;

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

    flex-direction: column;

    gap: 5px;

    text-align: center;
}


.empty-icon {
    width: 34px;
    height: 34px;

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

    margin-bottom: 3px;

    border-radius: 50%;

    background: var(--primary-light);

    color: var(--success);

    font-size: 14px;

    font-weight: 800;
}


.empty-state strong {
    font-size: 11px;
}


.empty-state span {
    max-width: 230px;

    color: var(--text-light);

    font-size: 9px;

    line-height: 1.5;
}


/* ==========================================
   SALES TABLE
   ========================================== */

.sales-card {
    width: 100%;
}


.table-container {
    width: 100%;

    overflow-x: auto;
}


.data-table {
    width: 100%;

    border-collapse: collapse;

    min-width: 650px;
}


.data-table th {
    padding: 13px 20px;

    text-align: left;

    background: #fbfdfc;

    color: var(--text-light);

    font-size: 9px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.6px;

    white-space: nowrap;
}


.data-table td {
    padding: 15px 20px;

    border-top: 1px solid #edf2f0;

    color: var(--text-secondary);

    font-size: 11px;
}


.data-table tbody tr {
    transition: var(--transition);
}


.data-table tbody tr:hover {
    background: #fbfefd;
}


.data-table td strong {
    color: var(--text);

    font-size: 11px;
}


.bill-id {
    color: var(--primary-dark);

    font-weight: 700;
}


.payment-badge {
    display: inline-block;

    padding: 5px 8px;

    border-radius: 6px;

    background: var(--secondary-light);

    color: #4098b7;

    font-size: 9px;

    font-weight: 700;
}


.amount {
    color: var(--primary-dark) !important;
}


.empty-table {
    text-align: center;

    padding: 35px !important;

    color: var(--text-light) !important;
}


/* ==========================================
   MOBILE OVERLAY
   ========================================== */

.sidebar-overlay {
    display: none;

    position: fixed;

    inset: 0;

    background: rgba(20,45,40,0.28);

    z-index: 90;
}


.sidebar-overlay.show {
    display: block;
}


/* ==========================================
   RESPONSIVE — TABLET
   ========================================== */

@media (max-width: 1100px) {

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

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-content {
        padding: 25px;
    }

    .topbar {
        padding: 0 25px;
    }
}


/* ==========================================
   RESPONSIVE — MOBILE
   ========================================== */

@media (max-width: 768px) {

    .sidebar {
        transform: translateX(-100%);

        transition:
            transform 0.25s ease;

        box-shadow:
            10px 0 30px
            rgba(20,60,50,0.08);
    }


    .sidebar.open {
        transform: translateX(0);
    }


    .main-content {
        width: 100%;

        margin-left: 0;
    }


    .topbar {
        height: 75px;

        padding: 0 18px;

        gap: 12px;
    }


    .mobile-menu-btn {
        display: flex;

        align-items: center;
        justify-content: center;
    }


    .topbar-user > div:last-child {
        display: none;
    }


    .topbar-user .user-avatar {
        width: 36px;
        height: 36px;

        min-width: 36px;
    }


    .dashboard-content {
        padding: 20px 16px 40px;
    }


    .welcome-card {
        min-height: 150px;

        padding: 25px;
    }


    .welcome-card h2 {
        font-size: 21px;
    }


    .welcome-decoration {
        width: 60px;
        height: 60px;

        font-size: 27px;

        border-radius: 18px;
    }


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

        gap: 12px;
    }


    .stat-card {
        padding: 17px;
    }


    .stat-card h3 {
        font-size: 21px;
    }


    .stat-icon {
        width: 35px;
        height: 35px;

        font-size: 15px;
    }
}


/* ==========================================
   SMALL MOBILE
   ========================================== */

@media (max-width: 480px) {

    .topbar-title h1 {
        font-size: 19px;
    }


    .topbar-title p {
        font-size: 9px;
    }


    .welcome-card {
        padding: 20px;
    }


    .welcome-decoration {
        display: none;
    }


    .stats-grid {
        grid-template-columns: 1fr;
    }


    .stat-card {
        min-height: 125px;
    }


    .dashboard-grid {
        gap: 14px;
    }


    .card-header {
        padding: 16px;
    }


    .alert-list {
        padding: 5px 16px;
    }
}
/* ==========================================
   MEDICINES PAGE
   ========================================== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.page-header h2 {
    font-size: 22px;
    letter-spacing: -0.6px;
    margin-bottom: 5px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 11px;
}


/* ==========================================
   SECONDARY BUTTON
   ========================================== */

.btn-secondary {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: #f7fbfa;
    border-color: #c9ddd8;
}


/* ==========================================
   TOOLBAR
   ========================================== */

.toolbar-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.search-box {
    flex: 1;
    height: 43px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 13px;
    background: #fbfdfc;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text-light);
}

.search-box span {
    font-size: 20px;
}

.search-box input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 12px;
}

.toolbar-card select,
.form-group select {
    height: 43px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    color: var(--text-secondary);
    outline: none;
    font-size: 12px;
}

.toolbar-card select:focus,
.form-group select:focus {
    border-color: var(--primary);
}


/* ==========================================
   MEDICINE TABLE
   ========================================== */

.medicine-table {
    min-width: 950px;
}

.medicine-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.medicine-mini-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    background: var(--primary-light);
    font-size: 15px;
}

.medicine-name-cell > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.medicine-name-cell strong {
    font-size: 11px;
}

.medicine-name-cell span {
    color: var(--text-light);
    font-size: 9px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
}

.status-badge.success {
    background: #e9f8f2;
    color: var(--success);
}

.status-badge.warning {
    background: #fff6df;
    color: var(--warning);
}

.status-badge.danger {
    background: #fff0f0;
    color: var(--danger);
}


/* ==========================================
   TABLE ACTIONS
   ========================================== */

.action-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-action {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: white;
    font-size: 12px;
    transition: var(--transition);
}

.table-action.edit {
    color: #439db9;
}

.table-action.edit:hover {
    background: var(--secondary-light);
    border-color: #c8e9f3;
}

.table-action.delete {
    color: var(--danger);
}

.table-action.delete:hover {
    background: #fff0f0;
    border-color: #f0cccc;
}


/* ==========================================
   MODAL
   ========================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(22, 50, 45, 0.30);
    backdrop-filter: blur(5px);
    z-index: 500;
}

.modal-overlay.show {
    display: flex;
}

body.modal-open {
    overflow: hidden;
}

.modal-card {
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow:
        0 25px 70px
        rgba(20, 60, 50, 0.18);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {

    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 23px 25px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 18px;
    margin-bottom: 5px;
    letter-spacing: -0.4px;
}

.modal-header p {
    color: var(--text-light);
    font-size: 10px;
}

.modal-close {
    width: 33px;
    height: 33px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text-secondary);
    font-size: 21px;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    background: #fff2f2;
    color: var(--danger);
}


/* ==========================================
   FORM GRID
   ========================================== */

#medicineForm {
    padding: 24px 25px;
}

.form-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group textarea {
    width: 100%;
    resize: vertical;
    min-height: 90px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfdfc;
    color: var(--text);
    outline: none;
    font-size: 12px;
}

.form-group textarea:focus {
    border-color: var(--primary);
    background: white;
    box-shadow:
        0 0 0 4px
        rgba(103, 201, 165, 0.10);
}


/* ==========================================
   MODAL FOOTER
   ========================================== */

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 25px;
    border-top: 1px solid var(--border);
}


/* ==========================================
   RESPONSIVE MEDICINES
   ========================================== */

@media (max-width: 700px) {

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header .btn {
        width: 100%;
    }

    .toolbar-card {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-card select {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group-full {
        grid-column: auto;
    }

    .modal-card {
        max-height: 94vh;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {

    .modal-overlay {
        padding: 10px;
    }

    .modal-header {
        padding: 18px;
    }

    #medicineForm {
        padding: 20px 18px;
    }

    .modal-footer {
        padding: 15px 18px;
    }

    .modal-footer .btn {
        flex: 1;
    }
}
/* ==========================================
SALES PAGE
========================================== */

.sales-summary {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 16px;

    margin-bottom: 20px;
}

.sales-summary-card {
    background: white;

    border: 1px solid var(--border);

    border-radius: 14px;

    padding: 18px;
}

.sales-summary-card span {
    display: block;

    font-size: 10px;

    color: var(--text-light);

    margin-bottom: 7px;
}

.sales-summary-card strong {
    font-size: 22px;
}


/* ==========================================
SALES RESPONSIVE
========================================== */

@media (max-width: 700px) {

    .sales-summary {
        grid-template-columns: 1fr;
    }

}

/* ==========================================
BILLING PAGE
========================================== */

.billing-layout {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 18px;
}

.billing-products-card {
    min-width: 0;
}

.billing-cart-card {
    min-width: 0;
}

.billing-customer-card {
    min-width: 0;
}

.billing-summary-card {
    min-width: 0;
}


/* ==========================================
BILLING FORM
========================================== */

.billing-form {
    padding: 22px;
}

.billing-form .form-group {
    margin-bottom: 16px;
}

.billing-form .btn {
    width: 100%;
}


/* ==========================================
CUSTOMER FORM
========================================== */

.billing-customer-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 22px;
}


/* ==========================================
BILLING SUMMARY
========================================== */

.billing-summary {
    padding: 22px;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding: 12px 0;

    border-bottom: 1px solid var(--border);
}

.summary-row span {
    color: var(--text-secondary);
    font-size: 12px;
}

.summary-row strong {
    color: var(--text);
    font-size: 13px;
}

.summary-row input {
    width: 110px;
    height: 38px;

    padding: 0 10px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: #fbfdfc;
    color: var(--text);

    outline: none;

    font-size: 12px;
    text-align: right;
}

.summary-row input:focus {
    border-color: var(--primary);
    background: white;
}


/* ==========================================
TOTAL
========================================== */

.summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin: 18px 0;
    padding: 16px;

    background: linear-gradient(
        135deg,
        #eefbf6,
        #eef9fc
    );

    border: 1px solid #d5eee6;
    border-radius: 12px;
}

.summary-total span {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.summary-total strong {
    color: var(--primary);
    font-size: 20px;
}


/* ==========================================
PAYMENT
========================================== */

.billing-summary .form-group {
    margin-top: 18px;
}

.billing-summary .form-group select {
    width: 100%;
}


/* ==========================================
COMPLETE SALE BUTTON
========================================== */

.billing-complete-btn {
    width: 100%;
    margin-top: 18px;
}

.billing-summary .btn-secondary {
    width: 100%;
    margin-top: 10px;
}


/* ==========================================
BILL TABLE
========================================== */

.billing-cart-card .table-container {
    overflow-x: auto;
}

.billing-cart-card .data-table {
    min-width: 700px;
}

.billing-cart-card .data-table th,
.billing-cart-card .data-table td {
    white-space: nowrap;
}


/* ==========================================
BILLING MESSAGE
========================================== */

#billingMessage {
    margin-bottom: 18px;
}


/* ==========================================
RESPONSIVE BILLING
========================================== */

@media (max-width: 1000px) {

    .billing-layout {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 700px) {

    .billing-customer-form {
        grid-template-columns: 1fr;
    }

    .billing-form {
        padding: 18px;
    }

    .billing-customer-form {
        padding: 18px;
    }

    .billing-summary {
        padding: 18px;
    }

}


@media (max-width: 480px) {

    .summary-row {
        align-items: flex-start;
    }

    .summary-row input {
        width: 90px;
    }

    .summary-total strong {
        font-size: 18px;
    }

}