/* ─────────────────────────────────────────────────────────────────────────
   VEPIIL CRM – Shared Stylesheet
   Theme: Dark (#1A1A1A) + Red (#D41F1F) + White  |  Font: Inter
   ──────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #D41F1F;
  --red-dark:   #A81818;
  --red-light:  #F03030;
  --dark:       #1A1A1A;
  --dark-2:     #2D2D2D;
  --dark-3:     #404040;
  --mid:        #6B7280;
  --light-bg:   #F7F7F7;
  --white:      #FFFFFF;
  --border:     #E5E7EB;
  --success:    #16a34a;
  --warning:    #d97706;
  --danger:     #dc2626;
  --info:       #2563eb;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--dark);
  background: var(--light-bg);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────────────────────────── */
h1,h2,h3,h4,h5 { line-height: 1.25; font-weight: 700; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-light); }

/* ─── LAYOUT HELPERS ─────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-wrap  { padding: 36px 0 60px; }

/* ─── TOP NAV (Admin & Client) ───────────────────────────────────────────── */
.topnav {
  background: var(--dark);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
  position: sticky;
  top: 0;
  z-index: 200;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .4px;
}

.topnav-brand .accent { color: var(--red-light); }

.topnav-brand img {
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.topnav-links a {
  color: #ccc;
  font-size: .85rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 6px;
  transition: background .18s, color .18s;
}

.topnav-links a:hover,
.topnav-links a.active {
  background: rgba(212,31,31,.2);
  color: var(--white);
}

.topnav-links a.btn-red {
  background: var(--red);
  color: var(--white);
}

.topnav-links a.btn-red:hover { background: var(--red-light); }

/* ─── SIDEBAR LAYOUT (Admin) ─────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--dark-2);
  border-right: 1px solid rgba(255,255,255,.07);
  padding: 28px 0;
}

.sidebar-section {
  padding: 0 16px;
  margin-bottom: 28px;
}

.sidebar-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #555;
  padding: 0 12px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #aaa;
  font-size: .86rem;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 8px;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(212,31,31,.18);
  color: var(--white);
}

.sidebar-link .icon { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }

.admin-content {
  flex: 1;
  padding: 32px 36px 60px;
  overflow-x: auto;
}

/* ─── PAGE HEADER ────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--dark);
}

.page-header p {
  font-size: .88rem;
  color: var(--mid);
  margin-top: 4px;
}

/* ─── STAT CARDS (Dashboard) ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow .2s;
}

.stat-card:hover { box-shadow: 0 6px 22px rgba(0,0,0,.08); }

.stat-card .ico {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  background: rgba(212,31,31,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-card .info .num {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}

.stat-card .info .lbl {
  font-size: .78rem;
  color: var(--mid);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* ─── TABLES ─────────────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.table-toolbar h3 { font-size: 1rem; font-weight: 700; color: var(--dark); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}

thead th {
  background: var(--light-bg);
  color: var(--mid);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  padding: 11px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: #fafafa; }

tbody td { padding: 13px 20px; color: var(--dark); vertical-align: middle; }

.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}

.badge-red    { background: rgba(212,31,31,.12); color: var(--red-dark); }
.badge-green  { background: rgba(22,163,74,.12);  color: #15803d; }
.badge-yellow { background: rgba(217,119,6,.12);  color: #92400e; }
.badge-blue   { background: rgba(37,99,235,.12);  color: #1d4ed8; }
.badge-gray   { background: rgba(107,114,128,.12); color: #374151; }

/* ─── FORMS ──────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 40px;
  max-width: 680px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-group.full { grid-column: 1 / -1; }

label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--dark);
  letter-spacing: .2px;
}

label .req { color: var(--red); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .88rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color .18s, box-shadow .18s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(212,31,31,.1);
}

textarea { resize: vertical; min-height: 90px; }

.form-hint {
  font-size: .76rem;
  color: var(--mid);
  margin-top: -2px;
}

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: 8px;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .18s, transform .12s, opacity .18s;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-light); color: var(--white); }

.btn-secondary {
  background: var(--light-bg);
  color: var(--dark);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--dark); }

.btn-danger { background: #fee2e2; color: var(--danger); border: 1.5px solid #fca5a5; }
.btn-danger:hover { background: #fca5a5; color: var(--danger); }

.btn-success { background: #dcfce7; color: var(--success); border: 1.5px solid #86efac; }
.btn-success:hover { background: #86efac; color: var(--success); }

.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* ─── ALERTS ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 13px 18px;
  border-radius: 9px;
  font-size: .875rem;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: #dcfce7; border: 1px solid #86efac; color: #14532d; }
.alert-error   { background: #fee2e2; border: 1px solid #fca5a5; color: #7f1d1d; }
.alert-info    { background: #dbeafe; border: 1px solid #93c5fd; color: #1e3a5f; }
.alert-warning { background: #fef3c7; border: 1px solid #fcd34d; color: #78350f; }

/* ─── PUBLIC HERO / AUTH PAGES ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: var(--dark-2);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  padding: 44px 48px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.auth-card .brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-card .brand img {
  height: 56px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.auth-card .brand h2 {
  color: var(--white);
  font-size: 1.3rem;
  font-family: 'Playfair Display', serif;
}

.auth-card .brand p {
  color: #888;
  font-size: .82rem;
  margin-top: 4px;
}

.auth-card label { color: #ccc; }

.auth-card input, .auth-card select {
  background: var(--dark-3);
  border-color: rgba(255,255,255,.12);
  color: var(--white);
}

.auth-card input:focus, .auth-card select:focus {
  border-color: var(--red);
}

.auth-card input::placeholder { color: #666; }

.auth-footer {
  margin-top: 22px;
  text-align: center;
  font-size: .82rem;
  color: #888;
}

.auth-footer a { color: var(--red-light); }

/* ─── PUBLIC SERVICES PAGE ───────────────────────────────────────────────── */
.public-nav {
  background: var(--dark);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6%;
  box-shadow: 0 2px 12px rgba(0,0,0,.45);
  position: sticky;
  top: 0;
  z-index: 200;
}

.public-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.public-nav .brand img { height: 40px; border-radius: 6px; }

.public-nav .brand span { color: var(--red); font-weight: 800; font-size: 1rem; }
.public-nav .brand small { color: #aaa; font-size: .65rem; display: block; line-height: 1; }

.public-nav .nav-actions { display: flex; align-items: center; gap: 10px; }

.pricing-hero {
  background: linear-gradient(135deg, var(--dark) 0%, #2a0505 55%, var(--red-dark) 100%);
  color: var(--white);
  text-align: center;
  padding: 80px 6% 70px;
}

.pricing-hero .tag {
  display: inline-block;
  background: rgba(212,31,31,.25);
  border: 1px solid rgba(212,31,31,.5);
  color: #ffaaaa;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.pricing-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.pricing-hero p {
  color: #c5c5c5;
  font-size: 1rem;
  max-width: 580px;
  margin: 0 auto;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 28px 6% 0;
  max-width: 1200px;
  margin: 0 auto;
}

.filter-tab {
  padding: 7px 18px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--mid);
  transition: .18s;
}

.filter-tab:hover,
.filter-tab.active {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.services-section {
  padding: 40px 6% 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 26px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow .22s, border-color .22s, transform .18s;
}

.service-card:hover {
  box-shadow: 0 12px 36px rgba(0,0,0,.1);
  border-color: var(--red);
  transform: translateY(-3px);
}

.service-card .card-cat {
  display: inline-block;
  background: rgba(212,31,31,.1);
  color: var(--red-dark);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  align-self: flex-start;
}

.service-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
}

.service-card .price-block { margin-top: 4px; }

.service-card .price-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}

.service-card .price-cycle {
  font-size: .8rem;
  color: var(--mid);
  margin-top: 3px;
}

.service-card .billing-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 2px 9px;
  border-radius: 20px;
  margin-left: 6px;
}

