:root {
    --color-bg: #f9fafb;
    --color-surface: #ffffff;
    --color-text: #1f2937;
    --color-text-muted: #6b7280;
    --color-primary: #e6a817;
    /* CETNIC Gold */
    --color-primary-dark: #cc920d;
    --color-secondary: #e5e7eb;
    --color-border: #e5e7eb;
    --color-success: #10b981;
    --color-danger: #ef4444;

    --font-main: 'Atkinson Hyperlegible', sans-serif;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

    --radius: 8px;
    --header-height: 60px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: --color-bg;
    color: var(--color-text);
    line-height: 1.5;
    background-color: var(--color-bg);
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header */
.app-header {
    background: var(--color-surface);
    height: var(--header-height);
    border-bottom: 1px solid var(--color-border);
    border-top: 5px solid var(--color-primary);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    margin-right: 3rem;
    color: var(--color-text);
}

.logo-icon {
    color: var(--color-primary);
    font-size: 1.5rem;
}

.app-nav {
    display: flex;
    gap: 1.5rem;
    flex: 1;
}

.nav-link {
    color: var(--color-text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text);
}

.user-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Layout */
.app-content {
    margin-top: var(--header-height);
    padding: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - var(--header-height) - 80px);
    /* footer approx */
}

.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

/* Typography */
h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-text {
    background: transparent;
    color: var(--color-primary);
    padding: 0;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.input,
textarea,
select,
.input-sm {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    margin-bottom: 1rem;
}

.input-sm {
    margin-bottom: 0.5rem;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.status-ok {
    color: var(--color-success);
}

.recent-activity h2 {
    margin-bottom: 1rem;
}

.actions-row {
    display: flex;
    gap: 1rem;
}

/* Search */
.search-bar {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
    margin-bottom: 2rem;
}

.search-bar input {
    margin-bottom: 0;
    flex: 1;
}

.search-result {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    border-radius: var(--radius);
}

.search-result pre {
    white-space: pre-wrap;
    font-family: monospace;
    background: var(--color-bg);
    padding: 1rem;
    border-radius: 4px;
}

/* Register */
.form-card {
    max-width: 500px;
    background: var(--color-surface);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.input-suffix-group {
    display: flex;
    gap: 0.5rem;
}

.input-suffix-group input {
    flex: 2;
}

.input-suffix-group select {
    flex: 1;
}

.info-box {
    background: #eff6ff;
    color: #1e40af;
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Manage */
.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.detail-row:last-child {
    border-bottom: none;
}

.badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.ns-list,
.ds-list {
    list-style: none;
    margin-bottom: 1rem;
}

.ns-list li,
.ds-list li {
    padding: 0.5rem;
    background: var(--color-bg);
    margin-bottom: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875rem;
}

.form-row {
    display: flex;
    gap: 0.5rem;
}

.hidden {
    display: none;
}