/* ===================================================
   Fintel Analytics — Internal Tools CSS
   internal.fintel-analytics.com
   =================================================== */
:root {
  --navy:      #022950;
  --navy-mid:  #034070;
  --navy-light:#e8eef5;
  --silver:    #ccd4dc;
  --silver-l:  #f0f3f6;
  --green:     #22c55e;
  --green-l:   #dcfce7;
  --red:       #ef4444;
  --red-l:     #fee2e2;
  --amber:     #f59e0b;
  --amber-l:   #fef3c7;
  --ink:       #0d1b2a;
  --ink-2:     #1a2e42;
  --muted:     #5a7184;
  --border:    #ccd4dc;
  --surface:   #f4f6f8;
  --white:     #ffffff;
  --sidebar-w: 220px;
  --radius:    10px;
}

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

body { font-family: 'Inter', system-ui, sans-serif; background: var(--surface); color: var(--ink); line-height: 1.6; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login ─────────────────────────────────────────── */
.int-login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #034070 100%);
  padding: 1rem;
}
.int-login-wrap { width: 100%; max-width: 400px; }
.int-login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 50px rgba(2,41,80,.35);
}
.int-login-logo { text-align: center; margin-bottom: 2rem; }
.int-login-logomark {
  width: 72px;
  height: 72px;
  margin: 0 auto .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.int-login-logomark img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.int-login-brand { font-size: 1.2rem; font-weight: 800; color: var(--navy); }
.int-login-sub   { font-size: .8rem; color: var(--muted); margin-top: .15rem; }

/* ── App shell ─────────────────────────────────────── */
.int-body { min-height: 100vh; }

.int-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────── */
.int-sidebar {
  background: var(--navy);
  color: var(--silver);
  padding: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.int-sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(204,212,220,.15);
  margin-bottom: .75rem;
}
.brand-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.brand-name { font-size: .85rem; font-weight: 700; color: white; line-height: 1.2; }
.brand-sub  { font-size: .67rem; color: var(--silver); opacity: .7; }

.int-sidebar-section {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--silver);
  opacity: .5;
  padding: .5rem 1rem .25rem;
  margin-top: .25rem;
}
.int-sidebar-spacer { flex: 1; }

.int-nav-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem 1rem;
  font-size: .85rem;
  color: var(--silver);
  border-radius: 6px;
  margin: 1px 6px;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.int-nav-item:hover { background: rgba(255,255,255,.08); color: white; text-decoration: none; }
.int-nav-item.active { background: rgba(204,212,220,.15); color: white; }
.nav-icon { font-size: .85rem; width: 16px; text-align: center; flex-shrink: 0; }

.int-nav-form { margin: 1px 6px; }
.int-nav-btn {
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  text-align: left;
}

/* ── Main area ─────────────────────────────────────── */
.int-main {
  padding: 1.75rem 2rem 3rem;
  max-width: 1000px;
  min-width: 0;
}

.int-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.int-page-title { font-size: 1.5rem; font-weight: 800; color: var(--navy); line-height: 1.2; }
.int-page-sub   { font-size: .875rem; color: var(--muted); margin-top: .25rem; }
.int-back-link  { font-size: .82rem; color: var(--muted); font-weight: 500; }
.int-back-link:hover { color: var(--navy); text-decoration: none; }

