/* ============================================================
   AgendaPro — Global Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --color-primary:       #0ea5e9;
  --color-primary-dark:  #0284c7;
  --color-primary-light: #e0f2fe;
  --color-accent:        #6366f1;
  --color-success:       #22c55e;
  --color-warning:       #f59e0b;
  --color-danger:        #ef4444;

  --color-bg:            #f0f4f8;
  --color-surface:       #ffffff;
  --color-surface-2:     #f8fafc;
  --color-border:        #e2e8f0;
  --color-border-focus:  var(--color-primary);

  --color-text:          #0f172a;
  --color-text-2:        #475569;
  --color-text-3:        #94a3b8;

  --sidebar-w:           240px;
  --sidebar-bg:          #0f172a;
  --sidebar-border:      #1e293b;
  --topbar-h:            64px;

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:   0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);

  --transition:  all .2s ease;
  --font:        'Inter', system-ui, sans-serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ──────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
p { color: var(--color-text-2); }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

/* ── Utility ─────────────────────────────────────────────── */
.text-muted { color: var(--color-text-3) !important; }
.text-secondary { color: var(--color-text-2) !important; }

/* ============================================================
   LANDING PAGE
   ============================================================ */

/* Navbar */
.ap-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,23,42,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 0 2rem;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ap-navbar__brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: -.5px;
}
.ap-navbar__brand span {
  color: var(--color-primary);
}
.ap-navbar__actions { display: flex; gap: .75rem; align-items: center; }

/* Hero */
.ap-hero {
  min-height: calc(100vh - var(--topbar-h));
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  padding: 5rem 2rem;
  position: relative;
  overflow: hidden;
}
.ap-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 50%, rgba(14,165,233,.15) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(99,102,241,.12) 0%, transparent 70%);
}
.ap-hero__content {
  position: relative;
  max-width: 640px;
}
.ap-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(14,165,233,.15);
  border: 1px solid rgba(14,165,233,.3);
  color: var(--color-primary);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .35rem .85rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}
.ap-hero__title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}
.ap-hero__title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--color-primary), #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ap-hero__sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,.65);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 500px;
}
.ap-hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Steps */
.ap-steps {
  padding: 5rem 2rem;
  background: var(--color-surface);
}
.ap-steps__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.ap-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.ap-step__num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 800;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ap-step__label { font-weight: 600; color: var(--color-text); margin-bottom: .25rem; }
.ap-step__desc { font-size: .875rem; color: var(--color-text-2); }

/* Feature cards */
.ap-features {
  padding: 5rem 2rem;
  background: var(--color-bg);
}
.ap-features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}
.ap-card-feature {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.ap-card-feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}
.ap-card-feature__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}
.ap-card-feature__icon--blue  { background: #dbeafe; color: #2563eb; }
.ap-card-feature__icon--teal  { background: #d1fae5; color: #059669; }
.ap-card-feature__icon--violet{ background: #ede9fe; color: #7c3aed; }
.ap-card-feature__title { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; }
.ap-card-feature__desc  { font-size: .875rem; color: var(--color-text-2); }

/* Section header */
.ap-section-header { text-align: center; margin-bottom: 3rem; }
.ap-section-header__eyebrow {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: .75rem;
}
.ap-section-header__title { font-size: 2rem; font-weight: 800; margin-bottom: .75rem; }
.ap-section-header__sub { color: var(--color-text-2); max-width: 520px; margin: 0 auto; }

/* Footer */
.ap-footer {
  background: #0f172a;
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 2rem;
  font-size: .85rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-ap {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-ap--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-ap--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(14,165,233,.4);
}
.btn-ap--outline {
  background: transparent;
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.25);
}
.btn-ap--outline:hover {
  border-color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.07);
  color: #fff;
}
.btn-ap--ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-ap--ghost:hover {
  background: var(--color-primary);
  color: #fff;
}
.btn-ap--sm { padding: .45rem 1rem; font-size: .825rem; }
.btn-ap--danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.btn-ap--danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }

/* ============================================================
   ADMIN LAYOUT — SIDEBAR
   ============================================================ */

.ap-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.ap-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  overflow-y: auto;
  transition: transform .25s ease;
}
.ap-sidebar__head {
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--sidebar-border);
}
.ap-sidebar__logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.5px;
}
.ap-sidebar__logo span { color: var(--color-primary); }
.ap-sidebar__tagline { font-size: .7rem; color: rgba(255,255,255,.35); margin-top: .15rem; }

.ap-sidebar__nav { flex: 1; padding: 1rem .75rem; }

.ap-sidebar__label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: .5rem .75rem;
  margin-top: .5rem;
}
.ap-sidebar__link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.6);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  margin-bottom: .15rem;
}
.ap-sidebar__link:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}
.ap-sidebar__link.active {
  background: var(--color-primary);
  color: #fff;
}
.ap-sidebar__link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }

.ap-sidebar__foot {
  padding: 1rem .75rem 1.25rem;
  border-top: 1px solid var(--sidebar-border);
}
.ap-sidebar__user {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  margin-bottom: .5rem;
}
.ap-sidebar__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; color: #fff;
  flex-shrink: 0;
}
.ap-sidebar__username { font-size: .825rem; font-weight: 600; color: rgba(255,255,255,.85); }
.ap-sidebar__role    { font-size: .7rem; color: rgba(255,255,255,.4); }

/* Main area */
.ap-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.ap-topbar {
  height: var(--topbar-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.ap-topbar__title { font-size: 1.05rem; font-weight: 700; margin-right: auto; }
.ap-content { padding: 2rem; flex: 1; }

/* Mobile sidebar toggle */
.ap-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: .4rem;
  border-radius: var(--radius-sm);
}
.ap-sidebar-toggle:hover { background: var(--color-bg); }

@media (max-width: 900px) {
  .ap-sidebar {
    transform: translateX(-100%);
  }
  .ap-sidebar.open {
    transform: translateX(0);
  }
  .ap-sidebar-toggle { display: block; }
  .ap-main { margin-left: 0; }
  .ap-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 150;
  }
  .ap-sidebar-overlay.open { display: block; }
}

