:root {
    --primary-dark: #071f3a;
    --primary-blue: #0b2f56;
    --accent-yellow: #f5b027;
    --bg-light: #f4f7f9;
    --text-main: #333333;
    --text-muted: #6b7280;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --input-bg: #eef2f6;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --gradient-blue: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --gradient-blue-hover: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

/* Navbar */
.navbar {
    background-color: var(--primary-dark);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 4rem;
    border-bottom: 3px solid var(--accent-yellow);
}

.navbar .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--bg-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.navbar .logo span {
    color: #4CAF50; /* The green medical icon color */
}

.menu-toggle {
    display: none;
}

.menu-toggle {
    display: none;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.navbar-links a:hover {
    color: var(--accent-yellow);
}

.btn-outline {
    border: 1px solid var(--white);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
}
.btn-outline:hover {
    background-color: var(--white);
    color: var(--primary-dark);
}

/* Main Content Area */
main {
    flex: 1;
}

/* Footer Placeholder */
.footer {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 4rem 4rem 2rem 4rem;
    margin-top: 4rem;
}

/* Authentication Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px); /* Minus navbar approx */
    padding: 2rem;
}

.auth-card {
    background-color: var(--white);
    width: 100%;
    max-width: 450px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
}

.auth-header {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 3rem 2rem;
    text-align: center;
}

.auth-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.auth-header p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.auth-body {
    padding: 2.5rem 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 1rem;
    color: var(--text-main);
    transition: border-color 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-dark);
    background-color: var(--white);
}

.btn-primary {
    width: 100%;
    display: block;
    background-color: var(--primary-dark);
    color: var(--white);
    border: none;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-blue);
}

.auth-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--text-muted);
}
.auth-footer a:hover {
    color: var(--primary-dark);
}
.auth-footer a.font-semibold {
    font-weight: 700;
    color: var(--primary-dark);
}

/* Page Headers */
.page-header {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 6rem 2rem;
    text-align: center;
    border-bottom: 3px solid var(--accent-yellow);
}
.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}
.page-header p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    color: rgba(255,255,255,0.8);
}