/* ── Alerts ────────────────────────────────────────── */
.int-alert {
  padding: .75rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.int-alert-error   { background: var(--red-l);   color: #991b1b; border-color: #fca5a5; }
.int-alert-success { background: var(--green-l); color: #166534; border-color: #86efac; }
.int-alert-info    { background: var(--navy-light); color: var(--navy); border-color: var(--silver); }
.int-alert-warning { background: var(--amber-l); color: #92400e; border-color: #fcd34d; }

/* ── Badges ────────────────────────────────────────── */
.int-badge {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.int-badge-warning { background: var(--amber-l); color: #92400e; }
.int-badge-success { background: var(--green-l); color: #166534; }
.int-badge-danger  { background: var(--red-l);   color: #991b1b; }
.int-badge-default { background: var(--silver-l); color: var(--muted); }

/* ── Buttons ───────────────────────────────────────── */
.int-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .6rem 1.15rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  transition: filter .15s, transform .1s;
  text-decoration: none;
  white-space: nowrap;
}
.int-btn:hover { filter: brightness(1.1); text-decoration: none; }
.int-btn:active { transform: scale(.97); }
.int-btn-primary { background: var(--navy);  color: white; }
.int-btn-success { background: var(--green); color: white; }
.int-btn-danger  { background: var(--red);   color: white; }
.int-btn-warning { background: var(--amber); color: white; }
.int-btn-ghost   { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.int-btn-ghost:hover { background: var(--surface); color: var(--ink); }
.int-btn-sm   { padding: .4rem .85rem; font-size: .8rem; }
.int-btn-full { width: 100%; }

/* ── Hub tool cards ────────────────────────────────── */
.int-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.int-tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow .2s, border-color .2s;
  cursor: pointer;
}
.int-tool-card:hover {
  box-shadow: 0 4px 16px rgba(2,41,80,.1);
  border-color: var(--navy);
  text-decoration: none;
}
.int-tool-card-future { opacity: .55; cursor: default; }
.int-tool-card-future:hover { box-shadow: none; border-color: var(--border); }
.int-tool-icon { font-size: 1.75rem; flex-shrink: 0; line-height: 1; }
.int-tool-info { flex: 1; min-width: 0; }
.int-tool-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; flex-wrap: wrap; }
.int-tool-name  { font-size: 1rem; font-weight: 700; color: var(--navy); }
.int-tool-desc  { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.int-tool-stats { font-size: .75rem; color: var(--muted); margin-top: .5rem; display: block; }
.int-tool-arrow { font-size: 1.1rem; color: var(--muted); align-self: center; flex-shrink: 0; }

/* ── Generating banner ─────────────────────────────── */
.int-generating-banner {
  background: var(--navy-light);
  border: 1px dashed var(--silver);
  border-radius: var(--radius);
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--navy);
  font-size: .875rem;
  margin-bottom: 1rem;
}
.int-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--silver);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Section headers ───────────────────────────────── */
.int-section-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
}
.int-section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.int-section-count {
  background: var(--amber-l);
  color: #92400e;
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 999px;
}

/* ── Empty state ───────────────────────────────────── */
.int-empty {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  padding: 3rem 1.5rem;
  margin-bottom: 1.5rem;
}
.int-empty-icon  { font-size: 2rem; margin-bottom: .75rem; color: var(--green); }
.int-empty-title { font-weight: 700; font-size: 1rem; margin-bottom: .3rem; color: var(--navy); }
.int-empty-sub   { font-size: .875rem; color: var(--muted); }

/* ── Draft cards ───────────────────────────────────── */
.int-draft-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }

.int-draft-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 1.25rem;
  align-items: start;
}
.int-draft-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.int-meta-cat     { font-size: .72rem; color: var(--muted); font-weight: 500; }
.int-meta-attempt { font-size: .72rem; color: var(--amber); font-weight: 600; }
.int-meta-chart   { font-size: .72rem; color: var(--muted); }

.int-draft-title { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.int-draft-title a { color: var(--navy); }
.int-draft-title a:hover { color: var(--navy-mid); text-decoration: none; }
.int-draft-excerpt { font-size: .85rem; color: var(--muted); line-height: 1.5; }
.int-draft-footer { font-size: .75rem; color: var(--muted); margin-top: .65rem; }

.int-draft-actions {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

/* ── Table ─────────────────────────────────────────── */
.int-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.int-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: .875rem;
}
.int-table th {
  background: var(--surface);
  text-align: left;
  padding: .7rem 1rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
}
.int-table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.int-table tr:last-child td { border-bottom: none; }
.int-table tr:hover td { background: var(--surface); }
.int-td-title { font-weight: 600; max-width: 420px; }
.int-td-date  { white-space: nowrap; color: var(--muted); font-size: .82rem; }
.int-table-link { font-size: .8rem; font-weight: 600; color: var(--navy); }

/* ── Action bar (preview page) ─────────────────────── */
.int-action-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.int-action-label   { font-size: .85rem; font-weight: 600; color: var(--muted); margin-right: auto; display: flex; align-items: center; gap: .5rem; }
.int-action-buttons { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ── SEO panel ─────────────────────────────────────── */
.int-seo-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: .82rem;
}
.int-seo-panel-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .6rem; }
.int-seo-title { font-weight: 600; color: #1a0dab; font-size: .9rem; }
.int-seo-url   { color: #006621; font-size: .78rem; margin: .15rem 0; }
.int-seo-desc  { color: #545454; font-size: .82rem; }
.int-seo-keyword { margin-top: .5rem; font-size: .75rem; color: var(--muted); }

/* ── Preview card ──────────────────────────────────── */
.int-preview-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
}
.int-preview-tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .75rem; }
.int-tag { font-size: .7rem; padding: .18rem .5rem; border-radius: 999px; background: var(--navy-light); color: var(--navy); font-weight: 600; }
.int-preview-h1 { font-size: 1.6rem; font-weight: 800; line-height: 1.3; margin-bottom: .4rem; color: var(--navy); }
.int-preview-meta { font-size: .8rem; color: var(--muted); margin-bottom: 1.25rem; }
.int-preview-excerpt {
  font-size: .9rem;
  color: var(--muted);
  border-left: 3px solid var(--navy);
  padding: .5rem 1rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.int-chart-wrap {
  background: var(--navy-light);
  border: 1px solid var(--silver);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}
.int-chart-title { font-size: .9rem; font-weight: 700; color: var(--navy); }
.int-chart-desc  { font-size: .8rem; color: var(--muted); margin: .3rem 0 1rem; }

.int-preview-body { font-size: .95rem; line-height: 1.75; }
.int-preview-body h2 { font-size: 1.3rem; font-weight: 700; margin: 2rem 0 .65rem; color: var(--navy); }
.int-preview-body h3 { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 .5rem; color: var(--ink-2); }
.int-preview-body p  { margin-bottom: 1rem; }
.int-preview-body ul, .int-preview-body ol { margin: .75rem 0 1rem 1.5rem; }
.int-preview-body li { margin-bottom: .35rem; }
.int-preview-body blockquote {
  border-left: 4px solid var(--navy);
  padding: .65rem 1rem;
  background: var(--navy-light);
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
}
.int-preview-body strong { font-weight: 700; }

/* ── Edit form ─────────────────────────────────────── */
.int-edit-form { max-width: 860px; }
.int-form-group { margin-bottom: 1.25rem; }
.int-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.int-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .4rem;
  color: var(--ink-2);
}
.int-label-hint { font-size: .72rem; color: var(--muted); font-weight: 400; }
.int-input {
  width: 100%;
  padding: .65rem .95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  background: var(--white);
  transition: border-color .15s;
}
.int-input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-light); }

.int-edit-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.int-edit-section-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 1rem; }

