/* Lombard CRM — GFTDoc-style design system */

@import url('https://fonts.bunny.net/css?family=figtree:400,500,600,700&display=swap');

* { box-sizing: border-box; }

:root {
  --c-bg:         #f9fafb;
  --c-surface:    #ffffff;
  --c-border:     #e5e7eb;
  --c-text:       #111827;
  --c-text-muted: #6b7280;
  --c-text-soft:  #9ca3af;
  --c-primary:    #2563eb;
  --c-primary-h:  #1d4ed8;
  --c-primary-l:  #eff6ff;
  --c-success:    #16a34a;
  --c-success-l:  #f0fdf4;
  --c-warning:    #f59e0b;
  --c-warning-l:  #fffbeb;
  --c-danger:     #dc2626;
  --c-danger-l:   #fef2f2;
  --c-shadow:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --c-shadow-md:  0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.06);
  --r-sm: .375rem;
  --r:    .5rem;
  --r-lg: .75rem;
  --r-xl: 1rem;
}

html.dark {
  --c-bg:         #0f172a;
  --c-surface:    #1e293b;
  --c-border:     #334155;
  --c-text:       #f1f5f9;
  --c-text-muted: #94a3b8;
  --c-text-soft:  #64748b;
  --c-primary:    #3b82f6;
  --c-primary-h:  #60a5fa;
  --c-primary-l:  #1e3a8a;
  --c-success-l:  #14532d;
  --c-warning-l:  #713f12;
  --c-danger-l:   #7f1d1d;
  --c-shadow:     0 1px 3px rgba(0,0,0,.3);
  --c-shadow-md:  0 4px 6px -1px rgba(0,0,0,.4);
}

body {
  font-family: 'Figtree', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--c-text); font-weight: 600; }
h1 { font-size: 1.875rem; line-height: 1.2; }
h2 { font-size: 1.5rem; line-height: 1.25; }
h3 { font-size: 1.125rem; }

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-h); }

/* ── Buttons ───────────────────────────────────────── */
.btn-primary, button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--c-primary); color: #fff; border: 0;
  padding: .55rem 1rem; border-radius: var(--r); cursor: pointer;
  font-family: inherit; font-size: .875rem; font-weight: 500;
  transition: background .15s, transform .05s; text-decoration: none;
}
.btn-primary:hover, button:hover { background: var(--c-primary-h); color: #fff; }
.btn-primary:active, button:active { transform: scale(.98); }
.btn-primary.big { padding: .85rem 1.6rem; font-size: 1rem; }
.btn-ghost {
  background: transparent; color: var(--c-primary);
  border: 1px solid var(--c-border); padding: .55rem 1rem; border-radius: var(--r);
  font-weight: 500; text-decoration: none; display: inline-block;
}
.btn-ghost:hover { background: var(--c-primary-l); color: var(--c-primary); }

button.btn-secondary { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); }
button.btn-secondary:hover { background: var(--c-bg); }

/* ── Forms ─────────────────────────────────────────── */
input, select, textarea {
  width: 100%; padding: .55rem .75rem;
  background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-border); border-radius: var(--r);
  font-size: .875rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
label {
  display: block; margin: .85rem 0 .35rem;
  font-size: .8125rem; font-weight: 500; color: var(--c-text);
}

