/* =========================================================================
   UMT SMS Center — design system
   Напрямок: "приладова панель" оператора зв'язку.
   Кобальт з логотипа UMT — єдиний акцент; помаранчева крапка логотипа
   (--signal) використовується тільки для "живого" стану.
   Числові дані (MSISDN / ICCID / IMEI / дати) — моноширинним з
   табличними цифрами, щоб колонки вирівнювались по розряду.
   ========================================================================= */

:root {
  /* --- palette ---------------------------------------------------------- */
  --ink: #0e1726;
  --ink-2: #3d4b62;
  --ink-3: #6c7b93;
  --ink-4: #93a1b5;

  --paper: #ffffff;
  --surface-1: #f7f9fc;
  --surface-2: #eef2f8;
  --surface-3: #e4eaf3;

  --line: rgba(14, 23, 38, 0.1);
  --line-soft: rgba(14, 23, 38, 0.06);
  --line-strong: rgba(14, 23, 38, 0.18);

  --brand: #1c6fd0;
  --brand-deep: #14549f;
  --brand-bright: #2f83e4;
  --brand-tint: #e9f1fd;
  --brand-tint-2: #d6e6fa;

  --signal: #f2542d;
  --ok: #0e7c56;
  --ok-tint: #e6f6ef;
  --ok-halo: rgba(14, 124, 86, 0.16);
  --ok-halo-wide: rgba(14, 124, 86, 0.05);
  --bad: #c33527;
  --bad-tint: #fdefed;
  --bad-halo: rgba(195, 53, 39, 0.14);
  --bad-border: rgba(195, 53, 39, 0.4);
  --warn: #a96b00;
  --warn-tint: #fdf5e4;

  /* --- поверхні, що змінюються між темами ------------------------------- */
  --body-glow: rgba(28, 111, 208, 0.09);
  --body-top: #ffffff;
  --body-mid: var(--surface-1);
  --body-bottom: var(--surface-2);

  --header-bg: rgba(255, 255, 255, 0.82);
  --header-highlight: rgba(255, 255, 255, 0.7);
  --nav-track: rgba(14, 23, 38, 0.05);
  --nav-hover: rgba(255, 255, 255, 0.7);
  --footer-bg: rgba(255, 255, 255, 0.6);

  /* Обличчя дрібних контролів (другорядні кнопки, «×», «?»). */
  --face-top: #ffffff;
  --face-bottom: #f7f9fc;
  /* Вкладені панелі всередині картки. */
  --panel-top: var(--surface-1);
  --panel-bottom: #f1f5fa;
  /* Шапки й плитки — світло згори. */
  --card-top: #ffffff;
  --card-bottom: var(--surface-1);

  --input-hover-border: rgba(14, 23, 38, 0.28);
  --zebra: rgba(14, 23, 38, 0.016);
  --grid-line: rgba(14, 23, 38, 0.05);
  --scroll-thumb: rgba(14, 23, 38, 0.22);
  --scroll-thumb-hover: rgba(14, 23, 38, 0.36);

  /* Синя кнопка лишається однаковою в обох темах: на темному тлі вона
     читається не гірше, а білий текст зберігає контраст. */
  --btn-top: #2f83e4;
  --btn-bottom: #1c6fd0;
  --btn-border: #14549f;
  --btn-highlight: rgba(255, 255, 255, 0.24);

  /* --- legacy aliases (не видаляти: використовуються в старих правилах) -- */
  --page-bg: var(--surface-1);
  --panel-bg: var(--paper);
  --panel-muted: var(--surface-1);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --text: var(--ink);
  --text-muted: var(--ink-3);
  --primary: var(--brand);
  --primary-hover: var(--brand-deep);
  --primary-soft: var(--brand-tint);
  --danger: var(--bad);
  --success-soft: var(--ok-tint);
  --warning-soft: var(--warn-tint);

  /* --- type ------------------------------------------------------------- */
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono",
    "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  /* --- elevation -------------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(14, 23, 38, 0.05);
  --shadow: 0 1px 2px rgba(14, 23, 38, 0.05), 0 1px 3px rgba(14, 23, 38, 0.04);
  --shadow-md: 0 1px 2px rgba(14, 23, 38, 0.04),
    0 10px 24px -14px rgba(14, 23, 38, 0.3);
  --shadow-lg: 0 2px 6px rgba(14, 23, 38, 0.06),
    0 28px 64px -24px rgba(14, 23, 38, 0.42);
  --ring: 0 0 0 3px rgba(28, 111, 208, 0.18);

  /* --- geometry --------------------------------------------------------- */
  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --header-height: 64px;
  --control-height: 38px;

  color-scheme: light;
}

