:root {
  --brand-primary:       #13377F;
  --brand-primary-light: #2453A6;
  --brand-secondary:     #FF5C39;
  --brand-green:         #20A94C;
  --bg-page:             #f6f8fb;
  --bg-card:             #ffffff;
  --text-heading:        #13377F;
  --text-body:           #1f2937;
  --text-muted:          #64748b;
  --border:              #e5e9f0;
  --border-strong:       #cbd5e0;
  --shadow-md:           0 4px 14px rgba(19, 55, 127, 0.10);
  --shadow-lg:           0 12px 32px -12px rgba(19, 55, 127, 0.22);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-body);
  background:
    radial-gradient(circle at 80% -20%, rgba(36,83,166,0.12) 0%, rgba(255,255,255,0) 50%),
    radial-gradient(circle at -10% 110%, rgba(255,92,57,0.10) 0%, rgba(255,255,255,0) 60%),
    var(--bg-page);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--text-heading); margin: 0 0 .4em; font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--brand-primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Shared centered layout for login + projects */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.shell-header {
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.shell-header .brand {
  font-family: 'Exo 2', system-ui, sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--brand-primary);
  letter-spacing: .02em;
}
.shell-header .brand small {
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 8px;
  letter-spacing: 0;
}
.shell-header .user-box {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
}
.shell-header .user-box .who { color: var(--text-muted); }
.shell-main {
  flex: 1;
  padding: 40px 24px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow-md);
}

/* Forms */
.form-field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 18px;
}
.form-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.form-field input[type=text],
.form-field input[type=email],
.form-field input[type=password] {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 140ms, box-shadow 140ms;
}
.form-field input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(19, 55, 127, 0.14);
}
.form-field .hint {
  font-size: 11px; color: var(--text-muted);
}

/* Buttons */
.btn {
  font: inherit; font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 140ms, transform 140ms;
}
.btn-primary {
  background: var(--brand-primary); color: #fff;
}
.btn-primary:hover { background: var(--brand-primary-light); }
.btn-ghost {
  background: transparent; color: var(--brand-primary);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: #f1f4fa; }
.btn-danger-mini {
  font: inherit; font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 999px;
  cursor: pointer;
}
.btn-danger-mini:hover { background: #fee2e2; }

/* Login */
.login-wrap {
  max-width: 420px;
  margin: 10vh auto 0;
}
.login-wrap h1 {
  font-family: 'Exo 2', system-ui, sans-serif;
  font-size: 26px; margin-bottom: 6px;
}
.login-wrap .subtitle {
  color: var(--text-muted);
  margin-bottom: 26px;
}
.login-error {
  background: #fee2e2;
  color: #991b1b;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}

/* Projects */
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px; gap: 16px; flex-wrap: wrap;
}
.section-title h1 {
  font-family: 'Exo 2', system-ui, sans-serif;
  font-size: 26px; margin: 0;
}
.section-title .count {
  color: var(--text-muted); font-size: 13px;
}

.proj-list {
  list-style: none; padding: 0; margin: 0 0 30px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.proj-item {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-secondary);
  border-radius: var(--radius-md);
  transition: box-shadow 160ms, transform 160ms, border-color 160ms;
}
.proj-item:hover {
  box-shadow: var(--shadow-lg);
  border-left-color: var(--brand-primary);
  transform: translateY(-1px);
}
.proj-link {
  display: block;
  padding: 16px 16px 14px;
  color: inherit;
  text-decoration: none;
}
.proj-link:hover { text-decoration: none; }
.proj-title {
  font-weight: 700;
  color: var(--brand-primary);
  font-size: 16px;
  margin-bottom: 4px;
  line-height: 1.25;
}
.proj-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 12px; color: var(--text-muted);
}
.proj-client { color: var(--text-body); font-weight: 600; }
.proj-slug {
  font-family: ui-monospace, monospace;
  padding: 1px 6px;
  background: #f1f4fa;
  border-radius: 4px;
}
.proj-item > form {
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  margin-bottom: 24px;
}
.empty-state strong { color: var(--brand-primary); }

/* New project form */
.new-project-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-md);
}
.new-project-card h2 {
  font-family: 'Exo 2', system-ui, sans-serif;
  font-size: 18px; margin: 0 0 6px;
}
.new-project-card .desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.new-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.new-project-actions {
  display: flex; gap: 10px;
  margin-top: 18px;
}

/* Admin / user chips */
.admin-chip, .user-chip {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-left: 4px;
}
.admin-chip { background: var(--brand-secondary); color: #fff; }
.user-chip  { background: #eef2f7; color: var(--text-muted); }

/* Info banner */
.info-banner {
  background: #d1fae5;
  color: #065f46;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}

/* Users table */
.users-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
.users-table th, .users-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
.users-table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 11px;
}
.users-table tr.is-me td { background: #fafbfc; }
.users-table .muted { color: var(--text-muted); font-size: 12px; }
.users-table .row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.users-table .row-actions form { display: inline; margin: 0; }
.users-table .hint { font-size: 11px; color: var(--text-muted); font-style: italic; }

/* Mini button for table rows */
.btn-mini {
  font: inherit; font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  background: #fff;
  color: var(--brand-primary);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-mini:hover { background: #f1f4fa; text-decoration: none; }

/* Project card actions (View / Move / Duplicate / Delete). Sit below
   the title in their own row so they never overlap the project name
   no matter how many buttons the row has. */
.proj-item { display: flex; flex-direction: column; }
.proj-item .proj-link { flex: 1 1 auto; }
.proj-item .proj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
  background: #fafbfd;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}
.proj-item .proj-actions form { margin: 0; }
.proj-owner {
  font-style: italic;
  color: var(--text-muted);
}
