/* Direct Bridge - Modern Design System */

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

:root {
  --primary: #0d2137;
  --primary-light: #1a3a5c;
  --accent: #CC1B1B;
  --accent-hover: #a81515;
  --accent-light: #fde8e8;
  --bg: #f0f4f8;
  --card: #ffffff;
  --text: #1a2332;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(13,33,55,0.10);
  --shadow-lg: 0 8px 32px rgba(13,33,55,0.14);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ───────────────────────────────────── */

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ───────────────────────────────────── */

.site-header {
  background: var(--primary);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.site-header .container,
.site-header .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo-link {
  background: #ffffff;
  padding: 5px 12px;
  border-radius: 6px;
}

.logo-link img {
  display: block;
  height: 34px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  color: rgba(255,255,255,0.80);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

.site-nav a:hover {
  color: #ffffff;
  text-decoration: none;
}

/* ── Main Content ─────────────────────────────── */

.main-content {
  flex: 1;
  padding: 40px 0 60px;
}

/* ── Footer ───────────────────────────────────── */

.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.65);
  padding: 18px 0;
  font-size: 13px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.site-footer strong {
  color: rgba(255,255,255,0.9);
}

/* ── Cards ────────────────────────────────────── */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 24px;
}

.card-sm {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.card-md {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Typography ───────────────────────────────── */

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.section-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.section-heading:first-child {
  margin-top: 0;
}

/* ── Form Elements ────────────────────────────── */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.form-label .req {
  color: var(--error);
  margin-left: 2px;
}

input[type=text],
input[type=password],
input[type=email],
input[type=tel],
input[type=number],
input[type=numeric],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  height: auto;
  margin: 0;
  box-sizing: border-box;
}

input[type=text]:focus,
input[type=password]:focus,
input[type=email]:focus,
input[type=tel]:focus,
input[type=number]:focus,
input[type=numeric]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(204,27,27,0.14);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-row input {
  flex: 1;
}

.input-suffix {
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

/* ── Buttons ──────────────────────────────────── */

input[type=submit] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background 0.2s, transform 0.1s;
  height: auto;
  width: auto;
  letter-spacing: 0.01em;
}

input[type=submit]:hover {
  background: var(--accent-hover);
}

input[type=submit]:active {
  transform: translateY(1px);
}

input[type=reset] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: #f1f5f9;
  color: var(--text);
  transition: background 0.2s;
  height: auto;
  width: auto;
}

input[type=reset]:hover {
  background: #e2e8f0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }

.btn-secondary { background: #f1f5f9; color: var(--text); }
.btn-secondary:hover { background: #e2e8f0; text-decoration: none; }

.btn-dark { background: var(--primary); color: #fff; }
.btn-dark:hover { background: var(--primary-light); text-decoration: none; }

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ── Links ────────────────────────────────────── */

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Alerts ───────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #fecaca;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.alert-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* ── Data Tables ──────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.data-table a {
  font-size: 13px;
  margin-right: 6px;
}

.data-table a.delete {
  color: var(--error);
}

/* ── Info Grid (portal dashboard) ────────────── */

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.info-section {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  border: 1px solid var(--border);
}

.info-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.info-row {
  margin-bottom: 10px;
}

.info-row:last-child { margin-bottom: 0; }

.info-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
}

.info-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}

/* ── Status Badge ─────────────────────────────── */

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-processing { background: #fff3cd; color: #92400e; }
.status-approved   { background: var(--success-bg); color: var(--success); }
.status-pending    { background: #eff6ff; color: #1d4ed8; }

/* ── Pagination ───────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}

.pagination a {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 13px;
  transition: all 0.2s;
}

.pagination a:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.pagination-info {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
}

/* ── Login / Centered pages ───────────────────── */

.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 140px);
  padding: 40px 24px;
}

.login-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.login-logo {
  display: block;
  margin: 0 auto 28px;
  max-height: 44px;
  width: auto;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  margin-bottom: 28px;
}

.forgot-link {
  font-size: 13px;
  color: var(--text-muted);
}

.forgot-link:hover { color: var(--accent); }

/* ── Portal Header ────────────────────────────── */

.portal-header {
  background: var(--primary);
  color: #fff;
  padding: 14px 0;
  margin-bottom: 32px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.portal-header .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.portal-ref {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
}

.portal-ref strong {
  color: #fff;
  font-size: 14px;
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-actions a {
  font-size: 13px;
  color: rgba(255,255,255,0.80);
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-xs);
  transition: all 0.2s;
  text-decoration: none;
}

.portal-actions a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

/* ── Admin Sections ───────────────────────────── */

.admin-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  overflow: hidden;
}

.admin-section-header {
  padding: 14px 24px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid transparent;
}

.admin-section-header.create {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #c8e6c9;
}

.admin-section-header.view {
  background: #e3f2fd;
  color: #1565c0;
  border-color: #bbdefb;
}

.admin-section-header.admin-dark {
  background: var(--primary);
  color: #fff;
  border-color: rgba(255,255,255,0.1);
}

.admin-section-header.warning {
  background: #fff8e1;
  color: #e65100;
  border-color: #ffe082;
}

.admin-section-header.processing {
  background: #fce4ec;
  color: #880e4f;
  border-color: #f48fb1;
}

.admin-section-body {
  padding: 24px;
}

/* Admin forms - compact side-by-side layout */
.admin-form .form-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.admin-form .form-row label {
  min-width: 180px;
  text-align: right;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}

.admin-form .form-row input[type=text],
.admin-form .form-row input[type=password],
.admin-form .form-row select {
  width: auto;
  min-width: 260px;
}

.admin-form .form-actions {
  display: flex;
  margin-left: 196px;
  margin-top: 16px;
}

/* ── Confirmation / Info pages ────────────────── */

.confirm-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 140px);
  padding: 40px 24px;
}

.confirm-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 520px;
  text-align: center;
}

.confirm-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
}

.confirm-icon.success { background: var(--success-bg); color: var(--success); }
.confirm-icon.info    { background: #eff6ff; color: #1d4ed8; }

.confirm-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.confirm-message {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 28px;
}

/* ── Contact Info ─────────────────────────────── */

.contact-info {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.8;
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 640px) {
  .card { padding: 20px 18px; }
  .login-card { padding: 28px 20px; }
  .confirm-card { padding: 32px 20px; }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .admin-form .form-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .admin-form .form-row label {
    min-width: auto;
    text-align: left;
  }

  .admin-form .form-row input[type=text],
  .admin-form .form-row input[type=password],
  .admin-form .form-row select {
    width: 100%;
    min-width: auto;
  }

  .admin-form .form-actions {
    margin-left: 0;
  }

  .portal-header .container-wide {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