/* =========================================================================
   Темна тема
   Атрибут data-theme проставляє інлайн-скрипт у <head> кожної сторінки:
   збережений вибір користувача, інакше — системна тема. Через це тут
   достатньо одного блоку замість пари @media + [data-theme].
   ========================================================================= */

:root[data-theme="dark"] {
  --ink: #e8edf5;
  --ink-2: #b4c0d1;
  --ink-3: #8593a9;
  --ink-4: #66748a;

  --paper: #141b26;
  --surface-1: #1a2230;
  --surface-2: #0d131c;
  --surface-3: #263143;

  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.055);
  --line-strong: rgba(255, 255, 255, 0.17);

  --brand: #58a0ec;
  --brand-deep: #82bbf5;
  --brand-bright: #4b96e8;
  --brand-tint: rgba(75, 150, 232, 0.15);
  --brand-tint-2: rgba(75, 150, 232, 0.3);

  --signal: #ff6b3d;
  --ok: #45c493;
  --ok-tint: rgba(69, 196, 147, 0.14);
  --ok-halo: rgba(69, 196, 147, 0.2);
  --ok-halo-wide: rgba(69, 196, 147, 0.06);
  --bad: #f4796a;
  --bad-tint: rgba(244, 121, 106, 0.14);
  --bad-halo: rgba(244, 121, 106, 0.18);
  --bad-border: rgba(244, 121, 106, 0.42);
  --warn: #e3a851;
  --warn-tint: rgba(227, 168, 81, 0.13);

  --body-glow: rgba(75, 150, 232, 0.12);
  --body-top: #151d29;
  --body-mid: #111823;
  --body-bottom: #0d131c;

  --header-bg: rgba(20, 27, 38, 0.82);
  --header-highlight: rgba(255, 255, 255, 0.05);
  --nav-track: rgba(0, 0, 0, 0.28);
  --nav-hover: rgba(255, 255, 255, 0.06);
  --footer-bg: rgba(20, 27, 38, 0.5);

  --face-top: #202939;
  --face-bottom: #1a2230;
  --panel-top: #1a2230;
  --panel-bottom: #161d29;
  --card-top: #1c2431;
  --card-bottom: #171e2a;

  --input-hover-border: rgba(255, 255, 255, 0.28);
  --zebra: rgba(255, 255, 255, 0.018);
  --grid-line: rgba(255, 255, 255, 0.05);
  --scroll-thumb: rgba(255, 255, 255, 0.18);
  --scroll-thumb-hover: rgba(255, 255, 255, 0.3);

  /* На темному тлі тінь сама по собі не читається — глибину дають
     підсвічена верхня кромка картки й глибші, м'якші тіні. */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.35),
    0 12px 28px -14px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.4),
    0 32px 70px -26px rgba(0, 0, 0, 0.9);
  --ring: 0 0 0 3px rgba(88, 160, 236, 0.32);

  color-scheme: dark;
}

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

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

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background-color: var(--surface-2);
  background-image:
    radial-gradient(1200px 520px at 50% -180px, var(--body-glow), transparent 70%),
    linear-gradient(180deg, var(--body-top) 0%, var(--body-mid) 340px, var(--body-bottom) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

::selection {
  background: var(--brand-tint-2);
  color: var(--ink);
}

/* Тонкі скролбари — щоб щільні таблиці й журнал не виглядали важкими. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--ink-4) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 8px;
  background: var(--scroll-thumb);
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  background-clip: content-box;
}

/* =========================================================================
   Мікрокапс-підписи — базовий структурний елемент інтерфейсу
   ========================================================================= */

.view p,
.choose_object p,
.sim p,
#labelSMS,
#labelResponse,
.help-notes-input > span,
.history-date-field > span,
.sim-check-card__title,
.sim-check-header__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left !important;
}

/* =========================================================================
   Форм-контроли
   ========================================================================= */

button,
input,
select,
textarea {
  font: inherit;
  font-family: var(--font-sans);
}

