* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #1f2937; }
a { color: #2563eb; }

.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #5b86e5, #36d1dc);
  display: flex;
  justify-content: center;
  align-items: center;
}
.login-card {
  background: #fff;
  padding: 40px;
  width: 380px;
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(0,0,0,.25);
}
.login-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.login-title { font-size: 22px; font-weight: 700; color: #333; }
.login-card input {
  width: 100%; padding: 12px; margin-bottom: 14px; border-radius: 8px; border: 1px solid #ddd; font-size: 14px;
}
.login-card input:focus { outline: none; border-color: #5b86e5; }
button {
  padding: 12px 22px; border: none; border-radius: 8px; background: #2563eb; color: #fff; font-size: 15px; cursor: pointer;
}
button:hover { background: #1d4ed8; }
.login-card button { width: 100%; }
.footer { text-align: center; font-size: 12px; color: #999; margin-top: 15px; }
.error-message { color: #b00020; background: #fff5f6; border: 1px solid #ffd6dc; border-radius: 8px; padding: 10px; margin-bottom: 14px; }
.success-message { color: #006400; margin-bottom: 12px; }

.app-page { background: #f4f7fb; }
.app-header, .admin-header {
  color: #fff; padding: 24px 40px; display: flex; justify-content: space-between; align-items: center;
}
.app-header { background: linear-gradient(135deg, #2563eb, #36d1dc); }
.admin-header { background: #111827; }
.logo { font-size: 26px; font-weight: 700; }
.user-info { font-size: 14px; text-align: right; }
.header-link { color: #fff; text-decoration: none; font-size: 13px; margin-left: 14px; }
.container { padding: 32px 40px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 28px; }
.metric-card, .panel {
  background: #fff; border-radius: 14px; padding: 24px; box-shadow: 0 8px 20px rgba(0,0,0,.06);
}
.card-title { color: #6b7280; font-size: 14px; margin-bottom: 12px; }
.card-value { font-size: 32px; font-weight: 700; color: #2563eb; }
.main-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
h2 { margin-top: 0; }
.panel input { margin-top: 10px; }
.panel button { margin-top: 18px; }
.history-panel { margin-top: 24px; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { border-bottom: 1px solid #e5e7eb; padding: 10px; font-size: 13px; text-align: left; }
th { color: #6b7280; background: #f9fafb; }
.empty { text-align: center; color: #9ca3af; }
.money { font-weight: 700; color: #2563eb; }
.table-scroll { overflow-x: auto; }
.panda { animation: pandaFloat 2.2s ease-in-out infinite; transform-origin: bottom center; }
.panda-login { width: 70px; }
.panda-dashboard { width: 90px; }
.helper-panel { text-align: center; }
@keyframes pandaFloat {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-4px) rotate(-2deg); }
  50% { transform: translateY(0) rotate(1deg); }
  75% { transform: translateY(-3px) rotate(2deg); }
  100% { transform: translateY(0) rotate(0deg); }
}
@media (max-width: 768px) {

  html, body {
    width: 100%;
    overflow-x: hidden;
  }

  .app-page {
    background: #f4f7fb;
  }

  .app-header,
  .admin-header {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .logo {
    font-size: 20px;
    line-height: 1.3;
  }

  .user-info {
    width: 100%;
    text-align: left;
    font-size: 13px;
  }

  .container {
    width: 100%;
    padding: 14px;
  }

  .cards,
  .main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .metric-card,
  .panel {
    width: 100%;
    padding: 18px 14px;
    border-radius: 18px;
  }

  .card-value {
    font-size: 26px;
  }

  h2 {
    font-size: 22px;
    line-height: 1.35;
  }

  p {
    font-size: 14px;
    line-height: 1.6;
  }

  button {
    width: 100%;
    font-size: 16px;
    padding: 14px;
  }

  input,
  select {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
  }

  .login-card {
    width: calc(100vw - 32px);
    padding: 28px 22px;
  }

  .login-header {
    gap: 12px;
  }

  .panda-login {
    width: 58px;
  }

  .panda-dashboard {
    width: 72px;
  }

  .table-scroll {
    width: 100%;
    overflow-x: auto;
  }

  table {
    min-width: 620px;
  }
}
