/* Login full-screen */
body.login-page {
    margin: 0;
    background: #27374D
}

.login-main {
    padding: 0;
    max-width: none
}

.login-full {
    min-height: 100vh;
    position: relative;
    display: grid;
    place-items: center;
    background-image: linear-gradient(rgba(17, 22, 28, .86), rgba(21, 28, 38, .86)), var(--bg-img);
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.center-wrap {
    width: 100%;
    display: grid;
    place-items: center;
    padding: clamp(24px, 5vw, 40px) 12px;
    color: #fff
}

.auth-card {
    width: min(420px, 92vw);
    background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .05));
    border: 1px solid rgba(255, 255, 255, .14);
    backdrop-filter: blur(12px);
    border-radius: 22px;
    padding: clamp(20px, 3.2vw, 28px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.logo {
    display: block;
    height: 150px;
    width: auto;
    margin: 2px auto 10px;
    object-fit: contain
}

.title {
    margin: 6px 0 14px;
    text-align: center;
    font-size: clamp(24px, 2.6vw, 34px);
    font-weight: 800
}

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

.field.pill input {
    width: 100%;
    height: clamp(44px, 6vw, 52px);
    border-radius: 9999px;
    background: rgba(255, 255, 255, .96);
    border: 0;
    padding: 0 18px;
    color: #0b1220
}

.field.pill input::placeholder {
    color: #90a4c0
}

.btn.primary.pill.big {
    width: clamp(150px, 28vw, 220px);
    height: clamp(42px, 6.5vw, 52px);
    padding: 0 24px;
    border-radius: 9999px;
    background: linear-gradient(90deg, #D2DAFF, #B9C4FF);
    color: #0b1220;
    font-weight: 900;
    margin: 12px auto 0
}

.alert.error {
    width: 100%;
    background: rgba(254, 242, 242, .95);
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 10px 14px
}

.footer-text {
    font-size: 17px;
    color: #d3daf7;
    text-align: center;
    margin-top: 16px;
    font-weight: 600;
    letter-spacing: .5px
}

/* ===============================
   TOP NAV ALIGN FIX (global)
   =============================== */

.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

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

.topnav .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.topnav .menu {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.topnav .menu a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    line-height: 1;
    white-space: nowrap;
}

.topnav .nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* On smaller widths: keep menu in one horizontal row + scroll */
@media (max-width: 980px) {
    .topnav .menu {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    .topnav .menu::-webkit-scrollbar {
        height: 8px;
    }

    .topnav .menu::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, .18);
        border-radius: 999px;
    }
}

/* small screens: force single row + horizontal scroll */
@media (max-width: 980px) {

  .tabs,
  .tabbar,
  .tab-bar,
  .tab-nav,
  .tabs-nav,
  .nav-tabs,
  .device-tabs,
  .devices-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .tabs::-webkit-scrollbar,
  .tabbar::-webkit-scrollbar,
  .tab-bar::-webkit-scrollbar,
  .tab-nav::-webkit-scrollbar,
  .tabs-nav::-webkit-scrollbar,
  .nav-tabs::-webkit-scrollbar,
  .device-tabs::-webkit-scrollbar,
  .devices-tabs::-webkit-scrollbar {
    height: 8px;
  }

  .tabs::-webkit-scrollbar-thumb,
  .tabbar::-webkit-scrollbar-thumb,
  .tab-bar::-webkit-scrollbar-thumb,
  .tab-nav::-webkit-scrollbar-thumb,
  .tabs-nav::-webkit-scrollbar-thumb,
  .nav-tabs::-webkit-scrollbar-thumb,
  .device-tabs::-webkit-scrollbar-thumb,
  .devices-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .18);
    border-radius: 999px;
  }
}