input[type="password"],
input[type="text"],
input[type="tel"],
input[type="datetime-local"],
select,
textarea {
  width: auto;
  min-height: var(--control-height);
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--paper);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s ease, box-shadow 0.16s ease,
    background-color 0.16s ease;
}

input[type="text"],
input[type="tel"],
input[type="datetime-local"] {
  font-variant-numeric: tabular-nums;
}

input[type="datetime-local"] {
  font-family: var(--font-mono);
  font-size: 13px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% + 1px),
    calc(100% - 12px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

input[type="password"]:hover,
input[type="text"]:hover,
input[type="tel"]:hover,
input[type="datetime-local"]:hover,
select:hover,
textarea:hover {
  border-color: var(--input-hover-border);
}

input[type="password"]:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--ring);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-4);
}

input[type="button"],
button {
  position: relative;
  min-height: var(--control-height);
  padding: 8px 16px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background-image: linear-gradient(180deg, var(--btn-top), var(--btn-bottom));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--btn-highlight),
    0 1px 2px rgba(0, 0, 0, 0.18);
  transition: background-color 0.16s ease, border-color 0.16s ease,
    box-shadow 0.16s ease, transform 0.08s ease, filter 0.16s ease;
}

input[type="button"]:hover,
button:hover {
  filter: saturate(1.06) brightness(0.96);
}

input[type="button"]:active,
button:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

input[type="button"]:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--ring), 0 1px 2px rgba(0, 0, 0, 0.18);
}

button:disabled,
input[type="button"]:disabled {
  opacity: 0.55;
  filter: grayscale(0.35);
  cursor: not-allowed;
  transform: none;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--brand);
}

/* Другорядні дії. Синій акцент лишається тільки за головною дією
   екрана — надсиланням SMS, — інакше сторінка втрачає ієрархію. */
.btn-secondary,
#exec_btn_list_object_view,
#objectSearchButton,
#clearSmsLogBtn,
#helpNotesAddButton + button {
  border: 1px solid var(--line-strong);
  background-image: linear-gradient(180deg, var(--face-top), var(--face-bottom));
  color: var(--ink-2);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover,
#exec_btn_list_object_view:hover,
#objectSearchButton:hover,
#clearSmsLogBtn:hover,
#helpNotesAddButton + button:hover {
  border-color: var(--brand);
  background-image: none;
  background-color: var(--brand-tint);
  color: var(--brand-deep);
  filter: none;
}

a.link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

a.link:hover {
  text-decoration: underline;
}

/* =========================================================================
   Шапка
   ========================================================================= */

.umt-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 1px 0 var(--header-highlight) inset,
    0 10px 30px -26px rgba(0, 0, 0, 0.7);
}

/* "Сигнальна рейка" — тонка лінія кольорів логотипа під шапкою. */
.umt-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--brand) 0%,
    transparent 46%,
    transparent 60%,
    var(--signal) 100%
  );
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.header-left::after {
  content: "SMS Center";
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

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

.header-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--nav-track);
}

.nav-tab {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 7px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition: color 0.16s ease, background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.nav-tab:hover {
  background: var(--nav-hover);
  color: var(--ink);
}

.nav-tab.active,
.header-nav .active {
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-xs), 0 0 0 1px var(--line-soft);
}

.nav-tab .icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.nav-tab:not(.active) .icon {
  filter: grayscale(1);
  opacity: 0.6;
  transition: filter 0.16s ease, opacity 0.16s ease;
}

/* На темному тлі знебарвлена іконка перетворюється на сірий прямокутник,
   тому приглушуємо її прозорістю, а не grayscale. */
:root[data-theme="dark"] .nav-tab:not(.active) .icon {
  filter: none;
  opacity: 0.55;
}

.nav-tab:hover .icon {
  filter: none;
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.header-help-button,
.header-theme-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background-image: linear-gradient(180deg, var(--face-top), var(--face-bottom));
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  box-shadow: var(--shadow-xs);
}

.header-help-button:hover,
.header-theme-button:hover {
  border-color: var(--brand);
  background-image: none;
  background-color: var(--brand-tint);
  color: var(--brand-deep);
  filter: none;
}

/* Кнопка показує тему, на яку перемкне, а не поточну. Іконки — маски,
   бо гліфів ☾/☀ немає в IBM Plex і фолбек виглядає як зірочка. */
