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

:root {
  --ink:        #14273A;
  --terra:      #E07A2E;
  --paper:      #FFFFFF;
  --ink-90:     #1C3348;
  --ink-70:     #4A5866;
  --ink-50:     #7D8FA0;
  --ink-30:     #A8B5C2;
  --ink-15:     #C9D2DB;
  --terra-dark: #B5611E;
  --terra-soft: #F2C8A0;
  --terra-wash: #FDF0E6;
  --sand:       #D9DEE4;
  --sand-soft:  #EEF1F4;

  --bg:           var(--sand-soft);
  --bg-card:      var(--paper);
  --border:       rgba(20,39,58,.10);
  --border-strong:rgba(20,39,58,.22);

  --font: 'Outfit', sans-serif;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 3px rgba(20,39,58,.06);
  --shadow-md: 0 4px 16px rgba(20,39,58,.09), 0 1px 3px rgba(20,39,58,.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

a { color: var(--terra); text-decoration: none; }
a:hover { color: var(--terra-dark); }

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--ink);
  padding: 0 24px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}

.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}

.topbar-logo {
  position: relative; width: 28px; height: 28px;
  background: rgba(255,255,255,.12); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.topbar-logo .r { font-size: 17px; font-weight: 800; color: #fff; line-height: 1; margin-top: -1px; margin-left: -2px; }
.topbar-logo .star { position: absolute; right: 1px; top: 1px; }

.topbar-name { font-size: 1rem; font-weight: 700; color: #fff; letter-spacing: .01em; }

.topbar-nav { display: flex; align-items: center; gap: 8px; }
.topbar-nav a {
  font-size: .85rem; font-weight: 500; color: rgba(255,255,255,.6);
  padding: 6px 14px; border-radius: 6px; transition: background .15s, color .15s;
}
.topbar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.topbar-nav .btn-login {
  background: var(--terra); color: #fff; font-weight: 600;
}
.topbar-nav .btn-login:hover { background: var(--terra-dark); }

/* ── MARKETING HERO ── */
.hero {
  padding: 100px 24px 80px;
  text-align: center;
  background: linear-gradient(160deg, var(--ink) 0%, var(--ink-90) 100%);
  color: #fff;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(224,122,46,.2); border: 1px solid rgba(224,122,46,.4);
  color: var(--terra-soft); font-size: .78rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; padding: 5px 14px; border-radius: 99px; margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800;
  line-height: 1.12; margin-bottom: 20px;
}
.hero h1 span { color: var(--terra); }

.hero p {
  font-size: 1.1rem; color: rgba(255,255,255,.65);
  max-width: 540px; margin: 0 auto 36px; line-height: 1.65;
}

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: .9rem; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(224,122,46,.4); }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.btn-ghost:hover { background: rgba(255,255,255,.18); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-90); color: #fff; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #b02a37; color: #fff; }
.btn-sm { padding: 7px 16px; font-size: .8rem; }

/* ── APPS GRID ── */
.section { padding: 72px 24px; max-width: 1100px; margin: 0 auto; }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.section-sub { color: var(--ink-50); margin-bottom: 40px; font-size: .95rem; }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.app-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 28px 24px;
  transition: box-shadow .18s, transform .18s;
  display: flex; flex-direction: column; gap: 12px;
}
.app-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.app-icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: #fff; flex-shrink: 0;
}

.app-card h3 { font-size: 1rem; font-weight: 700; }
.app-card p  { font-size: .85rem; color: var(--ink-50); line-height: 1.55; flex: 1; }

.app-card-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .82rem; font-weight: 600; color: var(--terra);
  margin-top: 4px;
}
.app-card-link:hover { color: var(--terra-dark); }

/* ── DASHBOARD ── */
.dash-wrap { max-width: 960px; margin: 48px auto; padding: 0 24px; }
.dash-header { margin-bottom: 36px; }
.dash-header h1 { font-size: 1.6rem; font-weight: 800; }
.dash-header p { color: var(--ink-50); font-size: .9rem; margin-top: 4px; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.dash-app-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 24px 20px;
  text-align: center; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  transition: box-shadow .18s, transform .18s;
}
.dash-app-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--ink); }

.dash-app-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; color: #fff;
}
.dash-app-card span { font-size: .9rem; font-weight: 600; }

/* ── ADMIN ── */
.admin-wrap { max-width: 1100px; margin: 40px auto; padding: 0 24px; }

.card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 24px 28px;
  margin-bottom: 24px;
}
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 18px; }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--ink-70); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: .73rem; font-weight: 600; letter-spacing: .02em;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red   { background: #fee2e2; color: #b91c1c; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: .83rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-70); }
input[type=text], input[type=email], input[type=password], select {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: .9rem;
  background: var(--paper); color: var(--ink); transition: border-color .15s;
  outline: none;
}
input:focus, select:focus { border-color: var(--terra); }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px; border: 1.5px solid var(--border);
  cursor: pointer; font-size: .85rem; font-weight: 500;
  transition: border-color .15s, background .15s;
}
.checkbox-item input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--terra); }
.checkbox-item:has(input:checked) { border-color: var(--terra); background: var(--terra-wash); }

/* ── LOGIN PAGE ── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(150deg, var(--ink) 0%, var(--ink-90) 100%);
}
.login-box {
  background: var(--paper); border-radius: 16px;
  padding: 44px 40px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.login-logo .r-box {
  position: relative; width: 34px; height: 34px; border-radius: 8px;
  background: var(--ink); display: flex; align-items: center; justify-content: center;
}
.login-logo .r-box .r { font-size: 20px; font-weight: 800; color: #fff; margin-top: -1px; margin-left: -2px; }
.login-logo .r-box .star { position: absolute; right: 1px; top: 1px; }
.login-logo .brand-name { font-size: 1.2rem; font-weight: 800; color: var(--ink); }

.login-box h1 { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.login-box p  { color: var(--ink-50); font-size: .88rem; margin-bottom: 28px; }

/* ── FLASH MESSAGES ── */
.flash-list { list-style: none; margin-bottom: 18px; }
.flash {
  padding: 10px 16px; border-radius: 8px; font-size: .88rem; margin-bottom: 8px;
}
.flash-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.flash-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

/* ── ERROR PAGE ── */
.error-wrap { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.error-code { font-size: 6rem; font-weight: 800; color: var(--ink-15); line-height: 1; }
.error-msg  { font-size: 1.1rem; color: var(--ink-70); margin-top: 8px; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .hero { padding: 64px 16px 56px; }
  .topbar { padding: 0 16px; }
  .login-box { padding: 32px 20px; }
  .apps-grid { grid-template-columns: 1fr; }
}
