/* SWP Manuals — shared styles */

:root {
  --navy: #1F3A5F;
  --navy-dark: #15283F;
  --blue: #2E75B6;
  --blue-hover: #245a8e;
  --grey-900: #1a1a1a;
  --grey-700: #4a4a4a;
  --grey-500: #767676;
  --grey-300: #cccccc;
  --grey-200: #e5e5e5;
  --grey-100: #f2f2f2;
  --grey-50:  #f9f9f9;
  --white: #ffffff;
  --green: #2e7d32;
  --amber: #e8a317;
  --red: #c62828;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  color: var(--grey-900);
  background: var(--grey-50);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }

/* ---------- Header ---------- */
.header {
  background: var(--navy);
  color: var(--white);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--navy-dark);
}
.header-brand {
  display: flex; align-items: center; gap: 14px;
}
.header-logo {
  width: 44px; height: 44px;
  background: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--navy);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.5px;
}
.header-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.header-sub { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-top: 2px; }
.header-right { display: flex; gap: 16px; align-items: center; }
.header-link {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 6px;
  transition: background .15s;
}
.header-link:hover { background: rgba(255,255,255,0.1); color: var(--white); text-decoration: none; }

/* ---------- Layout ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
}
.container-narrow { max-width: 800px; }

/* ---------- Search bar ---------- */
.search-wrap {
  max-width: 760px;
  margin: 0 auto 48px;
  position: relative;
}
.search-input {
  width: 100%;
  font-size: 18px;
  padding: 18px 20px 18px 54px;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46,117,182,.15);
}
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--grey-500);
  pointer-events: none;
}
.search-meta {
  color: var(--grey-500);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}

/* ---------- Section header ---------- */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 0 0 16px;
}

/* ---------- App card grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--grey-200);
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-size: 18px;
}
.card-icon-factory   { background: #e8f5e9; color: var(--green); }
.card-icon-shield    { background: #fdecec; color: var(--red); }
.card-icon-deposit   { background: #fff4e5; color: var(--amber); }
.card-icon-invoice   { background: #f3e5f5; color: #8e24aa; }
.card-icon-bids      { background: #e3f2fd; color: var(--blue); }
.card-icon-dashboard { background: #e8eaf6; color: #3949ab; }
.card-icon-forecast  { background: #e0f7fa; color: #00838f; }
.card-icon-default   { background: var(--grey-100); color: var(--grey-700); }

.card-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; color: var(--grey-900); }
.card-desc { color: var(--grey-700); font-size: 14px; margin: 0 0 16px; min-height: 42px; }

.manual-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.manual-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--grey-100);
  color: var(--grey-700);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .12s;
}
.manual-chip:hover {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.manual-chip-user { background: #e3f2fd; color: #1565c0; }
.manual-chip-user:hover { background: #1565c0; color: var(--white); }
.manual-chip-technical { background: #f3e5f5; color: #6a1b9a; }
.manual-chip-technical:hover { background: #6a1b9a; color: var(--white); }
.manual-chip-empty {
  color: var(--grey-500);
  font-style: italic;
  cursor: default;
  background: transparent;
  border: 1px dashed var(--grey-300);
}
.manual-chip-empty:hover { background: transparent; color: var(--grey-500); border-color: var(--grey-300); }

/* ---------- Search results ---------- */
.results {
  display: flex; flex-direction: column; gap: 12px;
}
.result {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: all .12s;
}
.result:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.result-meta {
  display: flex; align-items: center; gap: 8px;
  color: var(--grey-500);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}
.result-meta .dot { color: var(--grey-300); }
.result-title { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.result-snippet { color: var(--grey-700); font-size: 14px; line-height: 1.55; }
.result-snippet mark { background: #fff59d; color: inherit; padding: 1px 3px; border-radius: 2px; font-weight: 500; }

.result-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.result-badge-user { background: #e3f2fd; color: #1565c0; }
.result-badge-technical { background: #f3e5f5; color: #6a1b9a; }

.empty-state {
  text-align: center;
  padding: 80px 40px;
  color: var(--grey-500);
}
.empty-state h3 { color: var(--grey-700); margin: 0 0 8px; }

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .12s;
  background: var(--grey-100);
  color: var(--grey-900);
  font-family: inherit;
}
.btn:hover { background: var(--grey-200); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-dark); }
.btn-danger  { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover  { background: var(--red); color: var(--white); }
.btn-small   { padding: 6px 12px; font-size: 13px; }

.form-row { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-700);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--grey-300);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(46,117,182,.15);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-file { padding: 8px; }
.form-help { font-size: 12px; color: var(--grey-500); margin-top: 4px; }
.form-radio-group { display: flex; gap: 16px; }
.form-radio-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* ---------- Toasts ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: toast-in .2s ease-out;
}
.toast-success { background: var(--green); }
.toast-error   { background: var(--red); }
@keyframes toast-in {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ---------- Viewer ---------- */
.viewer-body {
  display: flex; flex-direction: column;
  height: 100vh;
}
.viewer-header {
  background: var(--navy);
  color: var(--white);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.viewer-back {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 5px;
}
.viewer-back:hover { background: rgba(255,255,255,0.12); color: var(--white); text-decoration: none; }
.viewer-titleblock { flex: 1; }
.viewer-app { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.viewer-title { font-size: 16px; font-weight: 600; }
.viewer-pdf { flex: 1; border: 0; width: 100%; background: var(--grey-100); }

/* ---------- Admin ---------- */
.admin-lock {
  max-width: 400px;
  margin: 80px auto;
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-md);
  text-align: center;
  border: 1px solid var(--grey-200);
}
.admin-lock h2 { margin: 0 0 8px; }
.admin-lock p  { color: var(--grey-500); margin-bottom: 24px; }
.pin-input {
  font-size: 24px;
  text-align: center;
  letter-spacing: 8px;
  padding: 12px;
  width: 180px;
  border: 2px solid var(--grey-300);
  border-radius: 8px;
  font-family: 'Consolas', 'Monaco', monospace;
}
.pin-input:focus { border-color: var(--blue); outline: none; }

.admin-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--grey-200);
  box-shadow: var(--shadow-sm);
}
.admin-section h2 { margin: 0 0 16px; font-size: 18px; }

.manual-table { width: 100%; border-collapse: collapse; }
.manual-table th, .manual-table td {
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--grey-200);
}
.manual-table th {
  color: var(--grey-500);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.manual-table td.actions { text-align: right; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .container { padding: 20px; }
  .header    { padding: 14px 20px; }
  .header-sub { display: none; }
  .grid      { grid-template-columns: 1fr; }
  .search-input { font-size: 16px; padding: 14px 16px 14px 46px; }
}