.header-theme-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-theme-button::before {
  content: "";
  width: 17px;
  height: 17px;
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat var(--theme-icon);
  mask: center / contain no-repeat var(--theme-icon);
  --theme-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M21.4 13.3A9.2 9.2 0 1 1 10.7 2.6a7.2 7.2 0 0 0 10.7 10.7z'/></svg>");
}

:root[data-theme="dark"] .header-theme-button::before {
  --theme-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='4.4'/><g stroke='black' stroke-width='2.1' stroke-linecap='round'><path d='M12 1.9v2.7M12 19.4v2.7M1.9 12h2.7M19.4 12h2.7M4.9 4.9l1.9 1.9M17.2 17.2l1.9 1.9M19.1 4.9l-1.9 1.9M6.8 17.2l-1.9 1.9'/></g></svg>");
}

#logout {
  border-color: var(--line-strong);
  background-image: linear-gradient(180deg, var(--face-top), var(--face-bottom));
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
}

#logout:hover {
  border-color: var(--bad-border);
  background-image: none;
  background-color: var(--bad-tint);
  color: var(--bad);
  filter: none;
}

/* =========================================================================
   Каркас сторінки
   ========================================================================= */

.main-section {
  width: 100%;
  max-width: 1320px;
  min-height: calc(100vh - var(--header-height) - 52px);
  margin: 0 auto;
  padding: 24px 24px 40px;
}

.choose,
.sms_response_container,
.tableContainerObject {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.choose {
  padding: 18px;
}

.choose_wrapper {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.92fr);
  gap: 16px;
  margin-bottom: 16px;
}

.view,
.choose_object {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  box-shadow: none;
}

.view > select {
  width: 100% !important;
  margin-bottom: 0 !important;
}

.account_actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.account_actions > select,
.account_actions > input[type="text"],
.account_actions > .resource-search {
  width: 100% !important;
  margin-bottom: 0 !important;
}

.resource-search {
  position: relative;
  min-width: 0;
}

.resource-search input {
  width: 100% !important;
}

.resource-search-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1100;
  width: 100%;
  max-height: 320px;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.resource-search-menu button {
  width: 100%;
  min-height: 34px;
  display: block;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  font-weight: 500;
  white-space: normal;
  box-shadow: none;
}

.resource-search-menu button:hover,
.resource-search-menu button:focus {
  background: var(--brand-tint);
  color: var(--brand-deep);
  filter: none;
  transform: none;
}

.choose_object {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px auto;
  align-content: start;
  align-items: center;
}

.choose_object p {
  grid-column: 1 / -1;
}

/* --- панель відправлення ------------------------------------------------ */

/* Базова розкладка підходить обом сторінкам: Vodafone має три поля,
   TravelSim — чотири. */
.sim {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  align-items: stretch;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: none;
}

/* Vodafone: .sms_action_bar розтягнутий на всі колонки, тому auto-fit не
   згортає зайву доріжку — задаємо три колонки явно й віддаємо більше
   місця полю тексту SMS. */
.sim:has(> .sms_action_bar) {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr) minmax(0, 0.95fr);
}

.sim > div,
.choosesim,
.choosecommand,
.chooseallcommand {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.sim p {
  min-height: 16px;
  display: flex;
  align-items: center;
}

.phone-search-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.phone-search-row select {
  flex: 0 0 auto;
  width: 116px;
}

.phone-search-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.phone-input-group {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--paper);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.phone-input-group:hover {
  border-color: var(--input-hover-border);
}

.phone-input-group:focus-within {
  border-color: var(--brand);
  box-shadow: var(--ring);
}

.input-prefix-badge {
  display: flex;
  align-items: center;
  padding-left: 11px;
  padding-right: 3px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
}

/* Без цього правила атрибут [hidden] не спрацьовує: наш клас задає
   display: flex з тією ж специфічністю, що й вбудований стиль браузера
   для [hidden], і як авторський стиль перебиває його. */
.input-prefix-badge[hidden] {
  display: none;
}

.phone-input-group input {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 3px;
  border: none;
  background: transparent;
  box-shadow: none !important;
}

#phoneInput {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.sms_text_field {
  gap: 8px;
}

.sms_text_field label:empty {
  display: none;
}

#sendSmsButton {
  min-height: 40px;
  min-width: 190px;
  padding-inline: 26px;
}

