/* public/assets/base.css */

:root {
  --wd-bg: #ffffff;
  --wd-primary: #1769c2;   /* blue */
  --wd-primary-soft: #e3f2fd;
  --wd-accent: #ff9800;    /* orange */
  --wd-text: #1e293b;
  --wd-muted: #64748b;
  --wd-border: #e2e8f0;
  --wd-radius-lg: 16px;
  --wd-radius-xl: 24px;
  --wd-shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--wd-bg);
  color: var(--wd-text);
}

body {
  min-height: 100vh;
}

.app-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.app-header-logo {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  box-shadow: var(--wd-shadow-soft);
  object-fit: cover;
}

.app-header-text {
  flex: 1;
}

.app-title {
  margin: 0;
  font-size: 1.6rem;
}

.app-subtitle {
  margin: 4px 0 8px;
  color: var(--wd-muted);
  font-size: 0.95rem;
}

.app-auth {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.app-user-info {
  font-size: 0.85rem;
  color: var(--wd-muted);
}

/* Buttons */

.btn {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--wd-primary);
  color: #fff;
  box-shadow: var(--wd-shadow-soft);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--wd-text);
}

.btn-ghost {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Cards */

.card {
  background: #ffffff;
  border-radius: var(--wd-radius-xl);
  padding: 16px;
  box-shadow: var(--wd-shadow-soft);
  margin-bottom: 16px;
}

/* Tabs */

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--wd-border);
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  color: var(--wd-muted);
}

.tab-btn.active {
  border-color: var(--wd-primary);
  color: var(--wd-primary);
  font-weight: 600;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Forms */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 0.8rem;
  color: var(--wd-muted);
}

.field input,
.field select,
.field textarea {
  border-radius: 12px;
  border: 1px solid var(--wd-border);
  padding: 8px 10px;
  font-size: 0.9rem;
}

.field textarea {
  min-height: 72px;
}

/* Status text */

.status {
  font-size: 0.85rem;
  margin-top: 8px;
  min-height: 1em;
}

.status-ok {
  color: #15803d;
}

.status-error {
  color: #b91c1c;
}

/* Tables */

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  padding: 8px;
  border-bottom: 1px solid var(--wd-border);
  text-align: left;
}

th {
  font-weight: 600;
  background: #f8fafc;
}

/* Chips */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--wd-border);
  font-size: 0.8rem;
  color: var(--wd-muted);
}

/* Back link */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--wd-primary);
}
.back-link span {
  font-size: 1.1rem;
}

/* Responsive tweaks */

@media (max-width: 640px) {
  .app-header {
    flex-direction: row;
    align-items: flex-start;
  }
}