/* ── Landing ───────────────────────────────────────── */
.landing .hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
  color: #fff; padding: 5rem 1.25rem 5.5rem; text-align: center;
}
.landing .hero-inner { max-width: 760px; margin: 0 auto; }
.landing .hero h1 { color: #fff; font-size: 3rem; font-weight: 700; margin: 0 0 .75rem; letter-spacing: -.02em; }
.landing .hero .lead { font-size: 1.125rem; opacity: .95; margin: 0; max-width: 600px; margin: 0 auto; }
.landing .hero .trial {
  display: inline-block; background: rgba(255,255,255,.18); backdrop-filter: blur(8px);
  padding: .55rem 1.25rem; border-radius: 9999px; margin: 1.5rem 0 1.5rem;
  font-weight: 500; font-size: .9375rem;
}
.landing .hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.landing .hero-actions .btn-primary { background: #fff; color: var(--c-primary); }
.landing .hero-actions .btn-primary:hover { background: #f3f4f6; }
.landing .hero-actions .btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,.4); background: transparent; }
.landing .hero-actions .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

.modules { padding: 4rem 1.25rem; max-width: 1200px; margin: 0 auto; }
.modules h2 { text-align: center; font-size: 2rem; margin: 0 0 .5rem; }
.modules .muted { text-align: center; color: var(--c-text-muted); margin: 0 0 2.5rem; }
.mod-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.mod {
  background: var(--c-surface); padding: 1.5rem;
  border: 1px solid var(--c-border); border-radius: var(--r-lg);
  transition: border-color .15s, transform .15s;
}
.mod:hover { border-color: var(--c-primary); transform: translateY(-2px); }
.mod h3 { margin: 0 0 .75rem; font-size: 1.0625rem; }
.mod ul { padding-left: 1.15rem; margin: 0; color: var(--c-text-muted); font-size: .875rem; line-height: 1.7; }

.how { background: var(--c-surface); padding: 4rem 1.25rem; text-align: center; border-top: 1px solid var(--c-border); }
.how h2 { margin-bottom: 1.5rem; }
.steps { display: inline-block; text-align: left; padding-left: 1.25rem; color: var(--c-text-muted); line-height: 2; font-size: .9375rem; }

footer { text-align: center; padding: 2rem; background: var(--c-text); color: var(--c-text-soft); }
footer small { color: var(--c-text-soft); }

/* ── Auth pages ────────────────────────────────────── */
.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; background: var(--c-bg); }
.auth-box {
  background: var(--c-surface); padding: 2rem;
  border: 1px solid var(--c-border); border-radius: var(--r-lg);
  width: 100%; max-width: 420px; box-shadow: var(--c-shadow-md);
}
.auth-box h2 { margin: 0 0 .25rem; }
.auth-box .auth-sub { color: var(--c-text-muted); font-size: .875rem; margin: 0 0 1.25rem; }
.auth-box button { margin-top: 1.25rem; width: 100%; }
.msg { color: var(--c-danger); min-height: 1.4rem; margin-top: .75rem; font-size: .8125rem; }
.msg.ok { color: var(--c-success); }

/* ── Admin layout ──────────────────────────────────── */
.admin-wrap { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-side {
  background: var(--c-surface); border-right: 1px solid var(--c-border);
  padding: 1.5rem 0; display: flex; flex-direction: column;
}
.admin-side h1 { font-size: 1rem; padding: 0 1.25rem; margin: 0 0 1.25rem; color: var(--c-text); font-weight: 600; }
.admin-side a {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem 1.25rem; color: var(--c-text-muted); font-size: .875rem;
  font-weight: 500; text-decoration: none; transition: background .15s, color .15s;
  border-left: 2px solid transparent;
}
.admin-side a:hover { background: var(--c-bg); color: var(--c-text); }
.admin-side a.active {
  background: var(--c-primary-l); color: var(--c-primary);
  border-left-color: var(--c-primary);
}
.admin-side.super a.active { background: rgba(168, 85, 247, .1); color: #9333ea; border-left-color: #9333ea; }

.admin-main { padding: 2rem; max-width: 1400px; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem;
}
.theme-toggle {
  background: var(--c-surface); border: 1px solid var(--c-border);
  width: 40px; height: 40px; border-radius: 9999px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-text-muted); padding: 0; font-size: 18px;
  box-shadow: var(--c-shadow);
  transition: transform .15s, background .15s;
}
.theme-toggle:hover { background: var(--c-bg); transform: scale(1.08); }
.theme-toggle-floating {
  position: fixed; top: 16px; right: 16px; z-index: 1000;
}
/* Hero üzərində daha kontrastlı */
.landing .theme-toggle-floating {
  background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3);
  backdrop-filter: blur(8px);
}
.landing .theme-toggle-floating:hover { background: rgba(255,255,255,.28); }
html.dark .theme-toggle-floating { background: var(--c-surface); }

/* ── Cards & stats ─────────────────────────────────── */
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat {
  background: var(--c-surface); padding: 1.25rem;
  border: 1px solid var(--c-border); border-radius: var(--r-lg);
  font-size: .8125rem; color: var(--c-text-muted); font-weight: 500;
}
.stat b { font-size: 1.5rem; display: block; margin-top: .35rem; color: var(--c-text); font-weight: 600; }