.sim > .sms_action_bar {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#log {
  margin-top: 12px;
  color: var(--ink-3);
  font-size: 13px;
}

#tableContainer,
#tableContainer1 {
  margin-top: 14px;
  overflow-x: auto;
}

#phoneInput,
#resourceSearchInput,
#objectSearchInput,
#smsText,
#commandSelect,
#functSelect,
#objectSearchType {
  width: 100%;
}

textarea,
#smsText {
  min-height: 38px;
  max-height: 120px;
  max-width: 100%;
  resize: vertical;
  overflow-y: auto;
  line-height: 1.5;
}

#smsText {
  resize: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

/* =========================================================================
   Модальні вікна
   ========================================================================= */

.modal-open {
  overflow: hidden;
}

.number-info-modal[hidden] {
  display: none;
}

.number-info-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.number-info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 15, 26, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: modal-fade 0.18s ease-out;
}

.number-info-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  max-height: min(680px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.number-info-modal__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
}

.number-info-modal__header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.25;
}

.number-info-modal__close {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background-image: none;
  background-color: transparent;
  color: var(--ink-3);
  font-size: 20px;
  line-height: 1;
  box-shadow: none;
}

.number-info-modal__close:hover {
  border-color: var(--bad-border);
  background-color: var(--bad-tint);
  color: var(--bad);
  filter: none;
}

.number-info-modal__body {
  padding: 20px;
}

.number-info-list {
  display: grid;
  gap: 0;
}

.number-info-list div {
  display: grid;
  grid-template-columns: minmax(140px, 0.75fr) minmax(0, 1.25fr);
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

.number-info-list div:last-child {
  border-bottom: 0;
}

.number-info-list dt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  align-self: center;
}

.number-info-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  align-self: center;
}

.number-info-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  color: var(--ink-3);
  font-weight: 500;
}

.number-info-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--surface-3);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: number-info-spin 0.7s linear infinite;
}

.number-info-error {
  padding: 13px 14px;
  border: 1px solid var(--bad-border);
  border-left: 3px solid var(--bad);
  border-radius: var(--radius-sm);
  background: var(--bad-tint);
  color: var(--bad);
  font-weight: 500;
}

/* =========================================================================
   Перевірка SIM — приладові плитки
   ========================================================================= */

.sim-check-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.sim-check-header__value {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.sim-check-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sim-check-card {
  position: relative;
  padding: 16px 16px 16px 19px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  box-shadow: var(--shadow-xs);
}

.sim-check-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--line-strong);
}

.sim-check-card--ok::before {
  background: var(--ok);
}

.sim-check-card--bad::before {
  background: var(--bad);
}

.sim-check-card__value {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* min-height утримує значення обох плиток на одній лінії,
   навіть коли підпис однієї з них переноситься на два рядки. */
.sim-check-card__meta-label {
  min-height: 26px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.sim-check-card__meta-value {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

.sim-check-status--active {
  color: var(--ok);
}

.sim-check-status--inactive {
  color: var(--bad);
}

/* Індикатор стану: жива крапка з ореолом. */
.sim-check-status--active::before,
.sim-check-status--inactive::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.sim-check-status--active::before {
  box-shadow: 0 0 0 4px var(--ok-halo);
  animation: signal-pulse 2.4s ease-in-out infinite;
}

.sim-check-status--inactive::before {
  box-shadow: 0 0 0 4px var(--bad-halo);
}

.sim-check-reboot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.sim-check-reboot__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sim-check-reboot__hint {
  margin-bottom: 14px;
  color: var(--ink-3);
  font-size: 13px;
}

.sim-check-reboot__result {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
}

.sim-check-reboot__result--success {
  color: var(--ok);
}

.sim-check-reboot__result--error {
  color: var(--bad);
}

/* =========================================================================
   Нотатки
   ========================================================================= */

.help-notes-modal__dialog {
  width: min(720px, 100%);
}

.help-notes-modal__body {
  display: grid;
  gap: 14px;
}

.help-notes-input {
  display: grid;
  gap: 8px;
}

.help-notes-input textarea {
  min-height: 120px;
  max-height: 240px;
  resize: vertical;
  color: var(--ink);
  font-weight: 400;
}

.help-notes-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.help-notes-status {
  min-height: 20px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}

.help-notes-status.is-error {
  color: var(--bad);
}

.help-notes-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.help-notes-entry {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
}

.help-notes-entry__date {
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-4);
}

.help-notes-entry__text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-weight: 400;
}

.help-notes-empty {
  padding: 22px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-4);
  font-size: 13px;
  text-align: center;
}

