
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #087f68;
  --primary-dark: #056653;
  --primary-light: #e6f5f0;
  --primary-soft: #f0faf6;

  --accent: #24b99a;
  --accent-light: #dff8ef;

  --background: #f5f8f7;
  --surface: #ffffff;
  --surface-soft: #f9fbfa;

  --text: #172d28;
  --text-secondary: #61746d;
  --text-muted: #93a39c;

  --border: #e6eeea;
  --border-strong: #dce8e2;

  --success: #13a77b;
  --success-soft: #e5f7ef;

  --warning: #d79a35;
  --warning-soft: #fff5e3;

  --danger: #dc6464;
  --danger-soft: #fff0ef;

  --blue: #438cba;
  --purple: #9274c6;

  --sidebar-width: 260px;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;

  --shadow-card:
    0 8px 30px rgba(25, 75, 58, 0.045),
    0 2px 8px rgba(25, 75, 58, 0.025);

  --shadow-hover:
    0 16px 40px rgba(25, 75, 58, 0.09),
    0 4px 12px rgba(25, 75, 58, 0.035);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 30px;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(36, 185, 154, 0.35);
  outline-offset: 3px;
}

::selection {
  color: var(--primary-dark);
  background: #c8f0e2;
}

/* =====================================
   APP LAYOUT
===================================== */

.app-shell {
  width: 100%;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 20;

  display: flex;
  flex-direction: column;

  padding: 28px 20px 20px;

  background: #ffffff;
  border-left: 1px solid var(--border);
}

.main-content {
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  margin-right: var(--sidebar-width);

  padding: 34px 42px 25px;

  max-width: 1800px;
}

/* =====================================
   BRAND
===================================== */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 5px;
}

.brand-logo {
  position: relative;

  width: 45px;
  height: 45px;

  display: grid;
  place-items: center;

  color: white;
  background: linear-gradient(145deg, #0b997a, #056452);

  border-radius: 15px;

  box-shadow: 0 7px 17px rgba(8, 127, 104, 0.2);
}

.brand-symbol {
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
}

.brand-pulse {
  position: absolute;
  width: 8px;
  height: 8px;
  left: 7px;
  top: 7px;
  border-radius: 50%;
  background: #8af3d2;
  box-shadow: 0 0 10px rgba(138, 243, 210, 0.8);
}

.brand-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-info strong {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.brand-info span {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.15px;
  color: var(--text-muted);
  direction: ltr;
}

.sidebar-divider {
  height: 1px;
  margin: 29px 0 27px;
  background: var(--border);
}

/* =====================================
   SIDEBAR NAVIGATION
===================================== */

.sidebar-section-title {
  padding: 0 11px;
  margin-bottom: 12px;

  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.navigation {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.nav-link {
  position: relative;

  display: flex;
  align-items: center;
  gap: 13px;

  min-height: 49px;
  padding: 0 13px;

  border-radius: 13px;

  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;

  transition:
    background 0.22s ease,
    color 0.22s ease,
    transform 0.22s ease;
}

.nav-link:hover {
  background: var(--primary-soft);
  color: var(--primary);
  transform: translateX(-2px);
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 800;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  right: 0;
  top: 13px;
  bottom: 13px;
  width: 3px;
  border-radius: 5px;
  background: var(--primary);
}

.nav-icon {
  width: 25px;
  height: 25px;

  display: grid;
  place-items: center;

  font-size: 20px;
}

/* =====================================
   SIDEBAR BOTTOM
===================================== */

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-device-card {
  padding: 17px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 17px;
}

.sidebar-device-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sidebar-device-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;

  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-light);
  font-size: 19px;
}

.sidebar-device-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;

  font-size: 13px;
  font-weight: 800;
}

.sidebar-device-caption {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  color: var(--text-muted);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 7px;

  margin-top: 20px;
  padding: 0 3px;

  color: var(--text-muted);
  font-size: 10px;
}

.sidebar-footer > span:last-child {
  margin-right: auto;
  direction: ltr;
}

.footer-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* =====================================
   STATUS DOTS
===================================== */

.status-dot,
.counter-dot,
.protocol-indicator,
.live-pulse {
  position: relative;
  flex-shrink: 0;

  width: 8px;
  height: 8px;

  border-radius: 50%;
  background: #c5d0ca;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(19, 167, 123, 0.1);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 100, 100, 0.1);
}

/* =====================================
   TOPBAR
===================================== */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;

  margin-bottom: 30px;
}

.topbar-eyebrow,
.section-eyebrow {
  display: block;
  margin-bottom: 7px;

  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  direction: ltr;
  text-align: right;
}

