:root { --bg:#f7f8fb; --panel:#fff; --text:#172033; --muted:#64748b; --line:#e2e8f0; --primary:#2563eb; --danger:#dc2626; --success:#16a34a; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font-family:Arial, Helvetica, sans-serif; }
a { color:inherit; text-decoration:none; }
.topbar { height:64px; display:flex; align-items:center; justify-content:space-between; gap:24px; padding:0 28px; background:#0f172a; color:#fff; }
.topbar-left, .topbar-right { display:flex; align-items:center; gap:24px; height: 100%; }
.topbar-right { gap: 0; }
.brand { font-size:20px; font-weight:700; }
.brand-logo {
    display: flex;
    align-items: center;
    height: 100%;
    max-height: 100%;
}
.brand-logo img {
    height: auto;
    max-height: 100%;
    width: auto;
    display: block;
    object-fit: contain;
}
.topnav { display:flex; align-items:center; gap:0; margin-left:6px; }
.topnav a { color:#e2e8f0; font-weight:700; padding:8px 12px; line-height:1; border-radius:6px; }
.topnav a:hover { color:#ffffff; background:rgba(255,255,255,.08); text-decoration:none; }
.topnav .sep { color:#7c8aa0; margin:0 14px; font-weight:700; }
.container { padding:28px; max-width:1500px; margin:0 auto; }
h1 { margin:0 0 8px; font-size:28px; }
code { background:#eef2ff; color:#3730a3; padding:3px 7px; border-radius:8px; }
.muted { color:var(--muted); margin-top:8px; }
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px,1fr)); gap:20px; margin-top:24px; }
.card { 
  display:flex; 
  flex-direction:column; 
  gap:12px; 
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid transparent;
  background-clip: padding-box, border-box;
  background-image: 
    linear-gradient(135deg, #ffffff 0%, #f8fafc 100%),
    linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
  background-origin: padding-box, border-box;
  border-radius:18px; 
  padding:24px; 
  box-shadow: 0 10px 30px rgba(15,23,42,0.08), inset 0 1px 2px rgba(255,255,255,0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #f59e0b);
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.card:hover { 
  box-shadow: 0 20px 40px rgba(15,23,42,0.12), inset 0 1px 2px rgba(255,255,255,0.6);
  transform: translateY(-4px);
  background-image: 
    linear-gradient(135deg, #ffffff 0%, #f8fafc 100%),
    linear-gradient(135deg, #3b82f6 0%, #8b5cf6 33%, #ec4899 66%, #f59e0b 100%);
}

.card:hover::before {
  opacity: 1;
}

.card strong {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.card strong span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #eef2ff 0%, #f3e8ff 100%);
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.card code { 
  background: linear-gradient(135deg, #eef2ff 0%, #f3e8ff 100%);
  color: #3730a3; 
  padding: 4px 10px; 
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  width: fit-content;
}

.card span {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin-top: 4px;
}
.flow { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.flow .chip { display:inline-flex; align-items:center; padding:6px 10px; border:1px solid var(--line); border-radius:999px; background:#f8fafc; color:#0f172a; font-weight:700; font-size:13px; }
.flow .sep { color:#64748b; font-weight:700; margin:0 6px; }
.flow.minor { margin-top:6px; gap:10px; }
.flow .dot { color:#94a3b8; margin:0 2px; }
.page-head { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; margin-bottom:20px; }
.actions, .form-actions { display:flex; gap:10px; align-items:center; }
.btn { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:9px 14px; border:0; border-radius:10px; background:var(--primary); color:#fff; font-weight:700; cursor:pointer; }
.btn.secondary { background:#e2e8f0; color:#0f172a; }
.alert { padding:12px 14px; border-radius:12px; margin:14px 0; border:1px solid transparent; }
.alert.success { background:#dcfce7; border-color:#86efac; color:#14532d; }
.alert.error { background:#fee2e2; border-color:#fecaca; color:#7f1d1d; }
.table-wrap { overflow:auto; background:var(--panel); border:1px solid var(--line); border-radius:14px; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th, td { padding:10px 12px; border-bottom:1px solid var(--line); text-align:left; white-space:nowrap; max-width:360px; overflow:hidden; text-overflow:ellipsis; }
th { background:#f1f5f9; position:sticky; top:0; z-index:1; }
.row-actions { display:flex; gap:10px; align-items:center; }
.row-actions form { display:inline; }
.link { border:0; background:transparent; padding:0; color:var(--primary); cursor:pointer; font-weight:700; }
.link.danger { color:var(--danger); }
.form-card { max-width:920px; background:var(--panel); border:1px solid var(--line); border-radius:18px; padding:22px; box-shadow:0 8px 24px rgba(15,23,42,.05); }
.field { display:grid; grid-template-columns:260px 1fr; gap:10px 16px; align-items:start; padding:12px 0; border-bottom:1px solid var(--line); }
.field label { font-weight:700; padding-top:9px; }
.field input, .field select, .field textarea { width:100%; padding:10px 12px; border:1px solid #cbd5e1; border-radius:10px; font-size:14px; background:#fff; }
.field small { grid-column:2; color:var(--muted); }
.required { color:var(--danger); }
.form-actions { margin-top:20px; }
.login-form .form-actions {
    width: 100%;
}
.login-form .form-actions .btn {
    width: 100%;
    min-height: 44px;
}
@media (max-width: 800px) { .page-head { flex-direction:column; } .field { grid-template-columns:1fr; } .field small { grid-column:1; } }

.login-page {
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 40px 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 36px 30px;
    box-shadow: 0 24px 40px rgba(15, 23, 42, 0.09);
    text-align: center;
    margin: auto 0;
}

.login-brand img {
    max-width: 320px;
    width: auto;
    max-height: 160px;
    display: block;
    margin: 0 auto 32px;
}

.login-card h1 {
    display: none;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form .form-field {
    display: grid;
    gap: 8px;
    text-align: left;
}

.login-form .form-field label {
    font-weight: 700;
}

.login-form .form-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
}

.login-form .remember-me {
    align-items: center;
    margin-top: 8px;
}

.login-form .remember-me input {
    width: auto;
    margin-right: 10px;
}

.login-links {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.login-links a {
    color: var(--primary);
    font-weight: 700;
}

.login-links a:hover {
    text-decoration: underline;
}

.login-footer {
    width: 100%;
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--line);
    margin-top: auto;
}