/* =========================================================================
   Журнал SMS
   ========================================================================= */

.sms_response_container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
}

.sms_journal_container {
  max-width: none;
}

.sms_response_container_item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sms_journal_item {
  min-height: 420px;
}

.response_date_btn {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
}

.history-date-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
}

.response_date_btn input {
  min-width: 210px;
}

.response_date_btn button:disabled {
  cursor: wait;
}

#responseTimer {
  color: var(--ink-3) !important;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400 !important;
}

.logSMS {
  width: 100%;
  min-height: 220px;
  max-height: 560px;
  margin: 0;
  /* Відступ саме на контейнері: TravelSim пише в журнал голий текст
     (<b>…<br/>), обгортки, якій можна дати padding, там немає. */
  padding: 10px 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
}

.sms_journal_item .logSMS {
  min-height: 300px;
}

/* TravelSim: журнал лежить прямо в .main-section, без картки-обгортки. */
.main-section > #smsLog {
  margin-top: 10px;
  box-shadow: var(--shadow-md);
}

.main-section > div > #labelSMS {
  margin-top: 22px;
}

.logSMS hr {
  height: 1px;
  margin: 8px 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--line-soft) !important;
}

/* Помилки скрипт малює інлайновим color:red — на темному тлі чистий
   червоний читається погано, тому перебиваємо токеном. Ловимо за атрибутом,
   а не за класом: частина рядків журналу — голі <span> без обгортки, і вже
   збережені в localStorage журнали теж треба перефарбувати. */
.logSMS [style*="color:red"],
.logSMS [style*="color: red"] {
  color: var(--bad) !important;
}

.sms-send-log-line {
  display: block;
  /* Горизонтальний відступ дає .logSMS: тут він з'їдався б при
     прокрутці рядка вбік (white-space: nowrap). */
  padding: 4px 0;
  overflow-x: auto;
  overflow-y: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

#smsLog,
#responseLog {
  background: var(--paper);
}

.vodafone-history-block {
  overflow-x: auto;
}

.vodafone-history-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--paper);
  font-size: 13px;
}

.vodafone-history-table th,
.vodafone-history-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  text-align: left;
  vertical-align: middle;
}

.vodafone-history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.vodafone-history-table tbody tr:last-child td {
  border-bottom: 0;
}

.vodafone-history-table tbody tr:hover td {
  background: var(--brand-tint);
}

.vodafone-history-table td:nth-child(1),
.vodafone-history-table td:nth-child(2),
.vodafone-history-table td:nth-child(3),
.vodafone-history-table td:nth-child(4) {
  white-space: nowrap;
}

/* Номер і дата — моноширинним: колонки читаються по розряду. */
.vodafone-history-table td:nth-child(1),
.vodafone-history-table td:nth-child(2) {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
}

.vodafone-history-table td:nth-child(5) {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.vodafone-history-command {
  position: relative;
  cursor: pointer;
}

.vodafone-history-table tbody tr:hover td.vodafone-history-command {
  background: var(--brand-tint-2);
}

.copied-tooltip {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: var(--ok);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  animation: vodafoneCopiedFade 1.6s ease forwards;
}

.copied-tooltip--error {
  background: var(--bad);
}

@keyframes vodafoneCopiedFade {
  0% {
    opacity: 0;
    transform: translateY(-50%) translateX(4px);
  }
  10% {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.history-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 9px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--ink-2);
  vertical-align: middle;
}

.history-type-badge::before {
  content: "✉";
  font-size: 12px;
  line-height: 1;
}

.history-type-out {
  background: var(--brand-tint);
  color: var(--brand-deep);
}

.history-type-out::before {
  content: "➤";
}

.history-type-in {
  background: var(--surface-3);
  color: var(--ink-2);
}

.history-status-success {
  color: var(--ok) !important;
  font-weight: 500;
}

/* =========================================================================
   Таблиці об'єктів
   ========================================================================= */

.tableContainerObject {
  width: 100%;
  margin-top: 18px;
  overflow: auto;
}

.wrap {
  max-height: 150px;
  overflow-y: auto;
}

.fixed-header-table,
#tableContainer table,
#tableContainer1 table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--paper);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.fixed-header-table {
  min-width: 980px;
}

