:root {
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --primary: #4f6ef7;
    --primary-hover: #3b5de7;
    --danger: #e74c3c;
    --danger-hover: #c0392b;
    --success: #27ae60;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #e1e5eb;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 460px;
    padding: 60px 20px 40px;
}

.container.wide {
    max-width: 900px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px 32px;
}

.logo {
    text-align: center;
    margin-bottom: 8px;
    font-size: 28px;
}

h1 {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 28px;
}

/* Flash messages */
.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.flash.error {
    background: #fdecea;
    color: #b71c1c;
    border: 1px solid #f5c6cb;
}

.flash.success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #c8e6c9;
}

/* Form */
.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1;
}

.input-group .suffix {
    padding: 10px 14px;
    background: #f0f2f5;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    color: #fff;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--primary);
    width: 100%;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: #f0f2f5; }

.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }

.link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}
.link:hover { text-decoration: underline; }

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    font-size: 13px;
}

/* Admin tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 12px;
}

th {
    text-align: left;
    padding: 10px 12px;
    background: #f8f9fb;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

tr:hover td { background: #f8f9fb; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-red { background: #fdecea; color: #c62828; }
.badge-yellow { background: #fff8e1; color: #f57f17; }

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 28px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.section-title:first-of-type { margin-top: 0; }

.inline-form {
    display: inline;
}

.actions {
    display: flex;
    gap: 6px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.create-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 16px;
    background: #f8f9fb;
    border-radius: 8px;
}

.create-form .form-group {
    margin-bottom: 0;
}

.mono {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 13px;
    background: #f0f2f5;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Done page */
.done-icon {
    font-size: 56px;
    text-align: center;
    margin-bottom: 16px;
}

@media (max-width: 500px) {
    .container { padding: 30px 12px 20px; }
    .card { padding: 24px 18px; }
    .create-form { flex-direction: column; }
}
