:root {
  --primary: #1e3a8a;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --secondary: #475569;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --success: #16a34a;
  --danger: #dc2626;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.app-header {
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header-top {
  background: #ffffff;
  padding: 0.65rem 0;
}

.header-top .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 1.25rem;
  line-height: 1;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  flex-shrink: 0;
}

.logo-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
  line-height: 1.1;
}

.logo em {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}

.logo-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.header-divider {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
  margin: 0 0.15rem;
  flex-shrink: 0;
}

.btn-action-upload {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #1d4ed8;
  height: 36px;
  padding: 0 0.9rem;
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
  transition: all 0.18s ease;
}

.btn-action-upload:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(37, 99, 235, 0.25);
}

.btn-sm-header {
  height: 36px !important;
  padding: 0 0.85rem !important;
  font-size: 0.84rem !important;
  line-height: 1 !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-reset-header:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: #fecaca !important;
}

/* SUB-BAR NAVIGASI */
.header-nav-bar {
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid var(--border);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-nav::-webkit-scrollbar {
  display: none;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  height: 36px;
  padding: 0 0.95rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--secondary);
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
  transition: all 0.18s ease;
}

.nav-btn:hover {
  background: #eff6ff;
  color: var(--primary);
}

.nav-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 600;
  border-color: #dbeafe;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.public-announcement {
  background: linear-gradient(90deg, #eff6ff 0%, #fef3c7 100%);
  border-bottom: 1px solid #fde68a;
  color: #1e3a8a;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
  padding: 0.5rem 1.25rem;
}

/* BUTTONS */
button {
  font-family: inherit;
  outline: none;
}

button:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  line-height: 1.25;
  transition: all 0.18s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #fff;
  color: var(--secondary);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  line-height: 1.25;
  transition: all 0.18s ease;
}

.btn-secondary:hover {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: #cbd5e1;
}

.btn-add {
  background: #f8fafc;
  color: var(--primary);
  border: 1.5px dashed #93c5fd;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-add:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid #fca5a5;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-danger-outline:hover {
  background: #fee2e2;
}

/* MAIN */
.app-main {
  max-width: 1100px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
  flex: 1;
}

/* PROGRESS BAR */
.progress-wrap {
  background: #fff;
  padding: 1.25rem 2rem 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  position: relative;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 1;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.2s;
}

.step.active .step-num {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.step.active .step-label {
  color: var(--primary);
  font-weight: 700;
}

.step.completed .step-num {
  background: var(--success);
  color: #fff;
}

.progress-bar-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 20%;
  background: var(--primary);
  transition: width 0.3s ease;
}

/* PAGES & FORMS */
.page {
  display: none;
}

.page.active {
  display: block;
}

.form-step {
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.form-step.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-header {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.step-header h2 {
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.step-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full {
  grid-column: span 2;
}

label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.req {
  color: var(--danger);
}

.hint {
  font-size: 0.775rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

/* SECTION DIVIDERS & CARDS */
.section-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
  border-bottom: 1px solid #bfdbfe;
  padding-bottom: 0.5rem;
}

.inventor-card,
.example-card,
.claim-card,
.figure-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  position: relative;
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.card-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--secondary);
}

.editor-toolbar {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-bottom: 0.25rem;
}

.tool-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--secondary);
  font-weight: 500;
}

.tool-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

/* CLAIMS SPECIAL */
.claim-card.independent {
  border-left: 4px solid var(--primary);
}

.claim-card.dependent {
  border-left: 4px solid var(--accent);
  margin-left: 1.5rem;
}

.claim-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  text-transform: uppercase;
}

.claim-tag.indep {
  background: #dbeafe;
  color: #1e40af;
}

.claim-tag.dep {
  background: #fef3c7;
  color: #92400e;
}

.claim-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.btn-add-dep {
  border-color: #fcd34d;
  color: #b45309;
}

.btn-add-dep:hover {
  background: #fffbeb;
  border-color: #f59e0b;
}

.tips-box {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.tips-box ul {
  margin: 0.5rem 0 0 1.25rem;
  color: #78350f;
}

.word-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.25rem;
}

.word-counter.warning {
  color: var(--danger);
  font-weight: 700;
}

/* STEP NAVIGATION */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* DONE SCREEN */
.done-screen {
  text-align: center;
  padding: 2rem 1rem;
}

