/* ══════════════════════════════════════════════════
   LEXRYTE – Shared Stylesheet
   style.css
══════════════════════════════════════════════════ */

/* ─── CSS Variables ─────────────────────────────── */
:root {
  --primary:   #1a1a2e;
  --accent:    #e63946;
  --accent2:   #f4a261;
  --surface:   #ffffff;
  --surface2:  #f7f8fc;
  --border:    #e8eaf0;
  --muted:     #8b90a0;
  --text:      #1a1a2e;
  --sidebar-w: 220px;
  --nav-h:     64px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--surface2);
  color: var(--text);
  min-height: 100vh;
}

/* ─── LOGO ─────────────────────────────────────── */
.logo-img { height: 36px; width: auto; object-fit: contain; }

/* ─── LOGIN PAGE ────────────────────────────────── */
#page-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-hero {
  background: var(--primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='600' height='600' viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff08' stroke-width='1'%3E%3Ccircle cx='300' cy='300' r='200'/%3E%3Ccircle cx='300' cy='300' r='150'/%3E%3Ccircle cx='300' cy='300' r='100'/%3E%3Ccircle cx='300' cy='300' r='250'/%3E%3Cline x1='0' y1='0' x2='600' y2='600'/%3E%3Cline x1='600' y1='0' x2='0' y2='600'/%3E%3C/g%3E%3C/svg%3E") center/cover;
}

.login-hero-content { position: relative; z-index: 1; text-align: center; color: #fff; }
.login-hero-content .hero-tagline { font-family: 'DM Serif Display', serif; font-size: 2rem; line-height: 1.2; margin: 1rem 0 0.5rem; }
.login-hero-content .hero-sub { font-size: 1rem; opacity: .7; }
.login-hero-content .hero-divider { width: 40px; height: 2px; background: var(--accent); margin: 1.2rem auto; }

.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: #fff;
}

.login-card { width: 100%; max-width: 420px; }
.login-card h2 { font-family: 'DM Serif Display', serif; font-size: 1.75rem; margin-bottom: .25rem; }
.login-card .sub { color: var(--muted); font-size: .875rem; margin-bottom: 2rem; }

.form-label { font-size: .8125rem; font-weight: 600; letter-spacing: .03em; color: var(--muted); margin-bottom: .4rem; }
.form-control {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .65rem 1rem;
  font-size: .9rem;
  transition: border-color .2s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,26,46,.08); }

