:root {
  --navy: #10233f;
  --navy-2: #1b3658;
  --navy-3: #27486f;
  --green: #168b63;
  --green-dark: #0d6b4a;
  --green-soft: #e9f7f1;
  --red: #c83e4f;
  --red-soft: #fff0f2;
  --amber: #b97a18;
  --amber-soft: #fff7e7;
  --ink: #17263a;
  --muted: #687588;
  --line: #dee5ec;
  --soft: #f2f5f8;
  --page: #f6f8fb;
  --white: #fff;
  --sidebar: 275px;
  --shadow: 0 18px 46px rgba(16, 35, 63, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--page); font-family: Tahoma, Arial, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.brand-lockup, .sidebar-brand { display: inline-flex; align-items: center; gap: 13px; }
.brand-symbol {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--navy);
  font: 900 22px/1 Arial, sans-serif;
  box-shadow: 0 11px 24px rgba(16, 35, 63, .2);
}
.brand-lockup > span:last-child, .sidebar-brand > span:last-child { display: grid; gap: 3px; }
.brand-lockup b, .sidebar-brand b { color: var(--navy); font-size: 16px; }
.brand-lockup small, .sidebar-brand small { color: var(--muted); font-size: 10px; letter-spacing: .05em; }
.overline { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .03em; }

.button {
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 900;
  transition: transform .15s ease, background .15s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--green); box-shadow: 0 11px 22px rgba(22, 139, 99, .2); }
