:root {
    /* PRIMARY COLORS: Medical Teal & Sky Blue */
    --primary: #0d9488;  /* Teal 600 */
    --primary-dark: #0f766e; /* Teal 700 */
    --secondary: #0ea5e9; /* Sky Blue */
    --warning: #f59e0b; /* Golden Orange */
    --danger: #ef4444; 
    --bg-gradient: linear-gradient(135deg, #f0fdfa 0%, #e2e8f0 100%); /* Light Teal-Grey tint */
    --surface: #ffffff;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --input-bg: #f9fafb;
    --nav-height: 65px;
}

body.dark-mode {
    --primary: #2dd4bf; /* Teal 400 */
    --primary-dark: #14b8a6; /* Teal 500 */
    --secondary: #38bdf8;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --surface: #1e293b;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-light: #94a3b8;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --input-bg: #334155;
}

/* GLOBAL SCALING FIX FOR MOBILE */
html { font-size: 14px; }

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
.hidden { display: none !important; }

body { 
    background: var(--bg-gradient); color: var(--text-main); height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
}

#app-container { 
    flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; background: transparent;
}

/* --- LOCK & STATUS SCREENS --- */
#admin-lock-screen, #status-screen, #login-screen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 10000;
}
#admin-lock-screen { background: #0f172a; color: white; display: flex; align-items: center; justify-content: center; }
#status-screen { background: var(--bg-gradient); color: var(--text-main); display: flex; align-items: center; justify-content: center; }