.btn-primary-custom {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .75rem 1.5rem;
  font-weight: 600;
  font-size: .95rem;
  width: 100%;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn-primary-custom:hover { background: #16213e; }
.btn-primary-custom:active { transform: scale(.98); }

.divider-or { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .8rem; margin: 1.25rem 0; }
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .6rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  width: 100%;
}
.btn-social:hover { background: var(--surface2); border-color: #ccc; }

.badge-secure {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  color: var(--muted);
  margin-top: 1.5rem;
}

.forgot-link {
  font-size: .8rem;
  color: var(--muted);
  text-decoration: none;
  display: block;
  text-align: right;
  margin-top: .4rem;
}
.forgot-link:hover { color: var(--text); }

/* ─── APP SHELL ─────────────────────────────────── */
#page-app { display: none; min-height: 100vh; }
#page-app.active { display: flex; flex-direction: column; }

/* ─── TOP NAV ───────────────────────────────────── */
.top-nav {
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-links { display: flex; align-items: center; gap: .25rem; flex: 1; margin-left: 1rem; }
.nav-link-item {
  padding: .4rem .85rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-link-item:hover { color: var(--text); background: var(--surface2); }
.nav-link-item.active { color: var(--primary); font-weight: 600; border-bottom: 2px solid var(--primary); border-radius: 0; padding-bottom: .3rem; }

.nav-right { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.nav-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem; font-weight: 700;
}
.nav-user-name { font-size: .875rem; font-weight: 600; }
.nav-user-role { font-size: .72rem; color: var(--muted); }

/* ─── MAIN LAYOUT ───────────────────────────────── */
.app-body { display: flex; flex: 1; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex-shrink: 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .85rem;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.sidebar-item i { font-size: 1rem; }
.sidebar-item:hover { background: var(--surface2); color: var(--text); }
.sidebar-item.active { background: var(--primary); color: #fff; }

/* Analyze New Case CTAs */
.sidebar-cta {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 10px;
  font-weight: 600 !important;
  letter-spacing: .01em;
  box-shadow: 0 2px 10px rgba(26,26,46,.18);
  transition: opacity .15s, transform .1s !important;
}
.sidebar-cta:hover { opacity: .88; transform: translateY(-1px); background: var(--primary) !important; color: #fff !important; }

.sidebar-cta-outline {
  background: transparent !important;
  color: var(--primary) !important;
  border-radius: 10px;
  font-weight: 600 !important;
  letter-spacing: .01em;
  border: 1.5px solid var(--primary) !important;
  margin-top: .35rem;
  transition: background .15s, transform .1s !important;
}
.sidebar-cta-outline:hover { background: rgba(26,26,46,.06) !important; transform: translateY(-1px); }
.sidebar-cta-outline.active { background: var(--primary) !important; color: #fff !important; }
.sidebar-cta-outline.active span:last-child { background: rgba(255,255,255,.22) !important; color: #fff !important; }

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* ─── STAT CARDS ─────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.07); }
.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.stat-icon.red   { background: #fff0f0; color: var(--accent); }
.stat-icon.orange{ background: #fff5eb; color: var(--accent2); }
.stat-icon.blue  { background: #eef2ff; color: #4f46e5; }
.stat-icon.green { background: #edfaf1; color: #22c55e; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.stat-alert { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: .35rem; }

/* ─── SECTION CARD ────────────────────────────────── */
.section-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}
.section-title { font-weight: 700; font-size: 1rem; margin-bottom: 1rem; }

/* ─── DEADLINE CHART ──────────────────────────────── */
.chart-bar-wrap { display: flex; align-items: flex-end; gap: .5rem; height: 80px; margin-bottom: .5rem; }
.chart-bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: var(--border);
  transition: background .2s;
}
.chart-bar.active { background: var(--primary); }
.chart-bar.peak   { background: var(--accent2); }
.chart-days { display: flex; gap: .5rem; }
.chart-days span { flex: 1; text-align: center; font-size: .7rem; color: var(--muted); }

/* ─── CASE LIST ──────────────────────────────────── */
.case-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.case-row:last-child { border-bottom: none; }
.case-dot   { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.case-name  { font-weight: 600; flex: 1; }
.case-action{ color: var(--muted); font-size: .8rem; }
.badge-due  { font-size: .72rem; font-weight: 600; padding: .25rem .6rem; border-radius: 20px; }
.badge-due.red   { background: #fff0f0; color: var(--accent); }
.badge-due.orange{ background: #fff5eb; color: var(--accent2); }
.badge-due.gray  { background: var(--surface2); color: var(--muted); }

/* ─── AI ACTIVITY ─────────────────────────────────── */
.ai-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.ai-item:last-child { border-bottom: none; }
.ai-item-icon  { color: var(--muted); font-size: .9rem; margin-top: .1rem; }
.ai-item-title { font-weight: 600; }
.ai-item-meta  { font-size: .75rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ai-item-meta .sep { opacity: .4; }

/* ─── CHAT / AI ASSIST ───────────────────────────── */
.chat-bubble {
  background: var(--surface2);
  border-radius: 12px 12px 12px 0;
  padding: 1rem 1.25rem;
  font-size: .875rem;
  max-width: 85%;
}
.chat-bubble.user {
  background: var(--primary);
  color: #fff;
  border-radius: 12px 12px 0 12px;
  margin-left: auto;
}
.chat-ref { font-size: .78rem; color: var(--muted); margin-top: .75rem; }
.chat-ref ol { padding-left: 1.25rem; }
.chat-ref li  { margin-bottom: .25rem; }

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: #fff;
}
.chat-input-bar input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .65rem 1rem;
  font-size: .875rem;
  outline: none;
}
.btn-send {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .65rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}

/* ─── DOCUMENT VIEW ─────────────────────────────── */
.doc-paper {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  font-size: .875rem;
  line-height: 1.8;
}
.doc-paper .doc-header { text-align: center; margin-bottom: 1.5rem; }
.doc-paper .doc-title  { font-family: 'DM Serif Display', serif; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .05em; }

/* ─── BREADCRUMB ─────────────────────────────────── */
.breadcrumb-custom {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.breadcrumb-custom span         { cursor: pointer; }
.breadcrumb-custom span:hover   { color: var(--text); }
.breadcrumb-custom .current     { color: var(--text); font-weight: 600; }

/* ─── PAGE VISIBILITY ─────────────────────────────── */
.tab-pane-custom        { display: none; }
.tab-pane-custom.active { display: block; }

/* ─── WELCOME BANNER ─────────────────────────────── */
.welcome-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.welcome-bar h1          { font-family: 'DM Serif Display', serif; font-size: 1.75rem; }
.welcome-bar h1 strong   { color: var(--accent); }
.welcome-bar .date       { font-size: .85rem; color: var(--muted); }

.search-box {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .5rem 1rem;
  background: #fff;
  font-size: .875rem;
  min-width: 220px;
}
.search-box input { border: none; outline: none; flex: 1; font-size: .875rem; }

/* ─── SIDEBAR TOGGLE ──────────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text);
}

/* ─── UPLOAD / ANALYZE COMPONENTS ────────────────── */
/* Modal overlay */
.upload-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,20,.45);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.upload-overlay.open { display: flex; }

.upload-modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  overflow: hidden;
  animation: modalIn .25s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes modalIn {
  from { opacity:0; transform:scale(.94) translateY(16px); }
  to   { opacity:1; transform:scale(1)  translateY(0); }
}

.upload-modal-header {
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.upload-modal-header h2 { font-family: 'DM Serif Display', serif; font-size: 1.3rem; margin-bottom: .25rem; }
.upload-modal-header p  { font-size: .8rem; color: var(--muted); }

.upload-modal-body   { padding: 1.5rem 1.75rem; }
.upload-modal-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}

/* Step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.25rem;
}
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  border: 2px solid var(--border);
  color: var(--muted);
  transition: all .2s;
}
.step-dot.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-dot.done   { background: #22c55e;        border-color: #22c55e;        color: #fff; }
.step-line       { flex: 1; height: 2px; background: var(--border); border-radius: 2px; }
.step-line.done  { background: #22c55e; }
.step-label      { font-size: .72rem; color: var(--muted); white-space: nowrap; }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: var(--surface2);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--primary); background: #f0f0fa; }
.drop-zone .drop-icon { font-size: 2.5rem; color: var(--muted); margin-bottom: .75rem; }
.drop-zone h3          { font-size: 1.05rem; font-weight: 700; margin-bottom: .4rem; }
.drop-zone p           { font-size: .8rem; color: var(--muted); font-style: italic; max-width: 320px; margin: 0 auto .75rem; }
.drop-zone .formats    { font-size: .72rem; color: var(--muted); }

/* File progress row */
.file-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-top: 1rem;
  background: #fff;
}
.file-row .file-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: #fff0f0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--accent); flex-shrink: 0;
}
.file-row .file-name         { font-size: .875rem; font-weight: 600; }
.file-row .file-progress-wrap{ flex: 1; }
.file-row .progress          { height: 5px; border-radius: 3px; margin-top: .35rem; }
.file-row .progress-bar      { background: var(--primary); }
.file-row .pct               { font-size: .8rem; color: var(--muted); flex-shrink: 0; }

/* Metadata success banner */
.meta-success {
  text-align: center;
  padding: 1.25rem;
  border: 1.5px solid #d1fae5;
  border-radius: 12px;
  background: #f0fdf4;
  margin-bottom: 1.25rem;
}
.meta-success .check-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: #22c55e; color: #fff; font-size: .9rem; margin-right: .5rem;
}
.meta-success .title { font-size: 1.1rem; font-weight: 700; display: inline; vertical-align: middle; }
.meta-success .sub   { font-size: .8rem; color: var(--muted); margin-top: .35rem; }

/* Metadata table */
.meta-table { border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.meta-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.meta-row:last-child { border-bottom: none; }
.meta-row .meta-icon { color: var(--muted); font-size: .95rem; width: 20px; text-align: center; }
.meta-row .meta-key  { color: var(--muted); min-width: 120px; }
.meta-row .meta-val  { font-weight: 600; }
.meta-row .create-btn {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .5rem 1.1rem;
  font-size: .825rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.meta-row .create-btn:hover { opacity: .85; }

/* PDF attachment row */
.attach-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-top: .75rem;
  font-size: .875rem;
  cursor: pointer;
  transition: background .15s;
}
.attach-row:hover         { background: var(--surface2); }
.attach-row .attach-icon  { color: var(--accent); font-size: 1rem; }
.attach-row .attach-name  { flex: 1; font-weight: 500; }
.attach-row .chevron      { color: var(--muted); }

/* Shared modal buttons */
.btn-modal-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .6rem 1.4rem;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-modal-primary:hover    { opacity: .85; }
.btn-modal-primary:disabled { opacity: .45; cursor: not-allowed; }

.btn-modal-secondary {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .6rem 1.4rem;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-modal-secondary:hover { background: var(--surface2); }

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 991px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .sidebar.open {
    display: flex;
    position: fixed;
    inset: var(--nav-h) auto 0 0;
    width: 220px;
    z-index: 99;
    box-shadow: 4px 0 20px rgba(0,0,0,.1);
  }
  .sidebar-toggle { display: block; }
  .nav-link-item  { font-size: .78rem; padding: .35rem .6rem; }
}

@media (max-width: 767px) {
  #page-login     { grid-template-columns: 1fr; }
  .login-hero     { display: none; }
  .main-content   { padding: 1.25rem; }
  .welcome-bar h1 { font-size: 1.3rem; }
  .nav-links      { display: none; }
}

@media (max-width: 575px) {
  .stat-card  { padding: 1rem; }
  .stat-value { font-size: 1.3rem; }
  .search-box { min-width: 0; width: 100%; }
}