/* Product Catalog Grid */
.catalog-container {
    display: flex;
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
    gap: 3rem;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.sidebar h3 {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.sidebar-search {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 1rem;
    background-color: transparent;
}

.category-list {
    display: flex;
    flex-direction: column;
}

.category-item {
    padding: 1rem;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.category-item:hover, .category-item.active {
    background-color: var(--primary-dark);
    color: var(--white);
}

.main-content {
    flex: 1;
}

.page-title {
    font-size: 2rem;
    color: var(--primary-dark);
    font-weight: 800;
    margin-bottom: 2rem;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.card-img {
    height: 200px;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-img img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.2rem;
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex: 1;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-secondary {
    display: block;
    width: 100%;
    padding: 0.8rem;
    text-align: center;
    background-color: transparent;
    color: var(--primary-dark);
    border: 1px solid var(--border-color);
    font-weight: 600;
    border-radius: 6px;
}
.btn-secondary:hover {
    background-color: var(--bg-light);
}

/* ==================================
   ADMIN DASHBOARD STYLES
   ================================== */
.admin-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: #f8fafc;
    font-family: var(--font-family);
}

/* Admin Sidebar */
.admin-sidebar {
    width: 280px;
    background-color: #1e293b;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.admin-logo {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
    padding-left: 0.5rem;
}

.admin-logo .icon {
    color: #4CAF50;
    font-size: 1.5rem;
}

.sidebar-menu {
    padding: 0;
}

.menu-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin: 1.5rem 0 0.5rem 1rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: #64748b;
}

.menu-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: var(--white);
}

.menu-item.active {
    background-color: #334155;
    color: var(--white);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.menu-item.active i {
    color: var(--accent-yellow);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Admin Main Content */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Admin Topnav */
.admin-topnav {
    height: 80px;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    flex-shrink: 0;
}

.page-title-admin {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.topnav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
}

.user-info .name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-dark);
}

.user-info .role {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #22c55e; /* Matching the green in avatar icon if it was an image */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: none;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Admin Content Area */
.admin-content-area {
    flex: 1;
    padding: 0 3rem 3rem 3rem;
    overflow-y: auto;
}

/* Dashboard Cards */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background-color: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}
.stat-card.dark {
    background-color: #0f172a;
    color: var(--white);
    border: none;
}

.stat-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}
.stat-card.dark .stat-icon-wrapper {
    background-color: rgba(255,255,255,0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1;
    color: #000;
}
.stat-card.dark .stat-value {
    color: var(--white);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick Actions & System Health */
.dashboard-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.admin-panel {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.admin-panel-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.admin-panel-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background-color: #3b82f6;
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.admin-table.dark-header th {
    background-color: var(--primary-dark);
    color: var(--white);
}

.admin-table td {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-main);
}
.admin-table tr:last-child td {
    border-bottom: none;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--primary-dark);
    background: transparent;
    cursor: pointer;
    margin-right: 0.5rem;
}
.action-btn:hover {
    background-color: var(--bg-light);
}

.flex-btn-group {
    display: flex;
    gap: 1rem;
}

.btn-admin {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
.btn-admin:hover {
    background-color: var(--bg-light);
}
.btn-admin-primary {
    background-color: var(--primary-dark);
    color: var(--white);
    border-color: var(--primary-dark);
}
.btn-admin-primary:hover {
    background-color: var(--primary-blue);
}

/* Refined Sidebar Active State */
.menu-item.active {
    background-color: #1e293b;
    color: var(--white);
    border-left: 4px solid #facc15; /* Yellow/Gold vertical line */
}

.menu-item.active i {
    color: var(--white);
}

/* Integrated Search Bar */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Rounded Square Action Buttons with Specific Borders */
.action-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.action-box:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.action-box.view { border-color: #fbd5ce; }
.action-box.edit { border-color: #fef08a; }
.action-box.delete { border-color: #cbd5e1; }

.action-box.view i { color: #f97316; }
.action-box.edit i { color: #eab308; }
.action-box.delete i { color: #64748b; }
/* ==================================
   RESPONSIVENESS (MOBILE & TABLET)
   ================================== */
@media (max-width: 1024px) {
    .stat-cards-grid { grid-template-columns: repeat(3, 1fr); }
    .navbar { padding: 1rem 2rem; }
    .catalog-container { flex-direction: column; }
    .sidebar { width: 100%; }
}

@media (max-width: 768px) {
    /* Navbar Mobile */
    .navbar { padding: 1rem 1.5rem; position: relative; }
    .desktop-only { display: none !important; }
    
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        color: #fff;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }

    .navbar-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
        z-index: 1000;
        border-bottom: 2px solid var(--accent-yellow);
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }
    .navbar-links.active { display: flex; }
    .btn-outline { width: 100%; text-align: center; }

    /* Hero Slider Mobile */
    .hero-slider { height: 450px !important; }
    .hero-slider h1 { font-size: 2rem !important; }
    .hero-slider p { font-size: 1rem !important; }

    /* Grids Mobile */
    .grid-cards { grid-template-columns: 1fr; }
    [style*="grid-template-columns: repeat(5, 1fr)"],
    [style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
    [style*="display: grid; grid-template-columns: 1fr 1fr;"] {
        grid-template-columns: 1fr !important;
    }

    /* About Responsiveness */
    [style*="grid-template-columns: 1.1fr 1fr;"],
    [style*="grid-template-columns: 1fr 1fr;"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Admin Responsiveness */
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: relative; padding: 1rem; }
    .admin-logo { padding-bottom: 1rem; }
    .admin-topnav { padding: 0 1.5rem; height: 60px; }
    .admin-content-area { padding: 1.5rem; }
    .stat-cards-grid { grid-template-columns: 1fr; }
    .dashboard-grid-2 { grid-template-columns: 1fr; }
    
    .admin-table-wrapper { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }

    /* Utility Classes */
    .flex-between-responsive {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.5rem !important;
    }
    .flex-between-responsive > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }
    .flex-between-responsive .search-input-harden {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .page-header h1 { font-size: 1.8rem; }
    .hero-slider h1 { font-size: 1.5rem !important; }
    .admin-panel { padding: 1rem !important; }
}

/* Helper Class for Mobile Tables */
.admin-table { min-width: 600px; }