.billing-one { background: #dbeafe; color: #1d4ed8; }
.billing-rec  { background: #d1fae5; color: #065f46; }

.service-card .desc {
  font-size: .85rem;
  color: var(--mid);
  line-height: 1.65;
  flex: 1;
}

.service-card .features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.service-card .features li {
  font-size: .82rem;
  color: var(--dark-3);
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.service-card .features li::before {
  content: '✓';
  color: var(--red);
  font-weight: 700;
  flex-shrink: 0;
}

.service-card .card-action { margin-top: 8px; }
.service-card .card-action .btn { width: 100%; justify-content: center; }

/* ─── MODAL ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--white);
  border-radius: 18px;
  width: 100%;
  max-width: 500px;
  padding: 38px 42px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  transform: translateY(20px);
  transition: transform .22s;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--mid);
  line-height: 1;
}

.modal-close:hover { color: var(--dark); }

/* ─── RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; padding: 12px 0; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .sidebar-section { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar-label { display: none; }
  .admin-content { padding: 20px 16px 40px; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 24px; }
  .form-card { padding: 24px 20px; }
}

@media (max-width: 600px) {
  .services-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── BLOG LISTING ───────────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.blog-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .22s, transform .18s;
}

.blog-card:hover {
  box-shadow: 0 12px 36px rgba(0,0,0,.1);
  transform: translateY(-3px);
}

.blog-card-img-wrap {
  display: block;
  overflow: hidden;
  height: 200px;
  background: var(--light-bg);
  text-decoration: none;
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}

.blog-card:hover .blog-card-img { transform: scale(1.04); }

.blog-card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, rgba(212,31,31,.08) 0%, rgba(212,31,31,.02) 100%);
  color: var(--red);
}

.blog-card-body {
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.blog-cat {
  display: inline-block;
  background: rgba(212,31,31,.1);
  color: var(--red-dark);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 20px;
}

.blog-date {
  font-size: .76rem;
  color: var(--mid);
}

.blog-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.blog-card-title a {
  color: var(--dark);
  text-decoration: none;
  transition: color .15s;
}

.blog-card-title a:hover { color: var(--red); }

.blog-card-excerpt {
  font-size: .86rem;
  color: var(--mid);
  line-height: 1.65;
  flex: 1;
  margin: 0;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.blog-author {
  font-size: .78rem;
  color: var(--mid);
  font-weight: 500;
}

/* ─── BLOG POST BODY ─────────────────────────────────────────────────────── */
.blog-content {
  font-size: .97rem;
  line-height: 1.85;
  color: #222;
}

.blog-content p  { margin: 0 0 1.2em; }
.blog-content h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; margin: 1.8em 0 .6em; color: var(--dark); }
.blog-content h3 { font-size: 1.15rem; font-weight: 700; margin: 1.4em 0 .5em; color: var(--dark); }
.blog-content ul, .blog-content ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.blog-content li { margin-bottom: .4em; }
.blog-content blockquote {
  border-left: 4px solid var(--red);
  margin: 1.6em 0;
  padding: .8em 1.2em;
  background: rgba(212,31,31,.04);
  border-radius: 0 8px 8px 0;
  color: var(--dark);
  font-style: italic;
}
.blog-content a   { color: var(--red); text-decoration: underline; }
.blog-content img { max-width: 100%; border-radius: 10px; margin: 1em 0; display: block; }
.blog-content strong { font-weight: 700; }
.blog-content em { font-style: italic; }
.blog-content pre {
  background: var(--dark-2);
  color: #e2e8f0;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: .85rem;
  margin: 1.2em 0;
}
.blog-content code {
  font-family: monospace;
  background: rgba(212,31,31,.08);
  color: var(--red-dark);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .88em;
}

/* ─── SHARE BUTTONS ──────────────────────────────────────────────────────── */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .12s, color .15s;
  font-family: inherit;
  background: var(--white);
  color: var(--dark);
}

.share-btn:hover { transform: translateY(-1px); }

.share-copy:hover    { background: var(--light-bg); border-color: var(--dark-3); }
.share-whatsapp:hover { background: #dcfce7; border-color: #4ade80; color: #15803d; }
.share-twitter:hover  { background: #e7f0fd; border-color: #93c5fd; color: #1d4ed8; }
.share-linkedin:hover { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.share-facebook:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }

@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; }
  .share-btn  { padding: 8px 12px; font-size: .8rem; }
}