.done-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.done-screen h2 {
  font-size: 1.8rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.done-screen p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.done-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.done-tips {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
}

.done-tips h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.done-tips ol {
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.done-tips li {
  margin-bottom: 0.4rem;
}

/* PREVIEW DOCUMENT */
.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.preview-tools {
  display: flex;
  gap: 0.75rem;
}

.preview-document {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 3.5rem 4rem;
  border-radius: var(--radius);
  font-family: 'Times New Roman', Times, serif;
  color: #111;
  line-height: 1.8;
  font-size: 1.05rem;
  max-width: 900px;
  margin: 0 auto;
}

.preview-document h1 {
  text-align: center;
  font-size: 1.5rem;
  text-transform: uppercase;
  margin-bottom: 2rem;
  letter-spacing: 0.5px;
}

.preview-document h2 {
  text-align: center;
  font-size: 1.2rem;
  text-transform: uppercase;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #111;
  padding-bottom: 0.25rem;
}

.preview-document h3 {
  font-size: 1.1rem;
  text-transform: uppercase;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.preview-document p {
  text-align: justify;
  margin-bottom: 1rem;
  text-indent: 2.5em;
}

.preview-document p.no-indent {
  text-indent: 0;
}

.preview-document .meta-table {
  width: 100%;
  margin-bottom: 2rem;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}

.preview-document .meta-table td {
  padding: 0.35rem 0.5rem;
  vertical-align: top;
}

.preview-document .meta-table td:first-child {
  font-weight: 600;
  width: 200px;
  color: #334155;
}

.preview-document ol.claims-list {
  padding-left: 2rem;
  margin-bottom: 1.5rem;
}

.preview-document ol.claims-list li {
  margin-bottom: 1rem;
  text-align: justify;
}

/* HISTORY PAGE */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.draft-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

.draft-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.draft-info h3 {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.draft-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
}

.draft-actions {
  display: flex;
  gap: 0.5rem;
}

/* GUIDE PAGE */
.guide-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.guide-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border);
  margin: 1.5rem 0;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s;
}

.req-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.req-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.req-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.req-card h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.req-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.procedure-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.proc-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #f8fafc;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.proc-num {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.law-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.law-table th, .law-table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}

.law-table th {
  background: #f1f5f9;
  font-weight: 600;
}

.info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fadeIn 0.2s ease-out;
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 1.5rem;
}