.button-primary:hover:not(:disabled) { background: var(--green-dark); }
.button-dark { color: #fff; background: var(--navy); }
.button-dark:hover:not(:disabled) { background: var(--navy-2); }
.button-danger { color: #fff; background: var(--red); box-shadow: 0 11px 22px rgba(200, 62, 79, .18); }
.button-danger:hover:not(:disabled) { background: #a72f3e; }
.button-wide { width: 100%; }
.text-button { padding: 8px 10px; border: 0; border-radius: 9px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; font-weight: 900; }

.alert { margin-bottom: 16px; padding: 13px 15px; border-radius: 12px; font-size: 11px; line-height: 1.7; }
.alert-error { color: #982c3a; background: var(--red-soft); border: 1px solid #f2cbd1; }
.alert-success { color: var(--green-dark); background: var(--green-soft); border: 1px solid #ccebdd; }

/* Login */
.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, rgba(22, 139, 99, .14), transparent 27rem),
    linear-gradient(140deg, #eef3f6 0%, #f9fafc 60%, #f1f5f4 100%);
}
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(380px, .92fr); }
.login-story { position: relative; padding: clamp(45px, 7vw, 90px); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; }
.login-story::before {
  content: "";
  position: absolute;
  width: 470px;
  height: 470px;
  left: -180px;
  bottom: -210px;
  border: 75px solid rgba(16, 35, 63, .045);
  border-radius: 50%;
}
.story-copy { position: relative; max-width: 650px; margin: auto 0; }
.story-copy h1 { max-width: 600px; margin: 18px 0; color: var(--navy); font-size: clamp(48px, 6vw, 82px); line-height: 1.08; letter-spacing: -.05em; }
.story-copy p { max-width: 620px; margin: 0; color: var(--muted); font-size: 16px; line-height: 2; }
.privacy-line { position: relative; display: flex; align-items: center; gap: 10px; color: #526175; font-size: 11px; }
.privacy-line i, .online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(22, 139, 99, .1); }
.login-card {
  align-self: center;
  width: min(470px, calc(100% - 56px));
  margin-inline: auto;
  padding: 42px;
  border: 1px solid rgba(16, 35, 63, .11);
  border-radius: 28px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 30px 75px rgba(16, 35, 63, .13);
}
.login-heading { display: flex; align-items: center; gap: 13px; }
.mini-logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--green); font: 900 19px/1 Arial; }
.login-heading > div { display: grid; gap: 3px; }
.login-heading small { color: var(--green); font-size: 10px; font-weight: 900; }
.login-heading h2 { margin: 0; color: var(--navy); font-size: 25px; }
.login-help { margin: 20px 0 24px; color: var(--muted); font-size: 11px; line-height: 1.9; }
.login-form { display: grid; gap: 16px; }
.login-form label, .settings-form label { display: grid; gap: 8px; color: #435269; font-size: 11px; font-weight: 800; }
.login-form input, .settings-form input, .settings-form select, .settings-form textarea {
  width: 100%;
  height: 49px;
  padding: 0 14px;
  border: 1px solid #d8e0e7;
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fbfcfd;
}
.settings-form select { padding: 0 14px; }
.settings-form textarea { min-height: 85px; padding: 12px 14px; resize: vertical; }
.login-form input:focus, .settings-form input:focus, .settings-form select:focus, .settings-form textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 139, 99, .1); background: #fff; outline: none; }
.login-foot { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 9px; }

/* Dashboard shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar);
  padding: 24px 18px;
  border-left: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  flex-direction: column;
  color: #fff;
  background: var(--navy);
}
.sidebar .brand-symbol { background: #fff; color: var(--navy); box-shadow: none; }
.sidebar-brand { padding: 0 8px 24px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.sidebar-brand b { color: #fff; }
.sidebar-brand small { color: rgba(255, 255, 255, .55); }
.side-nav { margin-top: 24px; display: grid; gap: 5px; }
.nav-item {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, .68);
  background: transparent;
  text-align: right;
  font-size: 11px;
  font-weight: 800;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav-item.active { color: #fff; background: var(--green); box-shadow: 0 11px 22px rgba(0, 0, 0, .13); }
.nav-icon { width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center; color: inherit; background: rgba(255, 255, 255, .09); font: 900 14px/1 Arial; }
.nav-item.active .nav-icon { background: rgba(255, 255, 255, .16); }
.sidebar-note { margin-top: auto; padding: 15px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 13px; display: flex; align-items: flex-start; gap: 11px; background: rgba(255, 255, 255, .045); }
.sidebar-note > div { display: grid; gap: 5px; }
.sidebar-note b { font-size: 10px; }
.sidebar-note small { color: rgba(255, 255, 255, .5); font-size: 8px; line-height: 1.5; }
.sidebar .online-dot { flex: 0 0 auto; margin-top: 3px; }
.logout-form { margin-top: 11px; }
.logout-form button { width: 100%; min-height: 44px; padding: 0 13px; border: 0; border-radius: 11px; display: flex; align-items: center; gap: 11px; color: #ffb9c1; background: rgba(200, 62, 79, .09); font-size: 10px; font-weight: 900; }
.logout-form button:hover { background: rgba(200, 62, 79, .18); }
.sidebar-overlay { display: none; }
.main-area { min-height: 100vh; margin-right: var(--sidebar); }
.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 78px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(10px);
}
.menu-button { display: none; width: 40px; height: 40px; border: 0; border-radius: 11px; color: var(--navy); background: var(--soft); font-size: 18px; }
.header-title { display: grid; gap: 3px; }
.header-title small { color: var(--muted); font-size: 9px; }
.header-title h1 { margin: 0; color: var(--navy); font-size: 19px; }
.admin-chip { margin-right: auto; padding: 7px 9px 7px 13px; border: 1px solid var(--line); border-radius: 13px; display: flex; align-items: center; gap: 10px; background: #fff; }
.admin-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--navy); font: 900 13px/1 Arial; }
.admin-chip > div { display: grid; gap: 2px; }
.admin-chip b { color: var(--navy); font-size: 10px; }
.admin-chip small { color: var(--muted); font-size: 8px; }
.content-area { width: min(1260px, calc(100% - 56px)); margin-inline: auto; padding: 34px 0 60px; }

/* Overview */
.welcome-panel {
  min-height: 270px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  box-shadow: var(--shadow);
}
.welcome-panel > div:first-child { position: relative; z-index: 2; max-width: 690px; }
.welcome-panel .overline { color: #7de0b9; }
.welcome-panel h2 { margin: 13px 0 12px; font-size: clamp(30px, 5vw, 51px); line-height: 1.16; letter-spacing: -.035em; }
.welcome-panel p { max-width: 650px; margin: 0 0 24px; color: rgba(255, 255, 255, .68); font-size: 12px; line-height: 1.9; }
.welcome-visual { position: relative; flex: 0 0 290px; height: 180px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 24px; display: grid; align-content: center; gap: 12px; padding: 28px; direction: ltr; background: rgba(255, 255, 255, .07); transform: rotate(-3deg); }
.welcome-visual::before { content: "JAWAL DEALER CARD"; color: rgba(255, 255, 255, .37); font: 800 9px/1 Arial; letter-spacing: .12em; }
.welcome-visual span { color: rgba(255, 255, 255, .55); font: 700 12px/1 Arial; }
.welcome-visual b { font: 900 28px/1 Arial; letter-spacing: .1em; }
.welcome-visual i { position: absolute; left: 20px; bottom: 18px; width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--green); font-style: normal; }
.summary-cards { margin: 16px 0 32px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.summary-cards article { padding: 18px; border: 1px solid var(--line); border-radius: 17px; display: flex; align-items: center; gap: 13px; background: #fff; }
.summary-icon { width: 43px; height: 43px; border-radius: 12px; display: grid; place-items: center; font: 900 16px/1 Arial; }
.summary-icon.green { color: var(--green-dark); background: var(--green-soft); }
.summary-icon.navy { color: var(--navy); background: #edf1f6; }
.summary-icon.amber { color: var(--amber); background: var(--amber-soft); }
.summary-cards article > div { display: grid; gap: 5px; }
.summary-cards small { color: var(--muted); font-size: 9px; }
.summary-cards b { color: var(--navy); font-size: 12px; }
.section-heading { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.section-heading > div { display: grid; gap: 5px; }
.section-heading h2 { margin: 0; color: var(--navy); font-size: 21px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.section-heading.compact { align-items: center; }
.module-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.module-card { position: relative; min-height: 205px; padding: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: var(--ink); background: #fff; text-align: right; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.module-card:hover { transform: translateY(-3px); border-color: #bfd5ca; box-shadow: 0 17px 35px rgba(16, 35, 63, .08); }
.module-card.featured { color: #fff; border-color: var(--green); background: var(--green); }
.module-number { position: absolute; left: 16px; top: 15px; color: #aeb8c4; font: 900 10px/1 Arial; }
.module-card.featured .module-number { color: rgba(255,255,255,.55); }
.module-symbol { width: 48px; height: 48px; margin-bottom: 10px; border-radius: 14px; display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); font: 900 18px/1 Arial; }
.module-card.featured .module-symbol { color: #fff; background: rgba(255,255,255,.16); }
.module-card strong { color: var(--navy); font-size: 14px; }
.module-card.featured strong { color: #fff; }
.module-card small { color: var(--muted); font-size: 9px; line-height: 1.7; }
.module-card.featured small { color: rgba(255,255,255,.72); }
.module-card i { margin-top: auto; color: var(--green-dark); font-size: 9px; font-style: normal; font-weight: 900; }
.module-card.featured i { color: #fff; }
.activity-card { margin-top: 28px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.activity-list { display: grid; gap: 9px; }
.activity-item { padding: 12px 14px; border-radius: 12px; display: flex; align-items: center; gap: 11px; background: var(--soft); }
.activity-item i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.activity-item span { color: #425168; font-size: 10px; }
.activity-item time { margin-right: auto; color: var(--muted); font-size: 8px; }
.empty-state { margin: 0; padding: 20px; color: var(--muted); background: var(--soft); border-radius: 12px; text-align: center; font-size: 10px; }

/* Tools */
.two-column-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.tool-card, .single-tool-card, .source-card, .result-panel, .settings-card { border: 1px solid var(--line); border-radius: 21px; background: #fff; box-shadow: var(--shadow); }
.tool-card { padding: 24px; }
.tool-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 19px; }
.tool-icon { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: #fff; font: 900 9px/1 Arial; }
.tool-icon.pdf, .large-tool-symbol.pdf { background: var(--navy); }
.tool-icon.excel, .large-tool-symbol.excel { background: var(--green); }
.tool-card-head > div { display: grid; gap: 5px; }
.tool-card h3, .single-tool-card h3, .source-card h3, .settings-card h3 { margin: 0; color: var(--navy); font-size: 15px; }
.tool-card p, .single-tool-card p, .source-card p, .settings-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.7; }
.upload-zone {
  min-height: 118px;
  margin-bottom: 14px;
  padding: 18px;
  border: 2px dashed #ccd6df;
  border-radius: 15px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--navy);
  background: #fafbfd;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.upload-zone:hover { border-color: var(--green); background: var(--green-soft); }
.upload-zone b { font-size: 11px; }
.upload-zone small { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.operation-status { margin-top: 13px; padding: 11px 13px; border-radius: 11px; color: var(--muted); background: var(--soft); font-size: 9px; line-height: 1.7; }
.operation-status.center { text-align: center; }
.operation-status.working { color: var(--amber); background: var(--amber-soft); }
.operation-status.success { color: var(--green-dark); background: var(--green-soft); font-weight: 900; }
.operation-status.error { color: var(--red); background: var(--red-soft); font-weight: 900; }
.result-links { margin-top: 10px; display: grid; gap: 7px; }
.result-link { width: 100%; min-height: 38px; padding: 0 12px; border: 1px solid #cde8dc; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; color: var(--green-dark); background: var(--green-soft); font-size: 9px; font-weight: 900; }
.single-tool-card { max-width: 800px; margin: 0 auto; padding: 38px; text-align: center; }
.large-tool-symbol { width: 72px; height: 72px; margin: 0 auto 17px; border-radius: 20px; display: grid; place-items: center; color: #fff; font: 900 26px/1 Arial; }
.single-tool-card h3 { font-size: 19px; }
.single-tool-card > p { max-width: 580px; margin: 9px auto 21px; }
.large-upload { min-height: 170px; margin-bottom: 18px; padding: 22px; border: 2px dashed #c9d4de; border-radius: 18px; display: grid; place-items: center; align-content: center; gap: 9px; background: #fafbfd; cursor: pointer; }
.large-upload:hover { border-color: var(--green); background: var(--green-soft); }
.large-upload b { color: var(--navy); font-size: 13px; }
.large-upload small { color: var(--muted); font-size: 9px; }
.match-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.source-card { position: relative; padding: 24px; overflow: hidden; box-shadow: none; }
.source-step { position: absolute; left: 18px; top: 17px; color: #bdc5ce; font: 900 11px/1 Arial; }
.source-card h3 { margin-bottom: 7px; }
.source-card p { min-height: 34px; margin-bottom: 15px; }
.source-card .upload-zone { margin-bottom: 0; }
.match-action-bar { margin-top: 15px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; }
.match-action-bar > div { display: grid; gap: 5px; }
.match-action-bar b { color: var(--navy); font-size: 11px; }
.match-action-bar small { color: var(--muted); font-size: 9px; }
.result-summary { margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.result-summary article { padding: 15px; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 7px; background: #fff; }
.result-summary small { color: var(--muted); font-size: 8px; }
.result-summary b { color: var(--navy); font: 900 21px/1 Arial; }
.result-summary article.success { background: var(--green-soft); border-color: #cbe9db; }
.result-summary article.success b { color: var(--green-dark); }
.result-summary article.danger { background: var(--red-soft); border-color: #f1ccd2; }
.result-summary article.danger b { color: var(--red); }
.result-panel { margin-top: 17px; padding: 21px; box-shadow: none; }
.table-wrap { max-height: 480px; overflow: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; direction: ltr; white-space: nowrap; }
th, td { padding: 11px 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; }
th { position: sticky; top: 0; z-index: 2; color: var(--navy); background: #edf1f5; }
tr:last-child td { border-bottom: 0; }
th:last-child, td:last-child { border-right: 0; }
.found { color: var(--green-dark); font-weight: 900; }
.missing { color: var(--red); font-weight: 900; }

/* Settings */
.settings-form { max-width: 900px; display: grid; gap: 16px; }
.settings-card { padding: 23px; box-shadow: none; }
.settings-card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 19px; }
.settings-card-head > span { width: 39px; height: 39px; border-radius: 11px; display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); font: 900 10px/1 Arial; }
.settings-card-head > div { display: grid; gap: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label.full { grid-column: 1 / -1; }
.check-label { min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; display: flex !important; align-items: center; grid-template-columns: auto 1fr; background: #fbfcfd; }
.check-label input { width: 18px !important; height: 18px !important; accent-color: var(--green); }
.danger-check { color: var(--red) !important; }
.security-note { margin-top: 15px; padding: 13px 15px; border-radius: 12px; color: #6d541f; background: var(--amber-soft); font-size: 9px; line-height: 1.8; }
.action-buttons { display: flex; gap: 9px; flex-wrap: wrap; }
.cleanup-card { border-color: #ecdadd; }
.cleanup-card .settings-card-head > span { color: var(--red); background: var(--red-soft); }
.cleanup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.cleanup-grid article { min-height: 150px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; display: flex; flex-direction: column; justify-content: space-between; gap: 17px; background: #fbfcfd; }
.cleanup-grid article.danger { border-color: #f1ccd2; background: var(--red-soft); }
.cleanup-grid article > div { display: grid; gap: 7px; }
.cleanup-grid b { color: var(--navy); font-size: 11px; }
.cleanup-grid article.danger b { color: var(--red); }
.cleanup-grid p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.8; }

/* Install and Jawwal sync */
.install-shell { width: min(970px, calc(100% - 28px)); margin: 0 auto; padding: 45px 0 70px; }
.install-card { padding: clamp(22px, 4vw, 42px); border: 1px solid var(--line); border-radius: 27px; background: rgba(255,255,255,.95); box-shadow: var(--shadow); }
.install-card .login-heading h1 { margin: 0; color: var(--navy); font-size: 26px; }
.install-card .settings-form { max-width: none; }
.sync-hero { padding: 25px; border-radius: 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #fff; background: linear-gradient(135deg, var(--navy), var(--navy-2)); box-shadow: var(--shadow); }
.sync-state { display: flex; align-items: flex-start; gap: 15px; }
.status-dot { flex: 0 0 auto; width: 13px; height: 13px; margin-top: 6px; border-radius: 50%; background: #eaa23b; box-shadow: 0 0 0 7px rgba(234,162,59,.14); }
.status-dot.connected { background: #4ed09d; box-shadow: 0 0 0 7px rgba(78,208,157,.15); }
.sync-state > div { display: grid; gap: 5px; }
.sync-state small { color: rgba(255,255,255,.55); font-size: 9px; }
.sync-state h3 { margin: 0; font-size: 20px; }
.sync-state p { margin: 0; color: rgba(255,255,255,.64); font-size: 9px; line-height: 1.7; }
.sync-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sync-actions .button-dark { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); }
.sync-stat-grid { margin-top: 15px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sync-stat-grid article { padding: 17px; border: 1px solid var(--line); border-radius: 15px; display: grid; gap: 8px; background: #fff; }
.sync-stat-grid small { color: var(--muted); font-size: 8px; }
.sync-stat-grid b { color: var(--navy); font-size: 15px; }
.sync-progress { height: 8px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #dfe6ec; }
.sync-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .25s ease; }
.diagnostic-card { margin-top: 16px; padding: 20px 23px; border: 1px solid #ead9b8; border-radius: 17px; background: var(--amber-soft); }
.diagnostic-card h3 { margin: 0 0 10px; color: #6b4d17; font-size: 13px; }
.diagnostic-card ol { margin: 0; padding-right: 18px; color: #765f35; font-size: 9px; line-height: 2; }
.bridge-card { margin-bottom: 16px; padding: 25px; border: 1px solid #bee6d5; border-radius: 21px; display: grid; grid-template-columns: 1fr auto; gap: 20px; background: linear-gradient(145deg, #fff, var(--green-soft)); box-shadow: var(--shadow); }
.bridge-copy { display: grid; align-content: start; gap: 8px; }
.bridge-badge { width: fit-content; padding: 6px 10px; border-radius: 999px; color: var(--green-dark); background: #d8f2e7; font-size: 8px; font-weight: 900; }
.bridge-copy h3 { margin: 0; color: var(--navy); font-size: 19px; }
.bridge-copy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.bridge-copy ol { margin: 6px 0 0; padding-right: 18px; color: #435269; font-size: 9px; line-height: 2; }
.bridge-actions { min-width: 230px; display: grid; align-content: center; gap: 9px; }
.bridge-actions a { text-decoration: none; }
.bridge-token { grid-column: 1 / -1; padding: 15px; border: 1px solid #c9ded5; border-radius: 14px; display: grid; gap: 7px; background: #fff; }
.bridge-token span { color: var(--muted); font-size: 8px; font-weight: 800; }
.bridge-token code { padding: 10px 12px; overflow-wrap: anywhere; border-radius: 9px; direction: ltr; color: var(--navy); background: var(--soft); font: 700 10px/1.6 Consolas, monospace; user-select: all; }
.bridge-card > .operation-status { grid-column: 1 / -1; margin-top: 0; }

@media (max-width: 1100px) {
  .module-grid { grid-template-columns: repeat(3, 1fr); }
  .welcome-visual { flex-basis: 230px; }
}
@media (max-width: 860px) {
  :root { --sidebar: 270px; }
  .sidebar { transform: translateX(100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; z-index: 25; inset: 0; display: block; visibility: hidden; opacity: 0; background: rgba(10, 23, 41, .42); transition: opacity .2s ease, visibility .2s ease; }
  .sidebar-overlay.open { visibility: visible; opacity: 1; }
  .main-area { margin-right: 0; }
  .menu-button { display: grid; place-items: center; }
  .content-area { width: min(100% - 34px, 1260px); }
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: 360px; padding: 42px 30px; }
  .story-copy { margin: 55px 0; }
  .story-copy h1 { font-size: 52px; }
  .login-card { margin: 30px auto 60px; }
}
@media (max-width: 680px) {
  .app-header { min-height: 70px; padding: 0 16px; }
  .admin-chip > div { display: none; }
  .admin-chip { padding: 6px; }
  .content-area { width: min(100% - 22px, 1260px); padding-top: 22px; }
  .welcome-panel { min-height: 0; padding: 27px 22px; }
  .welcome-visual { display: none; }
  .welcome-panel h2 { font-size: 34px; }
  .summary-cards, .module-grid, .two-column-tools, .match-layout, .result-summary, .form-grid, .cleanup-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 180px; }
  .single-tool-card { padding: 24px 17px; }
  .match-action-bar { align-items: stretch; flex-direction: column; }
  .match-action-bar .button { width: 100%; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading.compact { align-items: stretch; }
  .sync-hero { align-items: stretch; flex-direction: column; }
  .bridge-card { grid-template-columns: 1fr; }
  .bridge-actions { min-width: 0; }
  .bridge-token, .bridge-card > .operation-status { grid-column: auto; }
  .sync-stat-grid { grid-template-columns: 1fr 1fr; }
  .form-grid label.full { grid-column: auto; }
  .login-story { min-height: 330px; }
  .story-copy h1 { font-size: 42px; }
  .story-copy p { font-size: 13px; }
  .login-card { width: min(100% - 24px, 470px); padding: 27px 21px; border-radius: 21px; }
  .sync-stat-grid { grid-template-columns: 1fr; }
  .sync-actions, .action-buttons { flex-direction: column; }
  .sync-actions .button, .action-buttons .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