.topbar-title h1 {
  font-size: clamp(23px, 2.2vw, 29px);
  font-weight: 900;
  letter-spacing: -1px;
}

.topbar-title p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.connection-chip {
  display: flex;
  align-items: center;
  gap: 9px;

  min-height: 40px;
  padding: 0 14px;

  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;

  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.profile-mark {
  width: 41px;
  height: 41px;

  display: grid;
  place-items: center;

  color: white;
  background: linear-gradient(145deg, #149e80, #08715d);

  border-radius: 13px;
  font-size: 20px;
  font-weight: 900;
}

/* =====================================
   PAGE SECTIONS
===================================== */

.page-section {
  margin-bottom: 37px;
  scroll-margin-top: 25px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;

  margin-bottom: 19px;
}

.section-heading h2 {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.section-heading p {
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}

.section-counter,
.timer-live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 9px 13px;

  background: white;
  border: 1px solid var(--border);
  border-radius: 11px;

  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.counter-dot,
.live-pulse {
  background: var(--success);
}

.live-pulse {
  box-shadow: 0 0 0 4px rgba(19, 167, 123, 0.1);
  animation: livePulse 1.7s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(19, 167, 123, 0.1);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(19, 167, 123, 0.03);
  }
}

/* =====================================
   WELCOME BANNER
===================================== */

.welcome-banner {
  position: relative;
  overflow: hidden;

  min-height: 205px;
  padding: 34px 38px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  color: white;

  border-radius: var(--radius-xl);

  background:
    radial-gradient(
      circle at 85% 15%,
      rgba(83, 218, 180, 0.25),
      transparent 35%
    ),
    linear-gradient(115deg, #075e50 0%, #087c67 53%, #0c9b7a 100%);

  box-shadow: 0 15px 35px rgba(5, 102, 83, 0.13);
}

.welcome-content {
  position: relative;
  z-index: 2;
}

.welcome-tag {
  display: inline-block;
  padding: 6px 10px;

  color: #baf2dd;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;

  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  direction: ltr;
}

.welcome-content h2 {
  margin-top: 16px;

  font-size: clamp(20px, 2.3vw, 28px);
  font-weight: 900;
  letter-spacing: -1px;
}

.welcome-content p {
  margin-top: 9px;
  max-width: 500px;

  color: rgba(255, 255, 255, 0.77);
  font-size: 12px;
  line-height: 2;
}

.welcome-decoration {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;

  display: grid;
  place-items: center;
}

.decoration-circle {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.circle-one {
  width: 145px;
  height: 145px;
  animation: rotateDecoration 24s linear infinite;
}

.circle-two {
  width: 110px;
  height: 110px;
  border-style: dashed;
  animation: rotateDecoration 35s linear infinite reverse;
}

.decoration-core {
  width: 73px;
  height: 73px;

  display: grid;
  place-items: center;

  color: #d6fff0;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 23px;

  font-size: 40px;
  font-weight: 900;
  font-style: italic;

  backdrop-filter: blur(8px);
}

@keyframes rotateDecoration {
  to {
    transform: rotate(360deg);
  }
}

/* =====================================
   STATISTICS
===================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
  margin-top: 20px;
}

.stat-card {
  min-height: 112px;
  padding: 20px;

  display: flex;
  align-items: center;
  gap: 15px;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  box-shadow: var(--shadow-card);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.stat-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;

  display: grid;
  place-items: center;

  border-radius: 15px;
  font-size: 24px;
}

.stat-icon-green {
  color: var(--success);
  background: var(--success-soft);
}

.stat-icon-blue {
  color: var(--blue);
  background: #eaf4fb;
}

.stat-icon-purple {
  color: var(--purple);
  background: #f2edfa;
}

.stat-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-value {
  margin-top: 3px;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.4;
}

.stat-value-small {
  font-size: 16px;
}

.stat-description {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
}

/* =====================================
   CONNECTION CARD
===================================== */

.connection-card {
  padding: 23px 25px;

  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);

  box-shadow: var(--shadow-card);
}

.connection-card-main {
  display: flex;
  align-items: center;
  gap: 20px;
}

.connection-visual {
  width: 70px;
  height: 70px;
  flex-shrink: 0;

  display: grid;
  place-items: center;

  border-radius: 21px;
  background: var(--primary-soft);
}

.connection-visual-ring {
  width: 47px;
  height: 47px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(8, 127, 104, 0.25);
  border-radius: 50%;

  color: var(--primary);
  font-size: 27px;
}

.connection-information {
  min-width: 0;
}

.connection-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.connection-title-row h3 {
  font-size: 14px;
  font-weight: 900;
}

.connection-badge {
  padding: 5px 9px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 800;
}

.connection-information > p {
  margin-top: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.connection-description {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10px;
}

.connection-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;

  margin-top: 22px;
  padding-top: 19px;

  border-top: 1px solid var(--border);
}

.connection-protocol {
  display: flex;
  align-items: center;
  gap: 9px;

  color: var(--text-muted);
  font-size: 10px;
  direction: ltr;
}

.protocol-indicator {
  background: var(--success);
}

/* =====================================
   BUTTONS
===================================== */

.primary-button {
  min-height: 44px;
  padding: 0 19px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  color: white;
  background: linear-gradient(135deg, #0b9879, #08745f);

  border: 0;
  border-radius: 12px;

  box-shadow: 0 6px 15px rgba(8, 127, 104, 0.15);

  font-size: 11px;
  font-weight: 800;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 9px 19px rgba(8, 127, 104, 0.23);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0);
}

.primary-button:disabled {
  opacity: 0.7;
}

.button-symbol {
  font-size: 17px;
}

/* =====================================
   OUTPUT CARDS
===================================== */

.outputs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.output-card {
  position: relative;
  overflow: hidden;

  min-width: 0;
  padding: 20px;

  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);

  box-shadow: var(--shadow-card);

  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.output-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.output-card.active {
  border-color: rgba(19, 167, 123, 0.35);
  background:
    linear-gradient(
      145deg,
      #ffffff 0%,
      #f7fffb 100%
    );
}

.output-card.active::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0c9c79, #63d8af);
}

.output-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.output-channel-icon {
  width: 43px;
  height: 43px;

  display: grid;
  place-items: center;

  color: var(--primary);
  background: var(--primary-light);
  border-radius: 13px;

  font-size: 13px;
  font-weight: 900;
  direction: ltr;
}

.output-state {
  padding: 6px 10px;

  color: var(--text-muted);
  background: #f1f4f2;

  border-radius: 8px;

  font-size: 10px;
  font-weight: 800;
}

.output-card.active .output-state {
  color: var(--success);
  background: var(--success-soft);
}

.output-card-body {
  padding: 20px 0 18px;
}

.output-overline,
.timer-overline {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  direction: ltr;
}

.output-name {
  overflow: hidden;
  margin-top: 7px;

  color: var(--text);
  font-size: 17px;
  font-weight: 900;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-name-button {
  margin-top: 9px;
  padding: 0;

  color: var(--primary);
  background: transparent;
  border: 0;

  font-size: 10px;
  font-weight: 700;
}

.edit-name-button:hover:not(:disabled) {
  color: var(--primary-dark);
  text-decoration: underline;
}

.edit-name-button:disabled {
  color: #aab8b1;
}

.output-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.output-footer-label {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
}

.toggle-button {
  min-width: 112px;
  min-height: 38px;
  padding: 0 13px;

  color: white;
  background: var(--primary);

  border: 0;
  border-radius: 10px;

  font-size: 10px;
  font-weight: 800;

  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.toggle-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(8, 127, 104, 0.17);
}

.toggle-button.on {
  color: #a34d4d;
  background: var(--danger-soft);
}

.toggle-button.pending {
  color: #a87522;
  background: var(--warning-soft);
  cursor: wait;
}

.toggle-button:disabled {
  color: #9aa8a1;
  background: #edf1ef;
}

@keyframes pendingPulse {
  from {
    opacity: 0.65;
  }
  to {
    opacity: 1;
  }
}

.toggle-button.pending {
  animation: pendingPulse 0.8s ease-in-out infinite alternate;
}

/* =====================================
   TIMER INFORMATION
===================================== */

.timer-information-banner {
  display: flex;
  align-items: center;
  gap: 13px;

  margin-bottom: 19px;
  padding: 15px 18px;

  background: linear-gradient(100deg, #eaf8f2, #f3fbf7);
  border: 1px solid #dcefe5;
  border-radius: 15px;
}

.timer-information-icon {
  width: 39px;
  height: 39px;
  flex-shrink: 0;

  display: grid;
  place-items: center;

  color: var(--primary);
  background: white;
  border-radius: 12px;

  font-size: 21px;
}

.timer-information-banner strong {
  display: block;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
}

.timer-information-banner p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.8;
}

/* =====================================
   TIMER GRID
===================================== */

.timer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.timer-card {
  min-width: 0;
  padding: 17px 13px 14px;

  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;

  box-shadow: var(--shadow-card);

  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.timer-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.timer-card.running {
  border-color: rgba(19, 167, 123, 0.4);
}

.timer-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.timer-name {
  overflow: hidden;
  max-width: 145px;
  margin-top: 5px;

  color: var(--text);
  font-size: 12px;
  font-weight: 900;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.timer-indicator {
  width: 9px;
  height: 9px;
  margin-top: 5px;

  flex-shrink: 0;
  border-radius: 50%;
  background: #d1d9d5;
}

.timer-card.running .timer-indicator {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(19, 167, 123, 0.11);
  animation: livePulse 1.7s ease-in-out infinite;
}

/* =====================================
   CIRCULAR TIMER
===================================== */

.timer-circle {
  position: relative;

  width: min(100%, 174px);
  aspect-ratio: 1 / 1;

  margin: 16px auto 13px;

  display: grid;
  place-items: center;
}

.timer-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;

  transform: rotate(-90deg);
  overflow: visible;
}

.timer-ring-track,
.timer-ring-progress {
  fill: none;
  stroke-width: 7;
}

.timer-ring-track {
  stroke: #edf3f0;
}

.timer-ring-progress {
  stroke: #17a982;
  stroke-linecap: round;

  stroke-dasharray: 427.26;
  stroke-dashoffset: 0;

  opacity: 0.7;

  transition:
    stroke 0.3s ease,
    opacity 0.3s ease;
}

.timer-card.running .timer-ring-progress {
  stroke: url(#timerGradient);
  opacity: 1;
  filter: drop-shadow(0 2px 4px rgba(19, 167, 123, 0.18));
}

.timer-circle-content {
  position: relative;
  z-index: 1;

  width: 82%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-circle-label {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
}

.timer-value {
  margin-top: 7px;

  color: var(--text);
  font-size: clamp(16px, 1.55vw, 21px);
  font-weight: 900;
  line-height: 1.5;

  direction: ltr;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timer-card.running .timer-value {
  color: var(--primary-dark);
}

.timer-circle-unit {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 8px;
  white-space: nowrap;
}

.timer-card-footer {
  padding-top: 11px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.timer-caption {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 600;
}

.timer-card.running .timer-caption {
  color: var(--success);
}

/* =====================================
   MAIN FOOTER
===================================== */

.main-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding-top: 22px;
  border-top: 1px solid var(--border);

  color: var(--text-muted);
  font-size: 9px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;

  color: var(--text-secondary);
}

.footer-brand strong {
  font-size: 11px;
  font-weight: 900;
}

.footer-brand-mark {
  width: 24px;
  height: 24px;

  display: grid;
  place-items: center;

  color: white;
  background: var(--primary);

  border-radius: 7px;
  font-weight: 900;
}

.footer-version {
  direction: ltr;
  letter-spacing: 1px;
  font-weight: 700;
}

/* =====================================
   TOAST
===================================== */

.toast {
  position: fixed;
  z-index: 100;

  bottom: 25px;
  left: 25px;

  max-width: min(400px, calc(100vw - 40px));

  padding: 14px 19px;

  color: white;
  background: #183c32;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;

  box-shadow: 0 12px 35px rgba(14, 51, 40, 0.2);

  font-size: 11px;
  font-weight: 700;
  line-height: 1.8;

  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* =====================================
   RESPONSIVE: LARGE TABLET
===================================== */

@media (max-width: 1250px) {
  .main-content {
    padding-right: 28px;
    padding-left: 28px;
  }

  .timer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timer-circle {
    width: min(100%, 190px);
  }

  .timer-value {
    font-size: 22px;
  }
}

/* =====================================
   RESPONSIVE: TABLET
===================================== */

@media (max-width: 900px) {
  :root {
    --sidebar-width: 220px;
  }

  .sidebar {
    padding-right: 15px;
    padding-left: 15px;
  }

  .main-content {
    padding: 27px 22px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card:last-child {
    grid-column: span 2;
  }

  .welcome-banner {
    padding: 28px;
  }

  .welcome-decoration {
    transform: scale(0.85);
  }
}

/* =====================================
   RESPONSIVE: MOBILE
===================================== */

@media (max-width: 650px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    position: static;

    width: 100%;
    height: auto;

    padding: 13px 16px;

    border-left: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand-logo {
    width: 39px;
    height: 39px;
    border-radius: 12px;
  }

  .brand-symbol {
    font-size: 21px;
  }

  .sidebar-divider,
  .sidebar-section-title,
  .sidebar-bottom {
    display: none;
  }

  .navigation {
    flex-direction: row;
    gap: 6px;

    overflow-x: auto;
    margin-top: 15px;
    padding-bottom: 2px;
  }

  .nav-link {
    min-height: 39px;
    flex-shrink: 0;
    gap: 6px;
    padding: 0 10px;

    font-size: 10px;
  }

  .nav-link.active::before {
    display: none;
  }

  .nav-icon {
    width: 19px;
    height: 19px;
    font-size: 16px;
  }

  .main-content {
    width: 100%;
    margin-right: 0;
    padding: 22px 15px 20px;
  }

  .topbar {
    align-items: flex-start;
    margin-bottom: 22px;
  }

  .topbar-title h1 {
    font-size: 21px;
  }

  .topbar-title p {
    font-size: 10px;
  }

  .connection-chip {
    min-height: 36px;
    padding: 0 9px;
    gap: 6px;
    font-size: 9px;
  }

  .profile-mark {
    width: 36px;
    height: 36px;
  }

  .welcome-banner {
    min-height: 175px;
    padding: 22px;
    border-radius: 22px;
  }

  .welcome-content h2 {
    max-width: 290px;
    font-size: 20px;
    line-height: 1.8;
  }

  .welcome-content p {
    max-width: 260px;
    font-size: 10px;
  }

  .welcome-decoration {
    position: absolute;
    left: -40px;
    opacity: 0.38;
    transform: scale(0.8);
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    min-height: 95px;
    padding: 13px;
    gap: 10px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 19px;
  }

  .stat-label {
    font-size: 9px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-value-small {
    font-size: 13px;
  }

  .stat-description {
    font-size: 8px;
  }

  .section-heading h2 {
    font-size: 16px;
  }

  .section-heading p {
    font-size: 9px;
  }

  .section-counter,
  .timer-live-indicator {
    padding: 7px 9px;
    font-size: 9px;
  }

  .connection-card {
    padding: 17px;
    border-radius: 19px;
  }

  .connection-card-main {
    gap: 12px;
  }

  .connection-visual {
    width: 54px;
    height: 54px;
    border-radius: 16px;
  }

  .connection-visual-ring {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .connection-title-row h3 {
    font-size: 12px;
  }

  .connection-information > p {
    font-size: 10px;
  }

  .connection-description {
    font-size: 9px;
    line-height: 1.9;
  }

  .connection-card-footer {
    align-items: stretch;
    flex-direction: column;
    margin-top: 16px;
    padding-top: 15px;
  }

  .connection-protocol {
    font-size: 9px;
  }

  .primary-button {
    width: 100%;
  }

  .outputs-grid {
    gap: 11px;
  }

  .output-card {
    padding: 14px;
    border-radius: 17px;
  }

  .output-channel-icon {
    width: 35px;
    height: 35px;
    border-radius: 11px;
    font-size: 11px;
  }

  .output-state {
    padding: 5px 7px;
    font-size: 8px;
  }

  .output-card-body {
    padding: 16px 0;
  }

  .output-overline {
    font-size: 7px;
  }

  .output-name {
    font-size: 12px;
  }

  .edit-name-button {
    font-size: 9px;
  }

  .output-card-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .output-footer-label {
    font-size: 9px;
  }

  .toggle-button {
    width: 100%;
    min-width: 0;
    min-height: 35px;
    font-size: 9px;
  }

  .timer-information-banner {
    padding: 12px;
    gap: 10px;
  }

  .timer-information-banner p {
    font-size: 9px;
  }

  .timer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .timer-card {
    padding: 13px 9px 11px;
    border-radius: 17px;
  }

  .timer-name {
    max-width: 110px;
    font-size: 10px;
  }

  .timer-overline {
    font-size: 7px;
  }

  .timer-circle {
    width: 100%;
    max-width: 155px;
    margin: 13px auto 10px;
  }

  .timer-circle-label {
    font-size: 8px;
  }

  .timer-value {
    font-size: clamp(14px, 4vw, 18px);
  }

  .timer-circle-unit {
    font-size: 7px;
  }

  .timer-caption {
    font-size: 8px;
  }

  .main-footer {
    flex-wrap: wrap;
    font-size: 8px;
  }
}

/* =====================================
   SMALL MOBILE
===================================== */

@media (max-width: 380px) {
  .main-content {
    padding-right: 11px;
    padding-left: 11px;
  }

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

  .stat-card {
    padding: 10px;
  }

  .output-card {
    padding: 11px;
  }

  .output-name {
    font-size: 11px;
  }

  .timer-value {
    font-size: 13px;
  }
}

/* =====================================
   REDUCED MOTION
===================================== */

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