.export-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.export-opt {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.export-opt:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.exp-icon {
  font-size: 1.5rem;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 300;
  animation: slideUp 0.3s ease;
}

.toast.active {
  display: block;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .header-top .header-container {
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .header-actions {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
  }
  .header-actions::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 1rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full {
    grid-column: span 1;
  }
  .progress-steps {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .step-label {
    display: none;
  }
  .req-grid {
    grid-template-columns: 1fr;
  }
  .preview-document {
    padding: 1.5rem;
  }
}

/* PRINT MEDIA */
@media print {
  body * {
    visibility: hidden;
  }
  .preview-document,
  .preview-document * {
    visibility: visible;
  }
  .preview-document {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
  }
  .preview-toolbar,
  .app-header,
  .progress-wrap {
    display: none !important;
  }
}

/* =========================================
   AI PATENT EXAMINER STYLES
   ========================================= */

.ai-header-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e1b4b 100%);
  color: #fff;
  padding: 1.75rem 2rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.ai-header-info h2 {
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
  color: #fff;
}

.ai-header-info p {
  color: #bfdbfe;
  font-size: 0.9rem;
  max-width: 650px;
}

.ai-model-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.8rem;
  gap: 0.15rem;
}

.badge-status.online {
  color: #4ade80;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-model {
  color: #f1f5f9;
  font-weight: 500;
}

.ai-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.ai-actions-left {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* AI EMPTY CARD */
.ai-empty-card {
  background: #fff;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 4rem 2rem;
  text-align: center;
  margin-top: 1rem;
}

.ai-empty-card .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.ai-empty-card h3 {
  font-size: 1.3rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.ai-empty-card p {
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto 1.75rem;
  font-size: 0.95rem;
}

.btn-large {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
}

/* AI LOADING CARD */
.ai-loading-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.ai-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #dbeafe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ai-loading-text h3 {
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.ai-loading-text p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* AI SCORE CARD */
.ai-score-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.score-circle-wrap {
  flex-shrink: 0;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #eff6ff;
  border: 8px solid var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.score-circle.high {
  border-color: #16a34a;
  background: #f0fdf4;
}

.score-circle.medium {
  border-color: #d97706;
  background: #fffbeb;
}

.score-circle.low {
  border-color: #dc2626;
  background: #fef2f2;
}

.score-number {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.score-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 0.2rem;
}

.score-summary h3 {
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.score-summary p {
  color: var(--secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.score-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 14px;
}

.score-badge.pass {
  background: #dcfce7;
  color: #15803d;
}

.score-badge.warning {
  background: #fef3c7;
  color: #b45309;
}

.score-badge.danger {
  background: #fee2e2;
  color: #b91c1c;
}

/* 4 PILLARS GRID */
.ai-pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pillar-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}

.pillar-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.pillar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.pillar-header h4 {
  font-size: 1rem;
  color: var(--text-main);
  flex: 1;
  margin-left: 0.5rem;
}

.pillar-icon {
  font-size: 1.3rem;
}

.pillar-status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
}

.pillar-status.good {
  background: #dcfce7;
  color: #166534;
}

.pillar-status.warn {
  background: #fef3c7;
  color: #92400e;
}

.pillar-status.bad {
  background: #fee2e2;
  color: #991b1b;
}

.pillar-card p {
  font-size: 0.875rem;
  color: var(--secondary);
  line-height: 1.5;
}

/* AI DETAILS TABS */
.ai-details-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ai-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.7rem 0.85rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.ai-tab-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 0.48rem 0.85rem;
  border-radius: 7px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.ai-tab-btn:hover {
  color: var(--primary);
  border-color: #bfdbfe;
  background: #eff6ff;
}

.ai-tab-btn.active {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.2);
}

.ai-tab-panel {
  display: none;
  padding: 1.75rem 2rem;
}

.ai-tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-body {
  font-size: 0.925rem;
  line-height: 1.7;
  color: var(--text-main);
}

.tab-body h4 {
  color: var(--primary);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.tab-body p {
  margin-bottom: 0.75rem;
}

.tab-body ul, .tab-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.tab-body li {
  margin-bottom: 0.4rem;
}

.suggestion-box {
  background: #f8fafc;
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1rem;
}

.suggestion-box.urgent {
  border-left-color: var(--danger);
  background: #fff5f5;
}

.suggestion-box.good {
  border-left-color: var(--success);
  background: #f0fdf4;
}

.keyword-tag {
  display: inline-block;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
  margin: 0.2rem;
}

.search-string-box {
  background: #0f172a;
  color: #38bdf8;
  font-family: monospace;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin: 0.75rem 0 1.25rem;
  overflow-x: auto;
}

.ai-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .ai-header-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .ai-score-card {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  .ai-pillars-grid {
    grid-template-columns: 1fr;
  }
  .ai-detail-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ai-detail-tabs::-webkit-scrollbar {
    display: none;
  }
}

/* =========================================
   QUICK IMPORT & UPLOAD MODAL STYLES
   ========================================= */

.quick-import-banner {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.quick-import-banner .banner-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.quick-import-banner .banner-text {
  flex: 1;
}

.quick-import-banner .banner-text strong {
  display: block;
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.quick-import-banner .banner-text p {
  font-size: 0.875rem;
  color: var(--secondary);
  margin: 0;
  line-height: 1.5;
}

.import-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.import-tab-btn {
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.import-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.file-drop-zone {
  border: 2px dashed #93c5fd;
  background: #f8fafc;
  padding: 1.65rem 1.25rem;
  text-align: center;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-drop-zone:hover,
.file-drop-zone.drag-active {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.file-read-status {
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.45;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

.file-read-status.ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.file-read-status.err {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

@media (max-width: 768px) {
  .quick-import-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- LICENSE BADGE & MODAL (PINTASPAPER) --- */
.btn-license {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  height: 36px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: none;
  padding: 0 0.95rem;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.28);
  transition: all 0.18s ease;
}
.btn-license:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(217, 119, 6, 0.4);
}
.btn-license.active-pro {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.license-info-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.license-status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
}
.license-status-badge.pro {
  background: #dcfce7;
  color: #15803d;
}
.license-status-badge.unlicensed {
  background: #fee2e2;
  color: #b91c1c;
}

/* --- SIDE-BY-SIDE DIFF VIEW --- */
.diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 900px) {
  .diff-container {
    grid-template-columns: 1fr;
  }
}
.diff-pane {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.diff-pane-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.diff-pane.original .diff-pane-title { color: #dc2626; }
.diff-pane.revised .diff-pane-title { color: #16a34a; }

.diff-content {
  font-family: 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.7;
  max-height: 480px;
  overflow-y: auto;
  white-space: pre-wrap;
  padding: 0.5rem;
  background: #fafafa;
  border-radius: 4px;
}
.diff-del {
  background-color: #fee2e2;
  color: #991b1b;
  text-decoration: line-through;
  padding: 0 2px;
  border-radius: 2px;
}
.diff-ins {
  background-color: #dcfce7;
  color: #166534;
  font-weight: 600;
  padding: 0 2px;
  border-radius: 2px;
}

/* --- 8 FORMALITAS DJKI CARDS --- */
.formalities-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 1rem;
}
@media (max-width: 800px) {
  .formalities-grid { grid-template-columns: 1fr; }
}
.formality-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  border-left: 4px solid #94a3b8;
}
.formality-item.complete {
  border-left-color: #16a34a;
  background: #f0fdf4;
}
.formality-item.warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}
.formality-item.missing {
  border-left-color: #dc2626;
  background: #fef2f2;
}
.formality-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}
.formality-rule {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}
.formality-note {
  font-size: 0.825rem;
  font-weight: 500;
}
