/* RAYFINITE Intranet — Shared Styles
   Brand: Navy #0A1228 · Blue gradient #2E6BFF→#38BDF8 · Violet #7C63D5
   Font: Inter (Google Fonts)
   Author: Pradeep Singala Reddy / RAYFINITE LLC
*/

/* ── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #060d1a;
  color: #e2e8f0;
  min-height: 100vh;
  line-height: 1.6;
}

a { color: #38BDF8; text-decoration: none; }
a:hover { color: #7dd3fc; }

/* ── Brand Tokens ───────────────────────────────────────────────────────── */
:root {
  --navy:        #0A1228;
  --navy-light:  #0f1c38;
  --navy-card:   #111d35;
  --blue-start:  #2E6BFF;
  --blue-end:    #38BDF8;
  --violet:      #7C63D5;
  --violet-soft: #9d88e8;
  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --border:      rgba(46, 107, 255, 0.18);
  --border-soft: rgba(255,255,255,0.07);
  --success:  #22d3a4;
  --warning:  #fbbf24;
  --danger:   #f87171;
  --gradient: linear-gradient(135deg, #2E6BFF, #38BDF8);
  --gradient-violet: linear-gradient(135deg, #7C63D5, #38BDF8);
  --sidebar-w: 220px;
  --topbar-h:  56px;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem;
  max-width: 1200px;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-soft);
}

.sidebar-wordmark {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  line-height: 1.2;
}

.sidebar-sub {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 0.2rem;
}

.sidebar-role-badge {
  margin: 0.75rem 1.25rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet-soft);
  background: rgba(124,99,213,0.15);
  border: 1px solid rgba(124,99,213,0.3);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

.sidebar-nav {
  padding: 1rem 0;
  flex: 1;
}

.nav-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem 0.35rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(46,107,255,0.08);
}

.nav-link.active {
  color: #38BDF8;
  background: rgba(46,107,255,0.12);
  border-left-color: #2E6BFF;
  -webkit-text-fill-color: unset;
}

.nav-link .nav-icon {
  font-size: 1rem;
  width: 1.2rem;
  text-align: center;
  opacity: 0.85;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.75rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.page-title-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--navy-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--border);
  box-shadow: 0 4px 24px rgba(46,107,255,0.1);
}

.card-link {
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ── Grid ────────────────────────────────────────────────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

/* ── Status Pills ────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill-ongoing   { background: rgba(46,107,255,0.18);  color: #60a5fa; border: 1px solid rgba(46,107,255,0.3); }
.pill-delivered { background: rgba(34,211,164,0.15);  color: #6ee7d4; border: 1px solid rgba(34,211,164,0.3); }
.pill-future    { background: rgba(124,99,213,0.15);  color: #c4b5fd; border: 1px solid rgba(124,99,213,0.3); }
.pill-draft     { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); }
.pill-blocked   { background: rgba(248,113,113,0.15); color: #fca5a5; border: 1px solid rgba(248,113,113,0.3); }
.pill-shipped   { background: rgba(34,211,164,0.15);  color: #6ee7d4; border: 1px solid rgba(34,211,164,0.3); }
.pill-in-progress { background: rgba(251,191,36,0.12); color: #fde68a; border: 1px solid rgba(251,191,36,0.25); }

/* ── Progress Bar ────────────────────────────────────────────────────────── */
.progress-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient);
  transition: width 0.5s ease;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ── Section Dividers ────────────────────────────────────────────────────── */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-soft);
}

/* ── Activity Feed ───────────────────────────────────────────────────────── */
.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gradient);
  margin-top: 0.4rem;
  flex-shrink: 0;
}

.activity-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-soft);
}

td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
  vertical-align: top;
}

tr:hover td { background: rgba(46,107,255,0.04); }

/* ── Milestone Timeline ──────────────────────────────────────────────────── */
.milestone-list { list-style: none; }

.milestone-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0;
  align-items: flex-start;
}

.milestone-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 0.15rem;
  font-size: 0.6rem;
}

.milestone-check.done {
  background: var(--gradient);
  border-color: transparent;
  color: white;
}

