:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --text: #1c1c1e;
  --text-secondary: #6c6c70;
  --separator: rgba(60, 60, 67, 0.12);
  --accent: #0a84ff;
  --danger: #ff3b30;
  --success: #30a46c;
  --warning: #ff9500;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --text: #f2f2f7;
    --text-secondary: #8e8e93;
    --separator: rgba(84, 84, 88, 0.55);
    --accent: #0a84ff;
    --danger: #ff453a;
    --success: #32d74b;
    --warning: #ff9f0a;
    --shadow-1: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.35);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 17px;
  line-height: 1.4;
}

/* --- Header --- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--separator);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.app-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.header-user {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Layout --- */
.app-main {
  padding: 20px;
  max-width: 760px;
  margin: 0 auto;
}

.placeholder {
  text-align: center;
  color: var(--text-secondary);
  padding: 60px 20px;
}

/* --- Card --- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 16px;
  margin-bottom: 12px;
}

.card h2 {
  margin: 0 0 8px 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.card h3 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

/* --- Buttons --- */
button, .btn {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

button:hover:not(:disabled) { opacity: 0.85; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

button.secondary {
  background: var(--surface-2);
  color: var(--text);
}

button.danger { background: var(--danger); }

/* --- Inputs --- */
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 17px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* --- List --- */
.list {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.list-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--separator);
  font-size: 15px;
}

.list-row:last-child { border-bottom: none; }

.list-row .right {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 14px;
}

.status-ok { color: var(--success); font-weight: 500; }
.status-ko { color: var(--danger); font-weight: 500; }

/* --- Responsive tweaks --- */
@media (min-width: 768px) {
  .app-main { padding: 32px 24px; }
  .app-header { padding-left: 32px; padding-right: 32px; }
}
