:root {
    --color-primary: #d42f00;
    --color-primary-600: #bb2a00;
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-muted: #6b7280;
    --color-border: #e5e7eb;
    --radius: 10px;
    --shadow: 0 6px 20px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji';
    color: var(--color-text);
    background: var(--color-bg);
}

img { max-width: 100%; height: auto; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

.container {
    max-width: 1280px;
    margin: 24px auto;
    padding: 0 16px;
}

.navbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}
.hero { padding: 0; }
.hero .container { padding-top: 28px; padding-bottom: 28px; }
.hero h1 { color: #fff; }
.hero .btn { border-color: #fff; }
.hero .btn.btn-primary { background: #fff; color: var(--color-primary); }

.navbar .brand {
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.3px;
}
.navbar a {
    color: var(--color-text);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
}
.navbar a:hover { background: #f9fafb; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
}
.btn:hover { box-shadow: var(--shadow); }
.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-600); }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    display: block; /* allow full-card anchor */
    text-decoration: none; /* no underline on card link */
    color: inherit; /* keep text color consistent */
}
.card h1, .card h2, .card h3 { margin: 0 0 8px 0; }
.muted { color: var(--color-muted); }

.alert { background: #fff7ed; border-left: 4px solid var(--color-primary); padding: 10px 12px; border-radius: 8px; }

.form {
    display: grid;
    gap: 12px;
    max-width: 560px;
}
.form .form-row { display: grid; gap: 6px; }
.form label { font-weight: 600; }
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="url"],
.form select,
.form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    outline: none;
}
.form textarea { min-height: 110px; }

.avatar {
    border-radius: 50%;
    object-fit: cover;
}
.avatar.sm { width: 24px; height: 24px; }
.avatar.md { width: 48px; height: 48px; }
.avatar.lg { width: 64px; height: 64px; }

.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; }
.badge.premium { background: #fcdcdc; color: #d42f00; border: 1px solid #d42f00; }

.list { list-style: none; padding: 0; margin: 0; }
.list .item { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 12px; background: #fff; box-shadow: var(--shadow); }
.list .item + .item { margin-top: 12px; }

/* table */
table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: middle; }
thead th { background: #f9fafb; }

.header-flex { display:flex; align-items:center; gap:12px; }
.space-between { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }

/* table actions alignment */
.table-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-actions form { margin: 0; }
.table-actions .btn { white-space: nowrap; }

/* responsive tweaks */
@media (max-width: 960px) {
    .navbar { flex-wrap: wrap; }
    .header-flex { flex-wrap: wrap; }
}

@media (max-width: 860px) {
    /* allow horizontal scroll for wide tables */
    table { display: block; overflow-x: auto; }
    .table-actions { flex-direction: column; align-items: stretch; }
    .table-actions .btn { width: 100%; }
}

@media (max-width: 540px) {
    .avatar.lg { width: 48px; height: 48px; }
    .container { padding: 0 12px; }
    .form { max-width: 100%; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    .btn { padding: 9px 12px; }
    .badge { font-size: 11px; padding: 3px 7px; }
}