.tableContainerObject .fixed-header-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#tableContainer table,
#tableContainer1 table {
  min-width: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.fixed-header-table thead,
#tableContainer thead,
#tableContainer1 thead {
  background: var(--surface-1);
  text-align: left;
}

.fixed-header-table th,
.fixed-header-table td,
#tableContainer th,
#tableContainer td,
#tableContainer1 th,
#tableContainer1 td,
td,
th {
  border: 0;
  border-bottom: 1px solid var(--line-soft);
}

.fixed-header-table th,
#tableContainer th,
#tableContainer1 th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.fixed-header-table td,
#tableContainer td,
#tableContainer1 td {
  padding: 10px 12px;
  color: var(--ink-2);
  vertical-align: middle;
  word-break: break-word;
}

.tableContainerObject .fixed-header-table th,
.tableContainerObject .fixed-header-table td {
  box-sizing: border-box;
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tableContainerObject .fixed-header-table thead tr:nth-child(2) th {
  position: sticky;
}

/* Заголовок таблиці (перший рядок thead) — підпис блоку, не колонка. */
.table-title-cell {
  position: relative;
  padding: 14px 150px 14px 14px !important;
  border-bottom: 1px solid var(--line) !important;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom)) !important;
  color: var(--ink) !important;
  font-family: var(--font-sans) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em !important;
  text-transform: none !important;
}

.table-title-content {
  display: block;
}

.tableContainerObject .table-auto-width-button {
  position: absolute;
  top: 50%;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background-image: linear-gradient(180deg, var(--face-top), var(--face-bottom));
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transform: translateY(-50%);
}

.tableContainerObject .table-auto-width-button:hover {
  border-color: var(--brand);
  background-image: none;
  background-color: var(--brand-tint);
  color: var(--brand-deep);
  filter: none;
}

.tableContainerObject .fixed-header-table thead tr:nth-child(2) th:nth-child(1),
.tableContainerObject .fixed-header-table td:nth-child(1) {
  padding-left: 10px;
  padding-right: 10px;
}

.tableContainerObject .fixed-header-table thead tr:nth-child(2) th:nth-child(2),
.tableContainerObject .fixed-header-table td:nth-child(2) {
  min-width: 0;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
}

/* Колонки з ідентифікаторами (IMEI / ID / телефон) — моноширинним. */
.tableContainerObject .fixed-header-table td:nth-child(4),
.tableContainerObject .fixed-header-table td:nth-child(5),
.tableContainerObject .fixed-header-table td:nth-child(8) {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: -0.01em;
}

.tableContainerObject .fixed-header-table thead tr:nth-child(2) th:nth-child(5),
.tableContainerObject .fixed-header-table td:nth-child(5),
.tableContainerObject .fixed-header-table thead tr:nth-child(2) th:nth-child(6),
.tableContainerObject .fixed-header-table td:nth-child(6) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tableContainerObject .fixed-header-table thead tr:nth-child(2) th:nth-child(10),
.tableContainerObject .fixed-header-table td:nth-child(10) {
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
}

.sortable-header {
  cursor: pointer;
  user-select: none;
  transition: color 0.16s ease;
}

.sortable-header:hover {
  color: var(--brand-deep);
}

.sortable-header::before {
  content: "↕";
  display: inline-block;
  margin-right: 6px;
  color: var(--ink-4);
  font-size: 10px;
}

.sortable-header[data-sort-direction="asc"]::before {
  content: "↑";
  color: var(--brand);
}

.sortable-header[data-sort-direction="desc"]::before {
  content: "↓";
  color: var(--brand);
}

.fixed-header-table tbody tr,
#tableContainer tbody tr,
#tableContainer1 tbody tr {
  transition: background-color 0.12s ease;
}

.fixed-header-table tbody tr:nth-child(even),
#tableContainer tbody tr:nth-child(even),
#tableContainer1 tbody tr:nth-child(even) {
  background: var(--zebra);
}

.fixed-header-table tbody tr:hover,
#tableContainer tbody tr:hover,
#tableContainer1 tbody tr:hover {
  background: var(--brand-tint);
}

