:root {
  --orange: #E17F38;
  --orange-dark: #CC6633;
  --blue: #3F485A;
  --dark-blue: #22374A;
  --teal: #2EC4B6;
  --grey: #DBDDE0;
  --light-grey: #F5F7FA;
  --body-text: #333333;
  --white: #FFFFFF;
  --green: #22c55e;
  --red: #dc2626;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* Login */
.login-body {
  background: var(--dark-blue);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container { background: var(--white); border-radius: 12px; padding: 40px; width: 90%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { max-width: 240px; }
.login-title { color: var(--blue); font-size: 1.4rem; font-weight: 700; text-align: center; margin-bottom: 8px; }
.login-subtitle { color: #6b7280; font-size: 0.9rem; text-align: center; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; color: var(--blue); font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-group input { width: 100%; padding: 12px 16px; border: 2px solid var(--grey); border-radius: 8px; font-size: 1rem; outline: none; transition: border-color 0.2s; }
.form-group input:focus { border-color: var(--orange); }
.error-msg { background: #fef2f2; color: var(--red); padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 16px; display: none; }
.error-msg.visible { display: block; }
.qr-container { text-align: center; margin: 16px 0; }
.qr-container img { max-width: 200px; border-radius: 8px; }
.qr-container p { font-size: 0.8rem; color: #6b7280; margin-top: 8px; }

.btn { width: 100%; padding: 14px; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--orange); color: white; }
.btn-primary:hover { background: var(--orange-dark); }

/* Dashboard */
.dashboard-body { background: var(--light-grey); min-height: 100vh; }

.nav {
  background: var(--dark-blue);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-left { display: flex; align-items: center; gap: 12px; }
.nav-logo { height: 28px; }
.nav-title { color: var(--white); font-size: 1.1rem; font-weight: 700; }
.nav-right { display: flex; gap: 12px; align-items: center; }
.nav-link { color: var(--grey); text-decoration: none; font-size: 0.85rem; padding: 6px 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2); background: none; cursor: pointer; transition: background 0.2s; }
.nav-link:hover { background: rgba(255,255,255,0.1); }
.nav-btn { font-family: inherit; }

.dashboard { max-width: 1000px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }

.card {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card h2 { color: var(--blue); font-size: 1.1rem; margin-bottom: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header h2 { margin-bottom: 0; }

/* Status */
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.status-item { text-align: center; padding: 12px; background: var(--light-grey); border-radius: 8px; }
.status-item .value { font-size: 1.5rem; font-weight: 700; color: var(--blue); }
.status-item .label { font-size: 0.75rem; color: #6b7280; margin-top: 4px; }
.status-time { font-size: 0.75rem; color: #9ca3af; margin-top: 12px; text-align: right; }

/* Containers */
.container-grid { display: flex; flex-direction: column; gap: 8px; }
.container-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--light-grey);
  border-radius: 8px;
  font-size: 0.9rem;
}
.container-name { color: var(--blue); font-weight: 600; }
.container-status { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.running { background: var(--green); }
.dot.stopped { background: var(--red); }
.dot.unknown { background: var(--grey); }

/* Links */
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--light-grey);
  border-radius: 10px;
  text-decoration: none;
  color: var(--body-text);
  transition: all 0.2s;
  border: 2px solid transparent;
}
.link-card:hover { border-color: var(--orange); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.link-icon { font-size: 1.5rem; }
.link-info { flex: 1; min-width: 0; }
.link-name { font-weight: 600; color: var(--blue); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-category { font-size: 0.7rem; color: var(--teal); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.link-delete {
  opacity: 0;
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  transition: opacity 0.2s;
}
.link-card:hover .link-delete { opacity: 1; }

/* Add form */
.add-form { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.add-form input { flex: 1; min-width: 120px; padding: 8px 12px; border: 2px solid var(--grey); border-radius: 6px; font-size: 0.85rem; outline: none; }
.add-form input:focus { border-color: var(--orange); }
.btn-small { padding: 8px 16px; border: none; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; background: var(--blue); color: white; transition: background 0.2s; }
.btn-small:hover { background: var(--dark-blue); }
.btn-small.btn-primary { background: var(--orange); }
.btn-small.btn-primary:hover { background: var(--orange-dark); }

@media (max-width: 480px) {
  .login-container { padding: 24px; }
  .dashboard { padding: 12px; }
  .card { padding: 16px; }
  .links-grid { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .nav { padding: 10px 16px; }
}