.milestone-title { font-size: 0.875rem; color: var(--text-primary); }
.milestone-date  { font-size: 0.72rem; color: var(--text-muted); }

/* ── Accomplishments Timeline ────────────────────────────────────────────── */
.acc-timeline { position: relative; padding-left: 1.5rem; }

.acc-timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border-soft);
}

.acc-entry {
  position: relative;
  margin-bottom: 1.5rem;
}

.acc-entry::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.5rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gradient);
  border: 2px solid #060d1a;
}

.acc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.acc-agent {
  font-size: 0.7rem;
  font-weight: 600;
  color: #38BDF8;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.acc-project-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(124,99,213,0.15);
  color: var(--violet-soft);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

.acc-date { font-size: 0.7rem; color: var(--text-muted); margin-left: auto; }

.acc-tasks { margin: 0.35rem 0 0.4rem; padding-left: 1.1rem; }
.acc-tasks li { font-size: 0.825rem; color: var(--text-secondary); margin-bottom: 0.2rem; }

.acc-goal {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-style: italic;
  border-left: 2px solid var(--violet);
  padding-left: 0.6rem;
  margin-top: 0.4rem;
}

.acc-notes {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ── Filters / Toolbar ───────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  align-items: center;
}

.filter-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
  background: rgba(46,107,255,0.18);
  border-color: rgba(46,107,255,0.4);
  color: #38BDF8;
}

.search-input {
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  width: 200px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: rgba(46,107,255,0.4);
  background: rgba(46,107,255,0.06);
}

/* ── Quick Link Cards (Dashboard) ────────────────────────────────────────── */
.quick-card {
  background: var(--navy-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.quick-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.2s;
}

.quick-card:hover {
  border-color: var(--border);
  box-shadow: 0 8px 32px rgba(46,107,255,0.12);
  transform: translateY(-2px);
}

.quick-card:hover::before { opacity: 1; }

.quick-card-icon { font-size: 1.6rem; }
.quick-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex: 1;
}

.quick-card-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  align-self: flex-end;
}

/* ── Stat Chips (Dashboard) ──────────────────────────────────────────────── */
.stats-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.stat-chip {
  background: var(--navy-card);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 0.75rem 1.1rem;
  min-width: 120px;
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Handbook iframe ─────────────────────────────────────────────────────── */
.handbook-frame {
  width: 100%;
  height: calc(100vh - 180px);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: white;
}

/* ── Detail Page ─────────────────────────────────────────────────────────── */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.detail-icon { font-size: 2.5rem; }

.detail-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.detail-section {
  background: var(--navy-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.detail-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-soft);
}

/* ── Deliverable Row ─────────────────────────────────────────────────────── */
.deliverable-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.deliverable-row:last-child { border-bottom: none; }

.deliverable-type {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  width: 56px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.deliverable-title {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.deliverable-lock {
  font-size: 0.7rem;
  color: var(--warning);
  margin-left: 0.3rem;
}

/* ── Admin-only blurred overlay ──────────────────────────────────────────── */
.admin-blur {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  opacity: 0.4;
}

.admin-gate {
  position: relative;
}

.admin-gate-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--warning);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(6,13,26,0.6);
  border-radius: 6px;
  gap: 0.3rem;
}

/* ── Back link ───────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  transition: color 0.15s;
}

.back-link:hover { color: #38BDF8; }

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.75rem; }
.mono         { font-family: 'SF Mono', 'Fira Code', monospace; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.ml-auto { margin-left: auto; }

/* ── Banner ──────────────────────────────────────────────────────────────── */
.banner {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.banner-info {
  background: rgba(46,107,255,0.1);
  border: 1px solid rgba(46,107,255,0.25);
  color: #93c5fd;
}

.banner-warning {
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.25);
  color: #fde68a;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open { transform: translateX(0); width: 220px; }

  .main-content {
    margin-left: 0;
    padding: 1rem 1.25rem;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: var(--navy-card);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    margin-bottom: 1rem;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn { display: none; }
}