.int-edit-content-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.int-edit-toolbar { display: flex; align-items: center; gap: .75rem; }
.int-word-count  { font-size: .75rem; color: var(--muted); }

.int-textarea {
  width: 100%;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .83rem;
  font-family: 'JetBrains Mono', 'Fira Mono', monospace;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
  background: var(--white);
}
.int-textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-light); }

.int-md-preview {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  font-size: .92rem;
  line-height: 1.75;
  min-height: 300px;
  margin-top: .5rem;
}
.int-md-preview h2 { font-size: 1.25rem; font-weight: 700; margin: 1.75rem 0 .6rem; color: var(--navy); }
.int-md-preview h3 { font-size: 1.05rem; font-weight: 700; margin: 1.25rem 0 .4rem; }
.int-md-preview p  { margin-bottom: .9rem; }
.int-md-preview ul, .int-md-preview ol { margin: .65rem 0 .9rem 1.5rem; }
.int-md-preview li { margin-bottom: .3rem; }

.int-edit-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}

/* ── Forms shared ──────────────────────────────────── */
.int-btn-full  { width: 100%; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
  .int-layout {
    grid-template-columns: 1fr;
  }
  .int-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: .5rem;
  }
  .int-sidebar-brand { padding: .5rem .75rem; border-bottom: none; margin-bottom: 0; }
  .int-sidebar-section { display: none; }
  .int-sidebar-spacer { display: none; }
  .int-nav-item { padding: .45rem .65rem; font-size: .8rem; }
  .int-main { padding: 1.25rem 1rem 3rem; }
  .int-draft-card { grid-template-columns: 1fr; }
  .int-draft-actions { flex-direction: row; flex-wrap: wrap; }
  .int-form-row { grid-template-columns: 1fr; }
}
