/* ============================================================================
   Super Pharm — design system (enterprise)
   ============================================================================ */
:root {
    /* Brand green scale */
    --sp-900: #0A4A24;
    --sp-800: #0C5C2C;   /* "Super" dark */
    --sp-700: #12813C;
    --sp-600: #178C41;
    --sp-500: #1E9E48;   /* primary — "Pharm" */
    --sp-400: #37B457;
    --sp-300: #6CC24A;   /* lime accent */
    --sp-200: #AEE0B6;
    --sp-100: #D6F0DA;
    --sp-50:  #EAF7EC;
    --sp-gradient: linear-gradient(135deg, #0B7A2E 0%, #22A048 52%, #7ECB43 100%);
    --sp-gradient-soft: linear-gradient(135deg, #F3FBF4 0%, #E7F6EB 100%);

    /* Neutrals */
    --ink: #0F1B14;
    --text: #1F2A24;
    --muted: #5C6B62;
    --faint: #8A968E;
    --line: #E4EAE6;
    --line-soft: #EFF3F0;
    --bg: #FFFFFF;
    --bg-soft: #F5F8F6;
    --bg-mint: #EDF7F0;

    /* Semantic */
    --danger: #C0392B;
    --danger-bg: #FCECEA;
    --warn: #B7791F;
    --warn-bg: #FBF3E2;
    --ok: var(--sp-500);
    --ok-bg: var(--sp-50);

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(16, 40, 25, .06);
    --shadow-sm: 0 2px 6px rgba(16, 40, 25, .07);
    --shadow: 0 6px 22px rgba(16, 40, 25, .09);
    --shadow-lg: 0 20px 48px rgba(16, 40, 25, .14);
    --shadow-brand: 0 14px 34px rgba(20, 130, 60, .28);

    /* Shape */
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 18px;
    --r-xl: 26px;
    --r-pill: 999px;

    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--sp-600); text-decoration: none; }
a:hover { color: var(--sp-800); }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .6rem; }
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
code { font-family: "Cascadia Code", "Consolas", ui-monospace, monospace; font-size: .88em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Brand logo lockup ---------- */
.brand-lockup { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-lockup .mark { width: 38px; height: 38px; flex: none; }
.brand-lockup .word { display: flex; flex-direction: column; line-height: 1; }
.brand-lockup .word b { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.brand-lockup .word b .p { color: var(--sp-500); }
.brand-lockup .word b .s { color: var(--sp-800); }
.brand-lockup .word small { font-size: .62rem; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; margin-top: 2px; }

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .68rem 1.35rem; border-radius: var(--r-pill);
    border: 1.5px solid transparent; font: inherit; font-weight: 650; font-size: .96rem;
    cursor: pointer; text-decoration: none; transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sp-gradient); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { color: #fff; filter: brightness(1.05); box-shadow: 0 18px 40px rgba(20,130,60,.34); }
.btn-outline { border-color: var(--sp-300); color: var(--sp-700); background: #fff; }
.btn-outline:hover { border-color: var(--sp-500); color: var(--sp-800); background: var(--sp-50); }
.btn-ghost { color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--bg-soft); color: var(--sp-800); }
.btn-block { width: 100%; }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }
.btn.danger { color: var(--danger); border-color: transparent; }
.btn.danger:hover { background: var(--danger-bg); }

.link-button { background: none; border: none; padding: 0; font: inherit; color: var(--sp-600); cursor: pointer; }
.link-button:hover { color: var(--sp-800); text-decoration: underline; }
.link-button.danger { color: var(--danger); }
.inline-form { display: inline; }

/* ============================================================================
   Public / marketing shell
   ============================================================================ */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.site-header .nav { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { color: var(--text); font-weight: 550; font-size: .95rem; }
.nav-links a:hover { color: var(--sp-700); }

.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 2.5rem 0; color: var(--muted); font-size: .9rem; margin-top: 4rem; }
.site-footer .foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

.main { min-height: 60vh; }

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden;
    background: radial-gradient(1200px 500px at 15% -10%, #EAF7EC 0%, rgba(234,247,236,0) 60%),
                radial-gradient(900px 500px at 100% 0%, #E4F5EA 0%, rgba(228,245,234,0) 55%), #fff;
    padding: 4.5rem 0 3.5rem;
}
.hero::before {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(30,158,72,.10) 1px, transparent 1px);
    background-size: 22px 22px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%); mask-image: linear-gradient(180deg, #000, transparent 70%);
    opacity: .5; pointer-events: none;
}
.hero .container { position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center; }
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .85rem; border-radius: var(--r-pill);
    background: #fff; border: 1px solid var(--sp-200); color: var(--sp-700); font-weight: 650; font-size: .82rem; box-shadow: var(--shadow-xs);
}
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sp-400); box-shadow: 0 0 0 4px var(--sp-100); }
.hero h1 { margin: 1.1rem 0 .8rem; }
.hero h1 .grad { background: var(--sp-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.18rem; color: var(--muted); max-width: 34ch; margin-bottom: 1.8rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-trust { margin-top: 1.6rem; color: var(--faint); font-size: .85rem; display: flex; align-items: center; gap: .5rem; }

/* Hero visual card */
.hero-visual {
    position: relative; border-radius: var(--r-xl); padding: 1.4rem;
    background: linear-gradient(160deg, #fff, #F5FBF6); border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
}
.hero-visual .mark-xl { width: 92px; height: 92px; margin: .5rem auto 1rem; display: block; }
.hero-visual .vtitle { text-align: center; font-weight: 800; font-size: 1.5rem; color: var(--sp-800); }
.hero-visual .vtitle .p { color: var(--sp-500); }
.hero-visual .vsub { text-align: center; color: var(--muted); font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 1.3rem; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.pillar { text-align: center; padding: .7rem .3rem; border-radius: var(--r); }
.pillar .ic { width: 34px; height: 34px; margin: 0 auto .45rem; display: grid; place-items: center; border-radius: 10px; background: var(--sp-50); color: var(--sp-600); }
.pillar b { display: block; font-size: .8rem; color: var(--ink); }
.pillar span { font-size: .72rem; color: var(--muted); }

/* ============================================================================
   Sections / feature grid
   ============================================================================ */
section.block { padding: 4rem 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.section-head .kicker { color: var(--sp-600); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }
.section-head h2 { margin-top: .4rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.feature-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.6rem;
    transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--sp-200); }
.feature-card .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--sp-gradient); color: #fff; margin-bottom: 1rem; box-shadow: var(--shadow-brand); }
.feature-card h3 { margin-bottom: .3rem; }
.feature-card p { color: var(--muted); margin: 0; font-size: .95rem; }

/* ---------- Plans ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; max-width: 980px; margin: 0 auto; }
.plan-card {
    position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: 2rem 1.8rem;
    display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .2s ease;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan-card.featured { border: none; background: var(--sp-gradient); color: #fff; box-shadow: var(--shadow-lg); }
.plan-card.featured h3, .plan-card.featured .plan-price { color: #fff; }
.plan-card.featured .plan-period, .plan-card.featured .plan-features li { color: rgba(255,255,255,.9); }
.plan-card.featured .plan-features li::before { color: #fff; }
.plan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--sp-800); color: #fff; padding: .3rem .9rem; border-radius: var(--r-pill); font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.plan-card h3 { font-size: 1.3rem; }
.plan-price { font-size: 2.3rem; font-weight: 820; color: var(--ink); margin: .3rem 0 .2rem; letter-spacing: -.02em; }
.plan-price .cur { font-size: 1rem; font-weight: 600; color: var(--muted); }
.plan-period { color: var(--muted); font-size: .9rem; margin-bottom: 1.4rem; }
.plan-features { list-style: none; padding: 0; margin: 0 0 1.8rem; flex: 1; }
.plan-features li { padding: .5rem 0 .5rem 1.7rem; position: relative; border-bottom: 1px solid var(--line-soft); font-size: .94rem; }
.plan-card.featured .plan-features li { border-color: rgba(255,255,255,.18); }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--sp-500); font-weight: 800; }
.plan-card.featured .btn-outline { border-color: rgba(255,255,255,.6); color: #fff; background: rgba(255,255,255,.12); }
.plan-card.featured .btn-outline:hover { background: #fff; color: var(--sp-800); }

/* ---------- Videos ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.4rem; }
.video-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem; background: #fff; box-shadow: var(--shadow-xs); }
.video-card h3 { font-size: 1.05rem; }
.video-card video { width: 100%; border-radius: var(--r); background: #000; display: block; }
.video-frame { position: relative; padding-bottom: 56.25%; height: 0; border-radius: var(--r); overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ============================================================================
   Auth cards
   ============================================================================ */
.auth-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 3rem 1.5rem; background: var(--sp-gradient-soft); }
.auth-card {
    width: 100%; max-width: 430px; background: #fff; border: 1px solid var(--line);
    border-radius: var(--r-xl); padding: 2.4rem; box-shadow: var(--shadow-lg);
}
.auth-card.auth-card-large { max-width: 560px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: .4rem; }
.auth-card .auth-sub { color: var(--muted); margin-bottom: 1.6rem; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 1.2rem; }
.auth-brand .mark { width: 52px; height: 52px; }

/* ============================================================================
   Forms
   ============================================================================ */
label { display: block; margin: 1rem 0 .35rem; font-weight: 600; font-size: .9rem; color: var(--ink); }
input, select, textarea {
    width: 100%; padding: .7rem .85rem; border: 1.5px solid var(--line); border-radius: var(--r-sm);
    font: inherit; font-size: .96rem; color: var(--text); background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sp-400); box-shadow: 0 0 0 3px var(--sp-100); }
textarea { resize: vertical; min-height: 90px; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin: .8rem 0; }
.checkbox input { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1.25rem; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.5rem 1.6rem; margin: 1.2rem 0 2rem; box-shadow: var(--shadow-xs); }
.form-card h3 { margin-top: 0; }
details.form-card summary { cursor: pointer; font-weight: 650; }
form .btn { margin-top: 1.4rem; }

.validation-errors { color: var(--danger); background: var(--danger-bg); border: 1px solid #f3c9c3; border-radius: var(--r-sm); padding: .7rem .9rem; margin-bottom: 1rem; font-size: .9rem; }
.validation-errors ul { margin: 0; padding-left: 1.1rem; }
.field-error { color: var(--danger); font-size: .82rem; display: block; margin-top: .25rem; }

/* ============================================================================
   Notices
   ============================================================================ */
.notice { border-radius: var(--r); padding: .85rem 1.1rem; margin: 1rem 0; font-size: .95rem; border: 1px solid var(--warn-bg); background: var(--warn-bg); color: #7a5312; }
.notice.success { background: var(--ok-bg); border-color: var(--sp-200); color: var(--sp-800); }

/* ============================================================================
   Enterprise dashboard shell (admin + client)
   ============================================================================ */
.app-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.app-sidebar {
    background: linear-gradient(180deg, #0C5C2C 0%, #0A3F20 100%); color: #cfe8d5;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 1.2rem 0;
}
.app-sidebar .side-brand { display: flex; align-items: center; gap: .6rem; padding: .2rem 1.3rem 1.3rem; }
.app-sidebar .side-brand .mark { width: 34px; height: 34px; background: #fff; border-radius: 9px; padding: 4px; }
.app-sidebar .side-brand b { color: #fff; font-size: 1.1rem; font-weight: 800; }
.app-sidebar .side-brand b .p { color: var(--sp-300); }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: .5rem .8rem; flex: 1; overflow-y: auto; }
.side-nav .grp { color: #8fc79c; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; padding: 1rem .7rem .35rem; }
.side-nav a {
    display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 10px;
    color: #cfe8d5; font-weight: 550; font-size: .92rem; transition: background .15s ease, color .15s ease;
}
.side-nav a .ic { width: 18px; height: 18px; flex: none; opacity: .9; }
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-nav a.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 var(--sp-300); }
.app-sidebar .side-foot { padding: 1rem 1.3rem 0; border-top: 1px solid rgba(255,255,255,.1); margin: .5rem .8rem 0; }
.app-sidebar .side-foot a { color: #a9d6b4; font-size: .85rem; }

.app-main { display: flex; flex-direction: column; min-width: 0; background: var(--bg-soft); }
.app-topbar {
    height: 64px; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; padding: 0 1.8rem; position: sticky; top: 0; z-index: 20;
}
.app-topbar .title { font-weight: 750; color: var(--ink); font-size: 1.05rem; }
.app-topbar .user { display: flex; align-items: center; gap: .7rem; font-size: .9rem; color: var(--muted); }
.app-topbar .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--sp-gradient); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.app-content { padding: 2rem 1.8rem; max-width: 1200px; width: 100%; }
.app-content > h1 { font-size: 1.7rem; margin-bottom: 1.2rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.2rem; }

/* KPI / cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.card {
    display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.3rem 1.4rem;
    text-decoration: none; color: var(--text); box-shadow: var(--shadow-xs); transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--sp-200); color: var(--text); }
.card h3 { color: var(--sp-800); margin-bottom: .3rem; display: flex; align-items: center; gap: .5rem; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; }
.card.disabled { opacity: .55; pointer-events: none; }
.card .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--sp-50); color: var(--sp-600); display: grid; place-items: center; }

/* ============================================================================
   Tables
   ============================================================================ */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-xs); margin: 1rem 0 1.5rem; }
.table th, .table td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line-soft); font-size: .92rem; }
.table thead th { background: var(--bg-soft); color: var(--muted); font-weight: 650; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--sp-50); }
.actions { white-space: nowrap; display: flex; gap: .8rem; align-items: center; }
.danger { color: var(--danger); }
.row-deleted { opacity: .5; text-decoration: line-through; }
.machine-id { font-size: .76rem; word-break: break-all; color: var(--muted); }
.release-note { white-space: pre-wrap; font-family: inherit; margin: 0; }

/* Badges / pills */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: var(--r-pill); background: var(--sp-50); color: var(--sp-800); border: 1px solid var(--sp-200); font-size: .8rem; font-weight: 600; }
.badge.warn { background: var(--warn-bg); border-color: #f0d9a8; color: #8a5a12; }
.badge.danger { background: var(--danger-bg); border-color: #f0c8c2; color: var(--danger); }

.actions-row { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 1rem; margin: 1.2rem 0; }

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-visual { order: -1; }
    .feature-grid { grid-template-columns: 1fr; }
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar { position: fixed; left: -280px; z-index: 60; transition: left .2s ease; width: 264px; }
    .app-sidebar.open { left: 0; }
    .nav-links a:not(.btn) { display: none; }
    .pillars { grid-template-columns: repeat(2, 1fr); }
}