.card {
  background: var(--c-surface); padding: 1.25rem;
  border: 1px solid var(--c-border); border-radius: var(--r-lg);
}
.quick-card { background: var(--c-surface); padding: 1.25rem; border: 1px solid var(--c-border); border-radius: var(--r-lg); }
.quick-card h3 { margin: 0 0 .65rem; font-size: 1rem; }

.trial-warn {
  background: var(--c-warning-l); color: #92400e; padding: .85rem 1.15rem;
  border: 1px solid #fde68a; border-radius: var(--r); margin-bottom: 1.25rem;
  font-size: .875rem;
}
html.dark .trial-warn { color: #fbbf24; border-color: #78350f; }

/* ── Tables ────────────────────────────────────────── */
table {
  width: 100%; border-collapse: collapse;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); overflow: hidden;
  margin-top: .5rem;
}
th, td { padding: .75rem 1rem; text-align: left; font-size: .875rem; border-bottom: 1px solid var(--c-border); }
th {
  background: var(--c-bg); font-weight: 500; color: var(--c-text-muted);
  font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--c-bg); }
td a { color: var(--c-primary); font-weight: 500; }

/* ── Badges ────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .15rem .55rem; border-radius: 9999px;
  font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
}
.badge-active   { background: #dcfce7; color: #166534; }
.badge-trial    { background: #dbeafe; color: #1e40af; }
.badge-expired  { background: #fee2e2; color: #991b1b; }
.badge-blocked  { background: #fecaca; color: #7f1d1d; }
.badge-overdue  { background: #fef3c7; color: #92400e; }
.badge-closed   { background: #e0e7ff; color: #3730a3; }
.badge-extended { background: #fed7aa; color: #9a3412; }
.badge-sold     { background: #f3e8ff; color: #6b21a8; }
.badge-cancelled{ background: #e5e7eb; color: #374151; }
html.dark .badge-active   { background: #14532d; color: #86efac; }
html.dark .badge-trial    { background: #1e3a8a; color: #93c5fd; }
html.dark .badge-expired  { background: #7f1d1d; color: #fca5a5; }
html.dark .badge-overdue  { background: #713f12; color: #fcd34d; }
html.dark .badge-closed   { background: #1e1b4b; color: #a5b4fc; }

/* ── Tabs ──────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--c-border); }
.tab-btn {
  background: transparent; color: var(--c-text-muted); border-radius: 0;
  padding: .65rem 1rem; font-weight: 500; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover { background: transparent; color: var(--c-text); }
.tab-btn.active { color: var(--c-primary); border-bottom-color: var(--c-primary); background: transparent; }

/* ── Notification templates ────────────────────────── */
.tpl-card {
  background: var(--c-surface); padding: 1.15rem;
  border: 1px solid var(--c-border); border-radius: var(--r-lg);
  margin-bottom: .85rem;
}
.tpl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .65rem; gap: .5rem; flex-wrap: wrap; }
.tpl-card textarea { min-height: 90px; font-family: inherit; }
.tpl-card button { margin-top: .65rem; background: var(--c-primary-l); color: var(--c-primary); }
.tpl-card button:hover { background: var(--c-primary); color: #fff; }
.switch input { margin-right: .4rem; }
.switch span { font-size: .8125rem; color: var(--c-text-muted); }

code {
  background: var(--c-bg); border: 1px solid var(--c-border);
  padding: .05rem .35rem; border-radius: var(--r-sm);
  font-size: .8125rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ── Modal ─────────────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal-box { background: var(--c-surface); padding: 1.5rem; border-radius: var(--r-lg); width: 100%; max-width: 480px; border: 1px solid var(--c-border); }
.modal-box textarea { font-family: inherit; }

/* ── Status select inline ──────────────────────────── */
.status-sel { padding: .25rem .5rem; font-size: .8125rem; min-width: auto; width: auto; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-wrap { grid-template-columns: 1fr; }
  .admin-side { border-right: 0; border-bottom: 1px solid var(--c-border); }
  .admin-main { padding: 1rem; }
  .landing .hero h1 { font-size: 2rem; }
}
