/* =========================================================
   ColdStore Admin Panel - App Layer
   - app-specific helpers, login page, legacy modal, scrollbar
   - NO shared component re-definitions (btn/input/table/toast/modal-root yok)
   ========================================================= */

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #020617; }
::-webkit-scrollbar-thumb {
  background: #1f2937;
  border-radius: 10px;
}

/* Utility (app-only) */
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.k { color: #60a5fa; }

/* Content */
.content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Forms (app layer form layout) */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }

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

.field__hint {
  font-size: 11px;
  color: var(--muted);
}

/* Button Row (layout helper) */
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Callout (app) */
.callout {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  font-size: 13px;
}

.callout.ok { border-left: 4px solid var(--success); }
.callout.warn { border-left: 4px solid var(--warning); }
.callout.err { border-left: 4px solid var(--danger); }

/* =========================================================
   Legacy Modal (only if you still use ".modal" in some pages)
   - New modal system is in theme.css (.modal-root / .modal-box ...)
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  min-width: 320px;
  max-width: 520px;
  box-shadow: var(--shadow);
}

/* =========================
   LOGIN (full page clean)
========================= */
.content--login{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.login-card{
  width: min(440px, 92vw);
  border-radius: 18px;
  overflow: hidden;
}

.login-card .card__header{
  padding: 18px 18px 10px 18px;
}

.login-brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.login-brand__logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  letter-spacing: .5px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
}

.login-brand__title{
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.login-brand__subtitle{
  font-size: 12px;
  opacity: .75;
  margin-top: 2px;
}

.login-actions{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content: space-between;
  margin-top: 10px;
}

.login-actions .btn{ width: 100%; }

.login-advanced{
  margin-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 12px;
}

.login-advanced summary{
  cursor:pointer;
  user-select:none;
  opacity: .85;
  font-size: 12px;
}

.login-advanced summary:hover{ opacity: 1; }

.login-muted{
  font-size: 12px;
  opacity: .70;
}

/* =========================================================
   Responsive (app-only)
   ========================================================= */
@media (max-width: 900px) {
  .content { gap: 14px; }
  .form { gap: 10px; }
}

@media (max-width: 760px) {
  .btn-row { gap: 8px; }
  .btn-row .btn { flex: 1 1 100%; width: 100%; }

  .callout { padding: 10px 12px; }

  /* Legacy modal (if used) */
  .modal-content {
    width: min(520px, calc(100vw - 24px));
    max-width: none;
    min-width: 0;
    padding: 14px;
    border-radius: 14px;
  }

  /* Login */
  .content--login {
    padding: 18px;
    align-items: stretch;
  }

  .login-card {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
  }

  .login-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .login-actions .btn { width: 100%; }
}

@media (max-width: 420px) {
  .field__label { font-size: 12px; }
  .field__hint { font-size: 11px; }

  .login-brand__logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .login-brand__title { font-size: 15px; }
  .login-muted { font-size: 11px; }

  /* Legacy modal */
  .modal-content { padding: 12px; }
}

/* =========================================================
   Device Dashboard Cards
   ========================================================= */
.device-card {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.device-card:hover {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.2) !important;
  transform: translateY(-2px);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
}

.badge--green {
  background: rgba(76,175,80,0.2);
  border-color: rgba(76,175,80,0.4);
  color: #4caf50;
}

.badge--red {
  background: rgba(244,68,68,0.2);
  border-color: rgba(244,68,68,0.4);
  color: #f44;
}

.badge--yellow {
  background: rgba(255,193,7,0.2);
  border-color: rgba(255,193,7,0.4);
  color: #ffc107;
}

.badge--blue {
  background: rgba(33,150,243,0.2);
  border-color: rgba(33,150,243,0.4);
  color: #2196f3;
}

.badge--gray {
  background: rgba(158,158,158,0.2);
  border-color: rgba(158,158,158,0.4);
  color: #999;
}

/* grid2 (2 column grid) */
.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(1fr));
  gap: 20px;
}

@media (max-width: 900px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

/* muted class */
.muted {
  opacity: 0.6;
  color: var(--muted, #999);
}