/* --- MEDICAL STYLE LOGIN REDESIGN --- */
#login-screen {
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.login-header-visual {
    height: 45%; 
    width: 100%;
    background-image: linear-gradient(to bottom, rgba(13, 148, 136, 0.9), rgba(15, 23, 42, 0.6)), url('https://images.unsplash.com/photo-1587854692152-cbe660dbde88?q=80&w=2069&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-overlay {
    text-align: center;
    padding: 20px;
    color: white;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

.logo-icon {
    font-size: 3rem;
    color: #ccfbf1; /* Very light teal */
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.brand-solanacy {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
    text-shadow: 0 4px 6px rgba(0,0,0,0.2);
    font-family: 'Poppins', sans-serif;
}

.brand-tagline {
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.login-bottom-sheet {
    flex: 1;
    background: white;
    margin-top: -30px; /* Overlap effect */
    border-radius: 30px 30px 0 0;
    position: relative;
    z-index: 10;
    padding: 30px 25px 80px 25px; 
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 20px rgba(0,0,0,0.05);
    overflow-y: auto; 
}

.login-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.login-app-title {
    font-size: 1.4rem; 
    font-weight: 600; 
    color: #115e59; /* Dark Teal Text */
    line-height: 1.4;
    margin-bottom: 25px;
    margin-top: 10px;
}

.login-separator {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 25px;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
}

.sep-line {
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.sep-text {
    padding: 0 10px;
}

/* Updated Button Style */
.zomato-btn {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    background: white;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
}

.zomato-btn:active {
    transform: scale(0.98);
    background: #f8fafc;
}

.login-footer-legal {
    margin-top: auto;
    font-size: 0.75rem;
    color: #94a3b8;
    padding-top: 25px;
    padding-bottom: 15px; 
    line-height: 1.5;
    max-width: 300px;
}

.legal-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.legal-link:hover {
    text-decoration: underline;
}

/* --- REGISTRATION SCREEN STYLES --- */

.modal-overlay-fullscreen {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: #ffffff;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.reg-header-visual {
    height: 30%; 
    width: 100%;
    background-image: linear-gradient(135deg, rgba(13, 148, 136, 0.9), rgba(15, 23, 42, 0.8)), url('https://images.unsplash.com/photo-1631549916768-4119b2e5f926?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end; 
    padding: 20px;
}

.reg-overlay-content {
    color: white;
    width: 100%;
    padding-bottom: 40px; 
}

.reg-project-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.reg-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 400;
}

.logout-link-btn-floating {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: 0.2s;
}
.logout-link-btn-floating:hover {
    background: rgba(255,255,255,0.3);
}

.reg-bottom-sheet {
    flex: 1;
    background: #f8fafc; 
    margin-top: -30px;
    border-radius: 24px 24px 0 0;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
}

.reg-form-content {
    flex: 1;
    overflow-y: auto; 
    padding: 30px 20px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title .material-icons-outlined {
    color: var(--primary);
    font-size: 1.2rem;
}

.input-group-modern {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    transition: border-color 0.2s;
}

.input-group-modern:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.1);
}

.input-icon {
    color: #94a3b8;
    margin-right: 12px;
}

.input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.input-wrapper label {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 2px;
}

.input-wrapper input {
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #1e293b;
    width: 100%;
    padding: 0;
}

.pricing-container-horizontal {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    margin: 0 -10px;
    padding: 5px 10px 15px 10px;
}

.pricing-card-modern {
    min-width: 150px;
    flex: 1;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 15px;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pricing-card-modern.selected {
    border-color: var(--primary);
    background: #f0fdfa;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.15);
    transform: translateY(-2px);
}

.check-circle {
    display: none;
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 5;
}

.pricing-card-modern.selected .check-circle {
    display: flex;
}

.check-circle .material-icons-outlined {
    font-size: 16px;
    font-weight: bold;
}

.pricing-card-modern h4 {
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 5px;
}

.price-tag {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}
.price-tag small {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.features-list {
    list-style: none;
    font-size: 0.7rem;
    color: #64748b;
    text-align: left;
    width: 100%;
    margin-top: auto;
    border-top: 1px dashed #e2e8f0;
    padding-top: 8px;
}
.features-list li {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}
.features-list li::before {
    content: "•";
    color: var(--primary);
    margin-right: 5px;
    font-size: 1rem;
    line-height: 0;
}

.badge-pop {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.staff-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
}

.add-staff-btn {
    background: transparent;
    border: 1px dashed var(--primary);
    color: var(--primary);
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: 0.2s;
}
.add-staff-btn:hover {
    background: rgba(13, 148, 136, 0.05);
}

.reg-footer-scrollable {
    margin-top: 20px;
    width: 100%;
    padding-bottom: 20px;
}

.submit-reg-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(13, 148, 136, 0.2);
    transition: transform 0.1s;
}
.submit-reg-btn:active {
    transform: scale(0.98);
}

/* --- GENERAL UI --- */
.login-card { 
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(20px); 
    padding: 3rem 2rem; 
    border-radius: 24px; 
    text-align: center; 
    width: 90%; 
    max-width: 400px; 
    border: 1px solid rgba(255,255,255,0.5); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    color: #1f2937;
}
body.dark-mode .login-card {
    background: rgba(30, 41, 59, 0.9);
    color: #f8fafc;
    border-color: #334155;
}

.lock-content { text-align: center; padding: 2rem; max-width: 400px; width: 90%; }
.lock-icon { font-size: 5rem; color: #ef4444; margin-bottom: 20px; background: rgba(239, 68, 68, 0.1); padding: 20px; border-radius: 50%; }
.lock-content h2 { font-size: 2rem; margin-bottom: 10px; font-weight: 700; }
.lock-content p { color: #94a3b8; margin-bottom: 30px; line-height: 1.6; }
.logout-btn-lock { background: #ef4444; color: white; border: none; padding: 10px 25px; border-radius: 30px; cursor: pointer; font-weight: 600; transition: 0.3s; }

/* --- TOP BAR --- */
.top-bar {
    height: 60px; padding: 0 1rem; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); flex-shrink: 0; 
    z-index: 100;
}
body.dark-mode .top-bar { background: rgba(30, 41, 59, 0.9); }
.header-actions { display: flex; gap: 8px; align-items: center; position: relative; }
.user-profile { display: flex; align-items: center; gap: 10px; max-width: 45%; }
#user-photo { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); flex-shrink: 0;}

.user-details { display: flex; flex-direction: column; overflow: hidden; max-width: 150px; }
#header-company-name { 
    color: var(--primary); font-weight: 700; font-size: 0.9rem; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.role-badge { font-size: 0.65rem; background: var(--primary); color: white; padding: 1px 6px; border-radius: 4px; font-weight: 500; align-self: flex-start; }

/* DROPDOWN & MENU */
.dropdown-menu {
    position: absolute; top: 50px; right: 0;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 200px; padding: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 100;
}
.menu-item-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--input-bg); }
.menu-select { border: none; background: transparent; color: var(--text-main); font-size: 0.9rem; outline: none; width: 100%; cursor: pointer; }
.menu-item-btn { 
    display: flex; align-items: center; gap: 10px; padding: 10px; width: 100%;
    background: transparent; border: none; color: var(--text-main);
    text-align: left; cursor: pointer; font-size: 0.9rem; border-radius: 8px;
}
.menu-item-btn:hover { background: rgba(0,0,0,0.05); }
.icon-btn { background: transparent; border: none; color: var(--text-main); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 5px; }

/* PAGE LAYOUT */
#main-content { flex: 1; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.page-view { height: 100%; display: flex; flex-direction: column; padding: 1rem; max-width: 800px; margin: 0 auto; width: 100%; }

/* --- BILLING PAGE REDESIGN (SPLIT LAYOUT) --- */
.billing-main-layout {
    flex: 1; display: flex; gap: 12px; padding: 5px; overflow: hidden;
}

/* SEARCH BAR FIX */
.search-wrapper { margin: 0 0 10px 0; z-index: 20; position: relative; flex-shrink: 0; }
.search-box { 
    display: flex; align-items: center; background: var(--card-bg); border-radius: 12px; 
    border: 1px solid var(--border); box-shadow: var(--shadow); padding: 0 8px 0 4px;
    height: 50px;
}
#medicine-search { 
    flex: 1; border: none; background: transparent; padding: 10px; outline: none; font-size: 0.95rem; color: var(--text-main); 
    min-width: 0; /* Prevents input from pushing icon out */
}
.scan-trigger { 
    background: var(--primary); color: white; border: none; width: 40px; height: 40px; border-radius: 10px; 
    cursor: pointer; display:flex; align-items:center; justify-content:center; flex-shrink: 0; margin: 4px;
}
.search-icon { flex-shrink: 0; color: var(--text-light); } 

.dropdown-results { position: absolute; top: 110%; left: 0; width: 100%; background: var(--card-bg); border: 1px solid var(--border); max-height: 250px; overflow-y: auto; border-radius: 12px; box-shadow: var(--shadow); z-index: 50; }
.search-item { padding: 12px 15px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.search-item:hover { background: rgba(var(--primary), 0.05); }

/* Left Card (Items) */
.billing-left-card {
    flex: 1.2; background: var(--card-bg); border-radius: 16px; border: 1px solid var(--border);
    display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow);
}

/* Right Card (Summary) */
.billing-right-card {
    flex: 0.8; background: var(--card-bg); border-radius: 16px; border: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 15px; box-shadow: var(--shadow);
}

.bill-header { padding: 12px 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.bill-header h2 { font-size: 1rem; color: var(--text-main); font-weight: 700; }
.text-danger-btn { background: transparent; border: none; color: var(--danger); cursor: pointer; padding: 5px; }
.resume-btn { background: transparent; border: 1px solid var(--primary); color: var(--primary); padding: 5px 12px; border-radius: 20px; cursor: pointer; display: flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 500; }

.bill-items-header { 
    padding: 8px 15px; background: rgba(128,128,128,0.03); display: grid; grid-template-columns: 2fr 0.8fr 1fr 30px; 
    font-size: 0.75rem; font-weight: 600; color: var(--text-light); text-transform: uppercase;
}

.scrollable-list { flex: 1; overflow-y: auto; padding: 0 10px; }
.cart-item { 
    display: grid; grid-template-columns: 2fr 0.8fr 1fr 30px; padding: 10px 5px; border-bottom: 1px solid var(--border); align-items: center; font-size: 0.9rem;
}
.cart-item input { width: 45px; padding: 4px; border-radius: 6px; border: 1px solid var(--border); text-align: center; background: var(--input-bg); color: var(--text-main); font-size: 0.9rem; }

.empty-cart-visual {
    height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-light); opacity: 0.5; padding: 20px; text-align: center;
}
.empty-cart-visual span { font-size: 3rem; margin-bottom: 10px; }
.empty-cart-visual p { font-size: 0.9rem; }
.empty-cart { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-light); opacity: 0.7; }

/* Summary Styling */
.summary-title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin-bottom: 15px; }
.summary-rows { flex: 1; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.85rem; color: var(--text-light); }
.summary-row b, .summary-row span:last-child { color: var(--text-main); font-weight: 600; }
.summary-row.divider { border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 8px; }
.discount-row { color: var(--primary) !important; font-weight: 600; }
.discount-row span:last-child { color: var(--primary) !important; }

.icon-edit-btn { background: rgba(13, 148, 136, 0.1); border: none; color: var(--primary); padding: 2px 5px; border-radius: 6px; cursor: pointer; display: flex; margin-left: 5px; }
.icon-edit-btn span { font-size: 1rem; }

.grand-total-section { 
    margin: 15px 0; padding: 15px 0; border-top: 2px solid var(--border); display: flex; justify-content: space-between; align-items: center;
}
.grand-total-section span:first-child { font-size: 1rem; font-weight: 800; color: var(--primary); letter-spacing: 0.5px; }
#cart-total { font-size: 1.5rem; font-weight: 800; color: var(--primary); }

.summary-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto;}
.btn-hold-modern { 
    background: var(--warning); color: white; border: none; padding: 12px; border-radius: 10px; 
    font-weight: 700; font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}
.btn-print-modern { 
    background: var(--primary); color: white; border: none; padding: 12px; border-radius: 10px; 
    font-weight: 700; font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

/* INVENTORY & ANALYTICS */
.page-header { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.action-btn { background: var(--primary); color: white; border: none; padding: 8px 16px; border-radius: 10px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9rem; }
.table-wrapper { flex: 1; overflow: auto; background: var(--card-bg); border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; }
table { width: 100%; border-collapse: collapse; min-width: 100%; } 
thead th { position: sticky; top: 0; background: var(--card-bg); z-index: 5; padding: 10px; text-align: left; border-bottom: 2px solid var(--border); color: var(--text-light); font-weight: 600; white-space: nowrap; font-size: 0.85rem; }
tbody td { padding: 10px; border-bottom: 1px solid var(--border); color: var(--text-main); font-size: 0.85rem; vertical-align: middle; }
.icon-action { padding: 5px; border-radius: 8px; border: none; cursor: pointer; background: transparent; }
.edit-btn { color: var(--primary); }
.del-btn { color: var(--danger); }
.analytics-scroll-container { flex: 1; overflow-y: auto; padding-bottom: 20px; }
.filter-container { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 15px; scrollbar-width: none; }
.filter-btn { white-space: nowrap; padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text-light); font-size: 0.85rem; cursor: pointer; }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.dashboard-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.card { background: var(--card-bg); padding: 20px; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; align-items: center; gap: 15px; }
.icon-box { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.total-sales .icon-box { background: rgba(79, 70, 229, 0.1); color: var(--primary); }
.total-orders .icon-box { background: rgba(236, 72, 153, 0.1); color: var(--secondary); }
.glass-card { background: var(--card-bg); padding: 20px; border-radius: 16px; border: 1px solid var(--border); margin-bottom: 20px; box-shadow: var(--shadow); }

/* MISC & UTILS */
.pdf-btn, .wp-btn { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--input-bg); cursor: pointer; display: flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 500; transition: 0.2s; }
.pdf-btn:hover { background: #e0e7ff; color: var(--primary); }
.wp-btn { color: #25D366; border-color: #25D366; background: rgba(37, 211, 102, 0.1); }
#bottom-nav { height: 65px; background: rgba(255, 255, 255, 0.95); border-top: 1px solid var(--border); display: flex; flex-shrink: 0; z-index: 50; }
body.dark-mode #bottom-nav { background: rgba(30, 41, 59, 0.95); }
.nav-item { flex: 1; border: none; background: transparent; color: var(--text-light); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; }
.nav-item.active { color: var(--primary); }
.developer-credit { text-align: center; font-size: 0.75rem; color: var(--text-light); padding: 8px 0; width: 100%; opacity: 0.8; letter-spacing: 0.5px; font-weight: 500; flex-shrink: 0; }

/* MODALS */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 100; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-box { background: var(--card-bg); width: 90%; max-width: 450px; border-radius: 24px; padding: 1.5rem; border: 1px solid var(--border); box-shadow: 0 10px 25px rgba(0,0,0,0.2); max-height: 90vh; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-shrink: 0; }
.close-icon { background: rgba(128,128,128,0.1); border: none; border-radius: 50%; padding: 5px; cursor: pointer; }
.input-group { margin-bottom: 15px; }
.full-input { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--input-bg); color: var(--text-main); font-size: 1rem; }
.row-group { display: flex; gap: 15px; margin-bottom: 15px; }
.modal-primary-btn { width: 100%; background: var(--primary); color: white; padding: 14px; border: none; border-radius: 12px; font-weight: 600; font-size: 1rem; cursor: pointer; margin-top: 10px; }
.camera-container { width: 100%; height: 350px; background: #000; border-radius: 16px; position: relative; overflow: hidden; margin-bottom: 15px; flex-shrink: 0; }
#camera-feed { width: 100%; height: 100%; object-fit: cover; }
#capture-canvas { position: absolute; top:0; left:0; width:100%; height:100%; object-fit: cover; z-index: 2; }
.scanner-controls { text-align: center; }
.google-btn.old { width: 100%; padding: 14px; display: flex; align-items: center; justify-content: center; gap: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); cursor: pointer; margin-top: 25px; font-weight: 500; font-size: 1rem; box-shadow: var(--shadow); }
.warning-box { border-left: 5px solid var(--warning); }
.warning-header h3 { color: var(--warning); display: flex; align-items: center; gap: 10px; }

/* --- SUPER ADMIN & PRICING STYLES --- */
#sa-notif-badge { position: absolute; top: 0; right: 0; width: 10px; height: 10px; background: #ef4444; border-radius: 50%; border: 2px solid var(--card-bg); }

.pricing-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 12px; 
    margin-top: 10px; 
    margin-bottom: 20px; 
}

.pricing-card { 
    border: 2px solid var(--border); 
    padding: 15px; 
    border-radius: 16px; 
    cursor: pointer; 
    position: relative; 
    background: var(--input-bg); 
    transition: 0.2s; 
    text-align: center; 
    display: flex;
    flex-direction: column;
}

.pricing-card:hover { 
    border-color: var(--primary); 
    background: rgba(79, 70, 229, 0.05); 
}

.selected-plan {
    border-color: #2563eb !important; 
    background: rgba(37, 99, 235, 0.08) !important;
}

.pricing-card.popular {
    border-color: #eab308;
}
.pricing-card .badge { 
    position: absolute; 
    top: -10px; 
    left: 50%;
    transform: translateX(-50%);
    background: #eab308; 
    color: black; 
    font-size: 0.65rem; 
    padding: 2px 10px; 
    border-radius: 10px; 
    font-weight: 800; 
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pricing-card h4 { 
    margin-bottom: 5px; 
    color: var(--text-main); 
    font-weight: 700;
}

.pricing-card .price { 
    font-weight: 800; 
    color: var(--primary); 
    font-size: 1.4rem;
    margin-bottom: 10px;
}
.pricing-card .price span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
}

.plan-features {
    list-style: none;
    text-align: left;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: auto;
}
.plan-features li {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}
.plan-features li .material-icons-outlined {
    font-size: 0.9rem;
    color: var(--primary);
}

.sa-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.sa-tab { flex: 1; background: transparent; border: none; padding: 10px; color: var(--text-light); cursor: pointer; border-bottom: 2px solid transparent; font-weight: 500; }
.sa-tab.active { color: #eab308; border-bottom-color: #eab308; }
.badge-count { background: #ef4444; color: white; padding: 1px 5px; border-radius: 6px; font-size: 0.7rem; margin-left: 5px; }
.client-item { background: var(--input-bg); padding: 15px; border-radius: 12px; margin-bottom: 10px; border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.client-item:hover { background: rgba(0,0,0,0.05); }

.client-status { font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; font-weight: 600; }
.status-active { background: #dcfce7; color: #166534; }
.status-pending { background: #fef9c3; color: #854d0e; }
.status-rejected { background: #fee2e2; color: #991b1b; }

.logout-link-btn { background: transparent; border: none; color: var(--danger); text-decoration: underline; cursor: pointer; }
.sa-controls { max-height: 70vh; overflow-y: auto; }

/* NEW: V3.3.0 Styles */
.switch-label { display: flex; align-items: center; cursor: pointer; gap: 10px; }
.switch-input { display: none; }
.slider { position: relative; width: 50px; height: 26px; background: #ccc; border-radius: 34px; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background: white; border-radius: 50%; transition: .4s; }
.switch-input:checked + .slider { background: #22c55e; }
.switch-input:checked + .slider:before { transform: translateX(24px); }

.apikey-item {
    background: var(--card-bg); border: 1px solid var(--border); padding: 15px;
    border-radius: 12px; margin-bottom: 10px; display: flex; justify-content: space-between;
    align-items: center; cursor: pointer; transition: 0.2s;
}
.apikey-item:hover { border-color: var(--primary); }
.key-limit-bar { height: 6px; width: 100%; background: #eee; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.key-fill { height: 100%; transition: width 0.3s ease; }

.key-status-red { border-left: 5px solid var(--danger); }
.key-status-green { border-left: 5px solid #22c55e; }

/* Super Admin Nav adjustments */
#sa-bottom-nav .nav-item.active span { color: #eab308; }
#sa-bottom-nav .nav-item span { font-size: 0.8rem; }

/* NOTIFICATIONS & BROADCAST */
.notif-item {
    padding: 12px; 
    border-bottom: 1px solid var(--border); 
    cursor: default;
    position: relative;
}
.notif-item:last-child { border-bottom: none; }

.notif-broadcast { 
    background: rgba(79, 70, 229, 0.05); 
    border-left: 4px solid var(--primary); 
}

/* ALERTS */
.alert-red {
    background: #fee2e2; 
    border-left: 4px solid #ef4444; 
    color: #991b1b;
}

.alert-yellow {
    background: #fef9c3; 
    border-left: 4px solid #eab308; 
    color: #854d0e;
}

.msg-bubble {
    padding: 10px; border-radius: 10px; background: var(--input-bg); margin-bottom: 8px;
    font-size: 0.9rem; border: 1px solid var(--border);
}
.msg-time { font-size: 0.7rem; color: var(--text-light); display: block; margin-top: 4px; text-align: right; }

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.pulse-badge {
    animation: pulse-red 2s infinite;
}

/* --- SCROLLABLE MEDICINE MODAL FIX --- */
#medicine-form {
    flex: 1;              
    overflow-y: auto;     
    padding-right: 5px;   
    margin-bottom: 5px;
    scrollbar-width: thin; 
    scrollbar-color: var(--primary) transparent;
}
#medicine-form::-webkit-scrollbar { width: 6px; }
#medicine-form::-webkit-scrollbar-thumb { background-color: var(--primary); border-radius: 10px; }
.scrollable-modal { display: flex; flex-direction: column; max-height: 85vh; }

/* RESPONSIVE LOGIC (FIXED) */
@media(max-width: 768px) {
    /* STACKED Layout for Mobile but cleaner */
    .billing-main-layout { flex-direction: column; overflow-y: auto; }
    
    /* LEFT CARD (Invoice Items) - Increased Size */
    .billing-left-card { min-height: 55vh; } /* Much Taller */
    
    /* RIGHT CARD (Summary) - Increased Size */
    .billing-right-card { flex: none; margin-bottom: 20px; min-height: 30vh; }
    
    /* Make buttons bigger for touch */
    .btn-hold-modern, .btn-print-modern { padding: 14px; }
    
    .developer-credit { padding-bottom: 20px; }
}

@media(min-width: 768px) {
    /* DESKTOP/TABLET SIDE BY SIDE */
    html { font-size: 16px; } /* Reset font size for desktop */
    #app-container { margin: 25px; border-radius: 24px; height: calc(100vh - 50px); }
    #bottom-nav { position: static; height: 100%; width: 90px; flex-direction: column; border-top: none; border-left: 1px solid var(--border); order: 2; padding-top: 80px; }
    #sa-bottom-nav { position: static; height: 100%; width: 90px; flex-direction: column; border-top: none; border-left: 1px solid var(--border); order: 2; padding-top: 80px; }
    .top-bar { position: absolute; top: 0; left: 0; right: 0; width: calc(100% - 90px); border-radius: 24px 0 0 0; height: 60px;}
    #main-content { margin-top: 60px; width: 100%; }
    
    /* Better spacing on large screens */
    .billing-main-layout { gap: 20px; padding: 15px; }
    .billing-right-card { padding: 25px; }
}

/* --- PROFILE DASHBOARD --- */

.profile-header-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.profile-header-card::before {
    content: '';
    position: absolute;
    top: -50px; left: -50px;
    width: 100px; height: 100px;
    background: var(--primary);
    opacity: 0.1;
    border-radius: 50%;
    filter: blur(40px);
}

.profile-image-container {
    width: 110px;
    height: 110px;
    margin-bottom: 15px;
    position: relative;
    padding: 4px;
    border: 2px dashed var(--primary);
    border-radius: 50%;
}

#profile-pic-large {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--card-bg);
    background: var(--input-bg);
}

#profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

#profile-email {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.profile-menu-list {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 5px 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
}

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

.profile-menu-item:active {
    transform: scale(0.98);
}

.p-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.2rem;
}

.p-text { flex: 1; }
.p-text h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-main); margin-bottom: 2px; }
.p-text p { font-size: 0.75rem; color: var(--text-light); }

.arrow { color: var(--text-light); font-size: 1.2rem; }

.profile-select {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
    outline: none;
    width: 100%;
    cursor: pointer;
    appearance: none;
}