/* SarukiGo QR — base styles (replaces Metro CSS for Phase 1) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1e293b;
  background: #fff;
}

body.m4-cloak,
body.srk-cloak {
  visibility: hidden;
}

body.srk-ready,
body.m4-cloak.srk-ready {
  visibility: visible;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Layout */
.container,
.container-fluid {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.container {
  max-width: 1160px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

[class*="cell-"] {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  width: 100%;
}

.cell-sm-6 { width: 50%; }
.cell-md-3 { width: 25%; }
.cell-md-4 { width: 33.333%; }
.cell-md-6 { width: 50%; }
.cell-lg-3 { width: 25%; }
.cell-lg-5 { width: 41.666%; }
.cell-lg-6 { width: 50%; }
.cell-lg-7 { width: 58.333%; }
.cell-md-8 { width: 66.666%; }
.cell-md-4 { width: 33.333%; }
.cell-md-12 { width: 100%; }

@media (max-width: 991px) {
  .cell-md-3,
  .cell-md-4,
  .cell-lg-3,
  .cell-lg-5,
  .cell-lg-6 {
    width: 100%;
  }
  .cell-md-6,
  .cell-sm-6 {
    width: 50%;
  }
}

@media (max-width: 639px) {
  .cell-sm-6,
  .cell-md-6 {
    width: 100%;
  }
}

/* Flex utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-flex-lg { display: none !important; }

.flex-wrap { flex-wrap: wrap; }
.flex-justify-center { justify-content: center; }
.flex-justify-between { justify-content: space-between; }
.flex-align-center { align-items: center; }
.flex-align-start { align-items: flex-start; }
.flex-justify-start-lg { justify-content: center; }

.gap-2 { gap: 0.5rem; }
.h-100 { height: 100%; }
.h-vh-100 { min-height: 100vh; }
.w-100 { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.no-wrap { white-space: nowrap; }
.no-hover:hover { opacity: 1; }
.c-pointer { cursor: pointer; }

.pos-fixed { position: fixed; }
.pos-relative { position: relative; }
.fixed-top { top: 0; left: 0; right: 0; }
.z-top { z-index: 1000; }

@media (min-width: 992px) {
  .d-flex-lg { display: flex !important; }
  .flex-justify-start-lg { justify-content: flex-start; }
  .pl-20-md { padding-left: 5rem; }
  .pr-20-md { padding-right: 5rem; }
  .mt-lg-0 { margin-top: 0 !important; }
  .cell-lg-3,
  .cell-lg-5,
  .cell-lg-6,
  .cell-lg-7 {
    width: auto;
    flex: 0 0 auto;
  }
  .cell-lg-3 { width: 25%; }
  .cell-lg-5 { width: 41.666%; }
  .cell-lg-6 { width: 50%; }
  .cell-lg-7 { width: 58.333%; }
}

/* Spacing */
.p-0 { padding: 0 !important; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-10 { padding: 2.5rem; }
.pt-1 { padding-top: 0.25rem; }
.pl-2 { padding-left: 0.5rem; }
.pr-2 { padding-right: 0.5rem; }
.pr-3 { padding-right: 0.75rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-10 { padding-top: 2.5rem; }
.pt-20 { padding-top: 5rem; }
.pb-10 { padding-bottom: 2.5rem; }
.pb-20 { padding-bottom: 5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-lg-0 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.m-0 { margin: 0; }
.mr-2 { margin-right: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.ml-auto { margin-left: auto; }

/* Typography */
.h1 { font-size: 2rem; font-weight: 700; line-height: 1.2; margin: 0 0 0.5rem; }
.h3 { font-size: 1.35rem; font-weight: 600; margin: 0 0 0.5rem; }
.h4 { font-size: 1.125rem; font-weight: 600; }
.h5 { font-size: 1.125rem; }
.display3 { font-size: 2rem; font-weight: 700; }
.display4 { font-size: 2.25rem; font-weight: 700; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-bold { font-weight: 700; }
.text-medium { font-weight: 500; }
.text-muted { color: #64748b; }
.text-leader { font-size: 1.125rem; line-height: 1.6; }
.text-upper { text-transform: uppercase; }
.text-wrap { white-space: normal; }
.reduce-1 { font-size: 0.875rem; }
.reduce-2 { font-size: 0.75rem; }
.small { font-size: 0.8125rem; }

/* Brand colours */
.fg-white { color: #fff !important; }
.fg-brand { color: #3418c2 !important; }
.fg-green { color: #16a34a !important; }
.fg-yellow { color: #eab308 !important; }
.fg-red { color: #dc2626 !important; }
.fg-gray { color: #94a3b8 !important; }
.bg-white { background-color: #fff !important; }
.bg-brand { background-color: #3418c2 !important; }
.bg-brand-secondary { background-color: #eef9f4 !important; }
.bg-orange { background-color: #f97316 !important; }
.bg-steel { background-color: #475569 !important; }
.bg-green { background-color: #16a34a !important; }

/* Surfaces */
.win-shadow { box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08); }
.border-radius-10 { border-radius: 10px; }
.border-radius-20 { border-radius: 20px; }
.border-3 { border-width: 3px; border-style: solid; }
.shadow-1 { box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12); }
.shadow-2 { box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14); }
.border { border: 1px solid #e2e8f0; }
.border-top { border-top: 1px solid #e2e8f0; }
.bd-default { border-color: #e2e8f0 !important; }
.bd-brand { border-color: #3418c2 !important; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #1e293b;
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.button:hover {
  background: #f1f5f9;
}

.button.primary {
  background: #3418c2;
  border-color: #3418c2;
  color: #fff;
}

.button.primary:hover {
  background: #2a12a0;
  border-color: #2a12a0;
}

.button.info {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: #fff;
}

.button.info:hover {
  background: #0284c7;
}

.button.secondary {
  background: #64748b;
  border-color: #64748b;
  color: #fff;
}

.button.secondary:hover {
  background: #475569;
}

.button.success {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.button.alert {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.button.outline {
  background: transparent;
  border-color: currentColor;
}

.button.large {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
}

.button.small {
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label,
.srk-field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
}

.input-control {
  margin-bottom: 0.85rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
select,
textarea,
.metro-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #3418c2;
  box-shadow: 0 0 0 3px rgba(52, 24, 194, 0.15);
}

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

.full-size {
  width: 100%;
}

.invalid_feedback {
  display: none;
  color: #dc2626;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.table thead th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
}

.table.striped tbody tr:nth-child(even) {
  background: #fafbfc;
}

/* Dialogs */
.srk-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.srk-dialog-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

body.srk-modal-active {
  overflow: hidden;
}

.dialog {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(96vw, var(--srk-dialog-width, 520px));
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  z-index: 3001;
  flex-direction: column;
  overflow: hidden;
}

.dialog.is-open {
  display: flex;
}

.dialog-title {
  padding: 1rem 1.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
}

.dialog-content {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e2e8f0;
}

/* Toasts & notifications */
.srk-toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(420px, calc(100vw - 2rem));
}

.srk-toast-container .srk-toast--top,
.srk-toast.srk-toast--top {
  /* top variant uses same container; positioned via order */
}

.srk-toast {
  padding: 0.85rem 1rem;
  background: #1e293b;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.srk-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.srk-toast--alert {
  background: #dc2626;
}

.srk-notify-container {
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
}

.srk-notify {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #3418c2;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
  padding: 0.75rem 1rem;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.2s, transform 0.2s;
}

.srk-notify.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.srk-notify--alert {
  border-left-color: #dc2626;
}

.srk-notify__title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.2rem;
}

.srk-notify__body {
  font-size: 0.875rem;
  color: #475569;
}

/* Lists */
.inline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.inline-list a {
  text-decoration: none;
}

/* Login page */
.login-box {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 1rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.login-box form {
  border-radius: 0 0 12px 12px;
}

/* Spinner */
.ani-spin {
  animation: srk-spin 1s linear infinite;
}

@keyframes srk-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Icon box (landing features) */
.icon-box {
  display: flex;
  align-items: center;
}

.icon-box .icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-box .content {
  flex: 1;
}

/* Code */
code {
  font-size: 0.85em;
  background: rgba(52, 24, 194, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}