:root {
  color-scheme: light;
  --page: #eaf0f6;
  --phone: #0b1118;
  --screen: #f8fbfd;
  --surface: #ffffff;
  --surface-soft: #eef4f7;
  --ink: #13202b;
  --muted: #657789;
  --line: #d7e2eb;
  --green: #12a76f;
  --green-dark: #087a53;
  --blue: #236caf;
  --red: #d64b4b;
  --amber: #b7791f;
  --shadow: 0 24px 70px rgba(19, 32, 43, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
  font-weight: 700;
}

.danger {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
  font-weight: 700;
}

.ghost {
  color: var(--blue);
}

.hidden {
  display: none !important;
}

.app-frame {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: min(900px, calc(100vh - 44px));
  border: 8px solid var(--phone);
  border-radius: 42px;
  background: var(--screen);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.phone-statusbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 24px 6px;
  color: #25313d;
  font-size: 12px;
  font-weight: 700;
}

.app-header,
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px 18px;
}

.admin-header {
  color: var(--ink);
  padding: 0 0 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 20px;
}

.admin-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: inherit;
  padding: 9px 13px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.7);
}

.status-card,
.panel,
.admin-login {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 18px;
}

.phone-shell .status-card {
  margin: 12px 16px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.badge {
  min-width: 72px;
  border-radius: 999px;
  background: #e7f1fb;
  color: var(--blue);
  padding: 7px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.badge.success {
  background: #e5f8ef;
  color: var(--green-dark);
}

.badge.warning {
  background: #fff4db;
  color: var(--amber);
}

.subtle,
.recording-line {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.stack {
  display: grid;
  gap: 13px;
}

label {
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  min-height: 46px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 13px;
}

.account-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 16px 12px;
  border: 1px solid rgba(18, 167, 111, 0.22);
  border-radius: 18px;
  background: #e9f8f1;
  padding: 13px 15px;
}

.account-chip span,
.account-chip strong {
  display: block;
}

.account-chip div span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.account-chip strong {
  margin-top: 3px;
  font-size: 23px;
}

.call-screen {
  margin: 0 16px 12px;
  border-radius: 28px;
  background: #15202b;
  color: #ffffff;
  padding: 20px;
}

.caller-profile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.avatar-ring {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  background: rgba(18, 167, 111, 0.18);
}

.avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
  font-weight: 800;
}

.call-screen .eyebrow,
.recording-line {
  color: #aebdcc;
}

.call-timer {
  padding: 18px 0 10px;
  text-align: center;
  font-size: 48px;
  font-weight: 800;
}

.dialer-card {
  margin: 0 16px 12px;
  border-radius: 28px 28px 34px 34px;
  background: var(--surface);
  padding: 18px;
}

.dial-display {
  display: grid;
  min-height: 92px;
  place-items: center;
  border-radius: 22px;
  background: var(--surface-soft);
  margin-bottom: 12px;
  text-align: center;
}

.dial-display span {
  color: var(--muted);
  font-size: 13px;
}

.dial-display strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 30px;
}

.number-input {
  border: 0;
  background: transparent;
  margin-bottom: 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
}

.number-input:focus {
  outline: 3px solid rgba(35, 108, 175, 0.14);
}

.dial-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 12px;
}

.dial-pad button {
  display: grid;
  min-height: 68px;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 0;
  border-radius: 50%;
  background: #eef3f7;
  color: var(--ink);
}

.dial-pad button[data-key="Clear"],
.dial-pad button[data-key="Back"] {
  border-radius: 22px;
}

.dial-pad button strong {
  font-size: 25px;
  line-height: 1;
}

.dial-pad button span {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}

.dial-pad button[data-key="Clear"] strong,
.dial-pad button[data-key="Back"] strong {
  font-size: 15px;
}

.call-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.round-action {
  display: grid;
  min-height: 74px;
  place-items: center;
  gap: 4px;
  border: 0;
  border-radius: 22px;
  background: #eef3f7;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.action-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: inherit;
  font-size: 20px;
  line-height: 1;
}

.primary-call {
  background: var(--green);
  color: #ffffff;
}

.primary-call .action-icon {
  color: var(--green);
}

.answer {
  color: var(--green-dark);
}

.mute {
  color: var(--blue);
}

.end {
  background: var(--red);
  color: #ffffff;
}

.end .action-icon {
  color: var(--red);
}

.history-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li,
.record-item {
  border-left: 3px solid var(--green);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 11px 12px;
  color: var(--muted);
}

.history-list strong,
.record-item strong {
  display: block;
  color: var(--ink);
}

.admin-frame {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.admin-login {
  width: min(420px, 100%);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metrics article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 27px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.record-list {
  display: grid;
  gap: 10px;
}

audio {
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 820px) {
  .app-frame {
    padding: 0;
    place-items: stretch;
  }

  .phone-shell {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .admin-frame {
    padding: 18px;
  }

  .metrics,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 440px) {
  .phone-statusbar {
    padding-inline: 18px;
  }

  .app-header {
    padding-inline: 16px;
  }

  .caller-profile {
    grid-template-columns: auto 1fr;
  }

  .caller-profile .badge {
    grid-column: 1 / -1;
    width: 100%;
  }

  .dial-pad {
    gap: 10px;
  }

  .dial-pad button {
    min-height: 62px;
  }

  .call-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .round-action {
    min-height: 68px;
  }

  h1 {
    font-size: 24px;
  }
}