/* ============================================================
   ADMIN COMPONENTS
   ============================================================ */

/* Page title */
.ap-page-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 1.5rem; color: var(--color-text); }
.ap-page-title small { font-size: .85rem; font-weight: 400; color: var(--color-text-2); margin-left: .5rem; }

/* Cards */
.ap-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ap-card__header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ap-card__title { font-size: 1rem; font-weight: 700; }
.ap-card__body  { padding: 1.5rem; }

/* KPI stat cards */
.ap-stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.ap-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ap-stat-card__icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.ap-stat-card__icon--blue   { background: #dbeafe; color: #2563eb; }
.ap-stat-card__icon--green  { background: #d1fae5; color: #059669; }
.ap-stat-card__icon--orange { background: #ffedd5; color: #ea580c; }
.ap-stat-card__icon--purple { background: #ede9fe; color: #7c3aed; }
.ap-stat-card__value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.ap-stat-card__label { font-size: .8rem; color: var(--color-text-2); margin-top: .25rem; }

/* Quick link cards */
.ap-quick-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.ap-quick-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--color-text);
}
.ap-quick-card__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.ap-quick-card__title { font-size: .925rem; font-weight: 700; color: var(--color-text); }
.ap-quick-card__desc  { font-size: .8rem; color: var(--color-text-2); }
.ap-quick-card__arrow { margin-left: auto; color: var(--color-text-3); font-size: 1.1rem; }

/* Tables */
.ap-table-wrap { overflow-x: auto; }
.ap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.ap-table thead tr {
  background: var(--color-surface-2);
  border-bottom: 2px solid var(--color-border);
}
.ap-table th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--color-text-2);
  white-space: nowrap;
}
.ap-table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}
.ap-table tbody tr:hover { background: var(--color-surface-2); }
.ap-table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.ap-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.ap-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.ap-badge--success { background: #d1fae5; color: #065f46; }
.ap-badge--muted   { background: #f1f5f9; color: #64748b; }
.ap-badge--warning { background: #fef3c7; color: #92400e; }
.ap-badge--danger  { background: #fee2e2; color: #991b1b; }

/* Alerts */
.ap-alert {
  padding: .85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.ap-alert--success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.ap-alert--danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.ap-alert--info    { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

/* Forms */
.ap-form-group { margin-bottom: 1.25rem; }
.ap-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: .45rem;
}
.ap-input,
.ap-select,
.ap-textarea {
  width: 100%;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-family: var(--font);
  font-size: .875rem;
  color: var(--color-text);
  transition: var(--transition);
  outline: none;
}
.ap-input:focus,
.ap-select:focus,
.ap-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
.ap-input::placeholder { color: var(--color-text-3); }

/* Checkbox & radio */
.ap-check-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .875rem;
  cursor: pointer;
  padding: .3rem 0;
  color: var(--color-text);
}
.ap-check-label input[type="checkbox"],
.ap-check-label input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--color-primary);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.ap-login-page {
  min-height: 100vh;
  display: flex;
}
.ap-login-hero {
  flex: 1;
  background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 60%, #0c4a6e 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
  position: relative;
  overflow: hidden;
}
.ap-login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 60% 40%, rgba(14,165,233,.2) 0%, transparent 70%);
}
.ap-login-hero__content { position: relative; }
.ap-login-hero__logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2rem;
  letter-spacing: -.03em;
}
.ap-login-hero__logo span { color: var(--color-primary); }
.ap-login-hero__title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.ap-login-hero__sub { color: rgba(255,255,255,.55); line-height: 1.7; max-width: 380px; }

.ap-login-hero__features { margin-top: 3rem; display: flex; flex-direction: column; gap: .75rem; }
.ap-login-hero__feat {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: rgba(255,255,255,.7);
  font-size: .9rem;
}
.ap-login-hero__feat-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: rgba(14,165,233,.2);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

.ap-login-form-side {
  width: 480px;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 3.5rem;
}
.ap-login-box { width: 100%; }
.ap-login-box__title { font-size: 1.75rem; font-weight: 800; margin-bottom: .5rem; }
.ap-login-box__sub { color: var(--color-text-2); margin-bottom: 2rem; font-size: .9rem; }

@media (max-width: 768px) {
  .ap-login-hero { display: none; }
  .ap-login-form-side { width: 100%; padding: 2rem 1.5rem; }
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-fade-up {
  animation: fadeInUp .5s ease both;
}
.anim-fade-up--1 { animation-delay: .1s; }
.anim-fade-up--2 { animation-delay: .2s; }
.anim-fade-up--3 { animation-delay: .3s; }

/* ============================================================
   Grid helpers
   ============================================================ */
.ap-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.ap-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.ap-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
@media (max-width: 1100px) { .ap-grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 700px)  {
  .ap-grid-2, .ap-grid-3, .ap-grid-4 { grid-template-columns: 1fr; }
}

.ap-flex { display: flex; }
.ap-flex--between { justify-content: space-between; }
.ap-flex--center  { align-items: center; }
.ap-gap-1 { gap: .5rem; }
.ap-gap-2 { gap: 1rem; }
.ap-gap-3 { gap: 1.5rem; }
.ap-mb-1  { margin-bottom: .5rem; }
.ap-mb-2  { margin-bottom: 1rem; }
.ap-mb-3  { margin-bottom: 1.5rem; }
.ap-mb-4  { margin-bottom: 2rem; }
