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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #222;
    background: #f4f6f9;
}

header {
    background: #1a4a7a;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
header h1 { font-size: 18px; font-weight: 600; }
header nav a {
    color: #cde;
    text-decoration: none;
    margin-left: 16px;
    font-size: 13px;
}
header nav a:hover { color: #fff; }

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

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    padding: 24px;
    margin-bottom: 20px;
}
.card h2 { font-size: 16px; margin-bottom: 16px; color: #1a4a7a; border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; }
.card h3 { font-size: 14px; margin: 18px 0 10px; color: #333; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 12px; font-weight: 600; color: #555; }
input[type=text], input[type=email], input[type=number], select, textarea {
    border: 1px solid #d1d5db;
    border-radius: 5px;
    padding: 7px 10px;
    font-size: 13px;
    width: 100%;
    transition: border .2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #1a4a7a;
    box-shadow: 0 0 0 3px rgba(26,74,122,.12);
}
textarea { resize: vertical; min-height: 80px; }
textarea.tall { min-height: 160px; }
textarea.xtall { min-height: 260px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
}
.btn-primary   { background: #1a4a7a; color: #fff; }
.btn-primary:hover { background: #15396b; }
.btn-success   { background: #166534; color: #fff; }
.btn-success:hover { background: #14532d; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover  { background: #b91c1c; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-secondary:hover { background: #4b5563; }
.btn-outline   { background: #fff; color: #1a4a7a; border: 1px solid #1a4a7a; }
.btn-outline:hover { background: #f0f4ff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Dynamic row groups */
.row-group {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 10px;
    background: #fafafa;
    position: relative;
}
.row-group .remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
}
.add-btn-wrap { margin-top: 8px; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: #1a4a7a; color: #fff; padding: 10px 12px; text-align: left; }
tbody td { padding: 9px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
tbody tr:hover { background: #f9fafb; }
tbody tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
}
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-green  { background: #dcfce7; color: #166534; }

/* Upload zone */
.upload-zone {
    border: 2px dashed #94a3b8;
    border-radius: 8px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.drag { border-color: #1a4a7a; background: #f0f4ff; }
.upload-zone p { color: #6b7280; margin-top: 8px; font-size: 13px; }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid #e5e7eb; margin-bottom: 20px; gap: 4px; }
.tab-btn {
    padding: 8px 18px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.tab-btn.active { color: #1a4a7a; border-bottom-color: #1a4a7a; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Inline tag hint */
.hint { font-size: 11px; color: #9ca3af; margin-top: 2px; }

.actions { display: flex; gap: 8px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-header h2 { font-size: 20px; color: #1a4a7a; }
