* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; background: #f0f2f5; color: #1c1e21; }
.hidden { display: none !important; }

#login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-box {
  background: #fff; padding: 2rem; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08);
  max-width: 360px; width: 100%;
}
.login-box h1 { margin: 0 0 .5rem; font-size: 1.5rem; }
.login-box p { margin: 0 0 1rem; color: #65676b; font-size: 0.95rem; }
.login-box .subtitle { font-size: 1rem; font-weight: 600; color: #1c1e21; margin-bottom: 0.25rem; }
.login-box .login-desc { margin-top: 0; }
.login-box input {
  width: 100%; padding: 12px 14px; border: 1px solid #dddfe2; border-radius: 8px;
  margin-bottom: 12px; font-size: 1rem;
}
.login-box button {
  width: 100%; padding: 12px; background: #0866ff; color: #fff; border: none; border-radius: 8px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
}
.login-box button:hover { background: #0654d4; }
.login-box .hint { font-size: 0.8rem; color: #8a8d91; margin-top: 12px; }

.header {
  background: #fff; padding: 12px 24px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.header h1 { margin: 0; font-size: 1.25rem; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button {
  padding: 8px 14px; border: none; background: #e4e6eb; color: #1c1e21; border-radius: 8px;
  cursor: pointer; font-size: 0.9rem;
}
.tabs button:hover { background: #d8dadf; }
.tabs button.active { background: #0866ff; color: #fff; }
#btn-logout { margin-left: auto; padding: 8px 14px; background: transparent; border: 1px solid #dddfe2; border-radius: 8px; cursor: pointer; }

.content { max-width: 1000px; margin: 0 auto; padding: 24px; }
.tab-panel { display: block; }
.tab-panel h2 { margin: 0 0 16px; font-size: 1.35rem; }
.desc { color: #65676b; margin-bottom: 16px; }
.status { margin: 8px 0; font-size: 0.9rem; }
code { background: #e4e6eb; padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }

.cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.card {
  background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
  min-width: 160px;
}
.card .num { display: block; font-size: 1.75rem; font-weight: 700; color: #0866ff; }

.system-actions {
  background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
  margin-bottom: 20px; max-width: 520px;
}
.system-actions h3 { margin: 0 0 8px; font-size: 1.1rem; }
.system-actions .desc { margin-bottom: 12px; }
.system-actions .actions { margin-top: 8px; }
.system-actions .btn-start { background: #1a7f37; color: #fff; }
.system-actions .btn-start:hover { background: #166534; }
.system-actions .btn-stop { background: #c41e3a; color: #fff; }
.system-actions .btn-stop:hover { background: #a01930; }
.system-actions .btn-restart { background: #e67700; color: #fff; }
.system-actions .btn-restart:hover { background: #c26600; }

.form label { display: block; margin: 12px 0 4px; font-weight: 500; font-size: 0.9rem; }
.form label .optional { font-weight: 400; color: #65676b; font-size: 0.85em; }
.form input[type="text"], .form input[type="password"] {
  width: 100%; max-width: 400px; padding: 10px 12px; border: 1px solid #dddfe2; border-radius: 8px;
}
.form button { margin-top: 16px; padding: 10px 20px; background: #0866ff; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.form button:hover { background: #0654d4; }
.form button:disabled { opacity: 0.7; cursor: not-allowed; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.form-actions button { margin-top: 0; }
#btn-test-trendyol { background: #1a7f37; }
#btn-test-trendyol:hover { background: #166534; }
.status-message { margin-top: 12px; font-size: 0.95rem; min-height: 1.4em; }
.status-message.success { color: #1a7f37; }
.status-message.error { color: #c41e3a; }
#qr-placeholder.error-text { color: #c41e3a; font-size: 0.9rem; }
.form.inline label { display: inline; margin-left: 8px; }

#qr-container {
  background: #fff; padding: 24px; border-radius: 12px; text-align: center; max-width: 320px; margin: 16px 0;
}
#qr-image { max-width: 256px; height: auto; }
#qr-placeholder { color: #65676b; margin: 0; }
.actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.actions button { padding: 10px 18px; border-radius: 8px; border: none; cursor: pointer; font-weight: 500; }
#btn-whatsapp-connect { background: #25d366; color: #fff; }
#btn-whatsapp-disconnect { background: #e4e6eb; color: #1c1e21; }

.toolbar { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; }
.toolbar select { padding: 8px 12px; border-radius: 8px; border: 1px solid #dddfe2; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.orders-table { width: 100%; border-collapse: collapse; }
.orders-table th, .orders-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #e4e6eb; }
.orders-table th { background: #f7f8fa; font-weight: 600; font-size: 0.85rem; }
.orders-table td { font-size: 0.9rem; }
.orders-table .btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 6px; border: none; cursor: pointer; background: #25d366; color: #fff; }
.orders-table .btn-sm:disabled { background: #ccc; cursor: not-allowed; }

#templates-list .template-item {
  background: #fff; padding: 16px; border-radius: 12px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
#templates-list textarea { width: 100%; min-height: 100px; padding: 12px; border: 1px solid #dddfe2; border-radius: 8px; margin-top: 8px; font-family: inherit; }

.hint { font-size: 0.85rem; color: #65676b; margin-top: 8px; }
.info-box { font-size: 0.85rem; color: #1c1e21; background: #e8f4fd; border: 1px solid #b3d9f7; border-radius: 8px; padding: 12px; margin-top: 16px; }
.info-box code { font-size: 0.8em; background: #fff; padding: 2px 6px; }
