/* =========================================================
   GPharms Design System
   Shared theme for Owner Console + Pharmacy App + Guest pages
   ========================================================= */

:root {
    --pri: #0d9488;
    --pri-dk: #0f766e;
    --pri-lt: #ccfbf1;
    --pri-50: #f0fdfa;
    --sec: #6366f1;
    --acc: #f59e0b;
    --ok: #10b981;
    --err: #ef4444;
    --warn: #f59e0b;
    --info: #3b82f6;

    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-bg-2: #1e293b;
    --sidebar-active: #2dd4bf;
    --sidebar-text: #cbd5e1;
    --sidebar-text-muted: #64748b;

    /* Surfaces (light mode defaults) */
    --bg-body: #f5f7fa;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e5e9ef;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
}

html[data-theme="dark"] {
    --bg-body: #0b1220;
    --bg-surface: #131c2e;
    --bg-surface-alt: #18233a;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #243049;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    text-decoration: none;
}

/* ---------- Cards ---------- */
.card,
.gp-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.gp-card-lg {
    box-shadow: var(--shadow-md);
}

/* ---------- Buttons ---------- */
.btn-primary {
    background-color: var(--pri);
    border-color: var(--pri);
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--pri-dk);
    border-color: var(--pri-dk);
}
.btn-outline-primary {
    color: var(--pri);
    border-color: var(--pri);
}
.btn-outline-primary:hover {
    background-color: var(--pri);
    border-color: var(--pri);
}

.text-pri { color: var(--pri); }
.bg-pri { background-color: var(--pri); }

/* ---------- Guest / Auth Layout ---------- */
.gp-guest-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pri-50) 0%, #e0f2fe 100%);
    padding: 24px;
}
html[data-theme="dark"] .gp-guest-wrapper {
    background: linear-gradient(135deg, #0b1220 0%, #0f172a 100%);
}

.gp-guest-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
}

.gp-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--pri-dk);
}
html[data-theme="dark"] .gp-logo {
    color: var(--sidebar-active);
}
.gp-logo .gp-logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--pri);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* ---------- Dashboard Shell ---------- */
.gp-app {
    display: flex;
    min-height: 100vh;
}

.gp-sidebar {
    width: 260px;
    flex-shrink: 0;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.25s ease;
}

.gp-sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.gp-sidebar-header .gp-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--sidebar-bg-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-active);
    font-size: 1.2rem;
}

.gp-sidebar-header .gp-brand-name {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gp-sidebar-header .gp-brand-sub {
    color: var(--sidebar-text-muted);
    font-size: 0.75rem;
}

.gp-nav {
    flex: 1;
    padding: 0.75rem 0.75rem 1.5rem;
}

.gp-nav-section-title {
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: var(--sidebar-text-muted);
    font-weight: 700;
    margin: 1.1rem 0.6rem 0.4rem;
}
.gp-nav-section-title:first-child {
    margin-top: 0.4rem;
}

.gp-nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.89rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.gp-nav-link i {
    width: 18px;
    text-align: center;
    color: var(--sidebar-text-muted);
    transition: color 0.15s ease;
}

.gp-nav-link:hover {
    background-color: var(--sidebar-bg-2);
    color: #fff;
}
.gp-nav-link:hover i {
    color: var(--sidebar-active);
}

.gp-nav-link.active {
    background-color: var(--sidebar-bg-2);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--sidebar-active);
}
.gp-nav-link.active i {
    color: var(--sidebar-active);
}

.gp-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.gp-topbar {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.gp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.gp-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface-alt);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}
.gp-icon-btn:hover {
    background-color: var(--pri-lt);
    color: var(--pri-dk);
}

.gp-notif-dot {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 8px;
    height: 8px;
    background-color: var(--err);
    border-radius: 50%;
    border: 1.5px solid var(--bg-surface);
}

.gp-content {
    padding: 1.5rem;
    flex: 1;
}

.gp-page-header {
    margin-bottom: 1.25rem;
}

.gp-page-title {
    font-weight: 800;
    font-size: 1.4rem;
    margin: 0;
}

.gp-breadcrumb {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.gp-breadcrumb a {
    color: var(--text-muted);
}
.gp-breadcrumb a:hover {
    color: var(--pri);
}

.gp-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-main);
    cursor: pointer;
}

.gp-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1030;
}

@media (max-width: 991.98px) {
    .gp-sidebar {
        transform: translateX(-100%);
    }
    .gp-sidebar.show {
        transform: translateX(0);
    }
    .gp-main {
        margin-left: 0;
    }
    .gp-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    body.gp-sidebar-open .gp-sidebar-backdrop {
        display: block;
    }
}

/* ---------- Stat Card ---------- */
.gp-stat-card {
    border-radius: var(--radius);
    padding: 1.25rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gp-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.gp-stat-value {
    font-weight: 800;
    font-size: 1.4rem;
    line-height: 1.2;
}

.gp-stat-title {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

/* ---------- Theme toggle ---------- */
.gp-theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface-alt);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.gp-theme-toggle:hover {
    background-color: var(--pri-lt);
    color: var(--pri-dk);
}

/* ---------- Misc ---------- */
.gp-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--pri-lt);
    color: var(--pri-dk);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.alert {
    border-radius: var(--radius-sm);
}
