/* ===== PharmaMed Color Scheme (Teal/Green Medical Theme) ===== */
:root {
    --pm-primary: #0d9488;
    --pm-primary-dark: #0f766e;
    --pm-primary-light: #99f6e4;
    --pm-primary-bg: #f0fdfa;
    --pm-secondary: #064e3b;
    --pm-sidebar-bg: #0f172a;
    --pm-sidebar-hover: #1e293b;
    --pm-sidebar-active: #0d9488;
    --pm-sidebar-text: #94a3b8;
    --pm-sidebar-width: 260px;
    --pm-sidebar-collapsed: 0px;
    --pm-body-bg: #f1f5f9;
    --pm-card-bg: #ffffff;
}

/* ===== Global ===== */
body {
    background-color: var(--pm-body-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.text-primary-custom {
    color: var(--pm-primary) !important;
}

.btn-primary-custom {
    background-color: var(--pm-primary);
    border-color: var(--pm-primary);
    color: #fff;
}

.btn-primary-custom:hover {
    background-color: var(--pm-primary-dark);
    border-color: var(--pm-primary-dark);
    color: #fff;
}

.bg-primary-subtle {
    background-color: var(--pm-primary-bg) !important;
}

/* ===== Login Page ===== */
.login-body {
    background: linear-gradient(135deg, var(--pm-primary-bg) 0%, #e0f2fe 50%, var(--pm-primary-bg) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 480px;
    padding: 1rem;
}

.login-card {
    border-radius: 1rem;
    border: none;
}

.login-logo {
    font-size: 3rem;
    color: var(--pm-primary);
    display: block;
    margin-bottom: 0.5rem;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--pm-sidebar-width);
    height: 100vh;
    background-color: var(--pm-sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Thin scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.sidebar.collapsed {
    transform: translateX(calc(-1 * var(--pm-sidebar-width)));
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand i {
    color: var(--pm-primary);
    font-size: 1.6rem;
}

.sidebar-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 0 1rem;
}

.sidebar-nav .nav-header {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1rem 1.5rem 0.4rem;
    list-style: none;
}

.sidebar-nav .nav-link {
    color: var(--pm-sidebar-text);
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    border-radius: 0;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background-color: var(--pm-sidebar-hover);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background-color: var(--pm-sidebar-active);
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

/* ===== Page Content ===== */
.page-content {
    margin-left: var(--pm-sidebar-width);
    width: calc(100% - var(--pm-sidebar-width));
    min-height: 100vh;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.page-content.expanded {
    margin-left: 0;
    width: 100%;
}

/* ===== Top Navbar ===== */
.top-navbar {
    background-color: var(--pm-card-bg);
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-toggle {
    color: #475569;
    text-decoration: none;
    padding: 0.25rem;
}

.sidebar-toggle:hover {
    color: var(--pm-primary);
}

.user-dropdown {
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
}

.user-dropdown:hover {
    color: var(--pm-primary);
}

/* ===== Main Content ===== */
.main-content {
    padding: 1.5rem;
}

/* ===== Stat Cards ===== */
.stat-card {
    border-radius: 0.75rem;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ===== Tables ===== */
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* ===== Cards ===== */
.card {
    border-radius: 0.75rem;
}

.card-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
}

/* ===== Alerts ===== */
.alert {
    border-radius: 0.5rem;
    border: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--pm-sidebar-width)));
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .page-content {
        margin-left: 0;
        width: 100%;
    }
}

/* ===== Pagination ===== */
.pm-pagination .page-link {
    color: var(--pm-primary);
}

.pm-pagination .page-item.active .page-link {
    background-color: var(--pm-primary);
    border-color: var(--pm-primary);
    color: #fff;
}

.pm-pagination .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.25);
}