.deactivated-row,
.fixed-header-table .deactivated-row {
  background: var(--warn-tint) !important;
  color: var(--warn);
  font-style: normal;
}

.deactivated-row td {
  color: var(--warn);
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 3;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 1px;
  background: var(--line-strong);
  opacity: 0.6;
  transition: background-color 0.16s ease, opacity 0.16s ease;
}

.column-resize-handle:hover::after,
.column-resize-handle.is-resizing::after {
  background: var(--brand);
  opacity: 1;
}

body.column-resize-active {
  cursor: col-resize;
  user-select: none;
}

/* =========================================================================
   Підвал і дрібниці
   ========================================================================= */

.footer {
  margin-top: 8px;
  padding: 18px 12px;
  border-top: 1px solid var(--line);
  background-color: var(--footer-bg);
  color: var(--ink-4);
}

.footer_text {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nameHero {
  text-align: center;
  margin-bottom: 5px;
}

.fig {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.img1 img {
  vertical-align: middle;
}

.auto,
.authorization_link,
.google_sheet {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 5px 0;
}

.odd {
  background: var(--surface-1);
}

/* =========================================================================
   Сторінка авторизації
   ========================================================================= */

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

/* Ледь помітна сітка — натяк на мережу, під м'яким світлом бренду. */
.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(70% 55% at 50% 45%, #000 0%, transparent 100%);
  mask-image: radial-gradient(70% 55% at 50% 45%, #000 0%, transparent 100%);
  pointer-events: none;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
}

.login-card {
  position: relative;
  display: grid;
  gap: 24px;
  padding: 40px 36px 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--brand) 0%,
    transparent 44%,
    transparent 58%,
    var(--signal) 100%
  );
}

/* umt.png — растр 102×91, тому не масштабуємо його вище нативного розміру:
   на retina-екранах він одразу починає милитися. */
.login-logo {
  margin: auto;
  width: 78px;
  height: auto;
}

.login-copy {
  display: grid;
  gap: 8px;
  text-align: center;
}

.login-eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  text-align: center;
}

.login-copy h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.login-copy p {
  margin: 0;
  color: var(--ink-3);
  font-weight: 400;
}

.login-button {
  min-height: 46px;
  font-size: 15px;
}

/* =========================================================================
   Анімації
   ========================================================================= */

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

@keyframes modal-fade {
  from {
    opacity: 0;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

@keyframes signal-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px var(--ok-halo);
  }
  50% {
    box-shadow: 0 0 0 6px var(--ok-halo-wide);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================================
   Адаптив
   ========================================================================= */

@media (max-width: 1119.8px) {
  .choose_wrapper,
  .sms_response_container {
    grid-template-columns: 1fr;
  }

  .sim,
  .sim:has(> .sms_action_bar) {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .btn-secondary,
  #sendSmsButton {
    min-height: 42px;
  }
}

@media (max-width: 767.8px) {
  :root {
    --header-height: auto;
  }

  .umt-header {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
    padding: 14px 16px;
  }

  .header-left {
    justify-content: center;
  }

  .header-actions {
    justify-self: center;
  }

  .header-nav {
    width: 100%;
    max-width: 360px;
  }

  .nav-tab {
    flex: 1;
    justify-content: center;
  }

  .main-section {
    padding: 16px 12px 28px;
  }

  .choose,
  .sms_response_container {
    padding: 14px;
  }

  .choose_object,
  .sim,
  .sim:has(> .sms_action_bar) {
    grid-template-columns: 1fr;
  }

  .sim > .sms_action_bar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-group {
    flex-direction: column;
  }

  .action-group .btn-secondary,
  #sendSmsButton {
    width: 100%;
  }

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

  .response_date_btn {
    flex-direction: column;
    align-items: stretch;
  }

  .history-date-field {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .response_date_btn input {
    min-width: 0;
    width: 100%;
  }

  input[type="text"],
  input[type="tel"],
  input[type="datetime-local"],
  select,
  textarea {
    width: 100% !important;
  }

  .logSMS {
    min-width: 0;
    min-height: 180px;
  }

  .sim-check-cards,
  .sim-check-header {
    grid-template-columns: 1fr;
  }

  .sim-check-header {
    gap: 12px;
  }

  .number-info-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .login-card {
    padding: 32px 24px 28px;
  }
}
