/* 
  Design system for Koskesh Panel (Front-end only).
  Notes:
  - Keep comments in English per project rule.
  - Use CSS variables + lightweight component classes for consistency.
*/

:root{
  /* Colors */
  --bg-0: #070A13;
  --bg-1: #0B1020;
  --surface-0: rgba(255,255,255,.06);
  --surface-1: rgba(255,255,255,.10);
  --surface-2: rgba(255,255,255,.14);
  --border: rgba(255,255,255,.12);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.68);
  --muted-2: rgba(255,255,255,.52);

  --primary: #7C3AED;  /* violet-600 */
  --primary-2: #4F46E5; /* indigo-600 */
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;

  /* Radii */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Shadows */
  --shadow-1: 0 12px 40px rgba(0,0,0,.35);
  --shadow-2: 0 18px 60px rgba(0,0,0,.45);

  /* Focus */
  --focus: 0 0 0 3px rgba(124,58,237,.35);
}

html { height: 100%; }

body{
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% 10%, rgba(124,58,237,.25), transparent 55%),
    radial-gradient(900px 500px at 15% 0%, rgba(79,70,229,.22), transparent 55%),
    radial-gradient(900px 500px at 70% 95%, rgba(34,197,94,.10), transparent 55%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
}

/* Smooth fonts */
*{ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Hide scrollbars (keep scroll working) */
.no-scrollbar::-webkit-scrollbar { width: 0; height: 0; }
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }

/* Glass surfaces */
.glass{
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.panel{
  border-radius: var(--r-xl);
  overflow: hidden;
}

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .72rem 1rem;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: .1px;
  border: 1px solid var(--border);
  user-select: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.btn:focus{ outline: none; box-shadow: var(--focus); }
.btn:active{ transform: translateY(1px); }

.btn-primary{
  border-color: rgba(124,58,237,.55);
  background: linear-gradient(135deg, rgba(124,58,237,1), rgba(79,70,229,1));
  box-shadow: 0 12px 30px rgba(124,58,237,.22);
}
.btn-primary:hover{ opacity: .95; }

.btn-ghost{
  background: rgba(255,255,255,.06);
}
.btn-ghost:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
}

.btn-danger{
  border-color: rgba(239,68,68,.45);
  background: rgba(239,68,68,.12);
}
.btn-danger:hover{ background: rgba(239,68,68,.16); }

.btn-sm{ padding: .55rem .8rem; border-radius: 12px; font-weight: 700; }
.btn-icon{ width: 44px; height: 44px; padding: 0; border-radius: 14px; }

.btn[disabled]{
  opacity: .45;
  cursor: not-allowed;
}

/* Inputs */
.input{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.20);
  color: var(--text);
  padding: .78rem .95rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input::placeholder{ color: rgba(255,255,255,.45); }
.input:focus{
  border-color: rgba(124,58,237,.55);
  box-shadow: var(--focus);
  background: rgba(0,0,0,.26);
}
.input-label{
  font-size: .86rem;
  color: var(--muted);
  margin-bottom: .35rem;
  display: inline-block;
  font-weight: 700;
}
.help{
  color: var(--muted-2);
  font-size: .8rem;
  margin-top: .35rem;
}

/* Chips */
.chip{
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .28rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.82);
  font-size: .74rem;
  font-weight: 800;
}
.dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}
.dot.online{ background: var(--success); }
.dot.offline{ background: var(--danger); }
.dot.unknown{ background: rgba(255,255,255,.38); }

/* Cards */
.card{
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.05));
  box-shadow: var(--shadow-1);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: rgba(255,255,255,.20);
}

/* Sidebar items */
.s-item{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.s-item:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}
.s-item.active{
  background: rgba(124,58,237,.18);
  border-color: rgba(124,58,237,.32);
}

/* Modal */
.modal-backdrop{
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-panel{
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  box-shadow: var(--shadow-2);
}

/* Toasts */
.toast-host{
  position: fixed;
  top: 16px;
  right: 16px; /* RTL-friendly "top-right" */
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
}
.toast{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(10,12,20,.72);
  box-shadow: var(--shadow-1);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.toast .title{ font-weight: 900; font-size: .9rem; }
.toast .desc{ color: var(--muted); font-size: .82rem; margin-top: 2px; }

/* Small utility */
.kbd{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: .74rem;
  color: rgba(255,255,255,.8);
  font-weight: 800;
}


