/* Design system */
:root {
    --font: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    --mono: Consolas, "Courier New", "Lucida Console", monospace;

    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-raised: #fafbfc;
    --border: #e4e7ec;
    --border-strong: #d0d5dd;

    --text: #101828;
    --text-secondary: #667085;
    --text-tertiary: #98a2b3;

    --primary: #101828;
    --primary-hover: #1d2939;
    --focus-ring: rgba(16, 24, 40, 0.12);

    --radius: 10px;
    --radius-sm: 6px;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08);

    --container: 1200px;
    --header-h: 60px;
}

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

html {
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.site-main {
    flex: 1;
    padding: 32px 0 48px;
}

/* Header */
.site-header {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
}

.logo-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.site-nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg);
}

.nav-link.is-active {
    color: var(--text);
    background: var(--bg);
}

/* Page */
.page-header {
    margin-bottom: 24px;
    padding: 0;
    background: none;
    background-image: none;
    border-radius: 0;
    box-shadow: none;
}

.page-header h1 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.page-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

.card + .card {
    margin-top: 16px;
}

.card-body {
    padding: 20px 24px;
}

.card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

.card-toolbar strong {
    color: var(--text);
    font-weight: 600;
}

/* Form */
.form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field-date {
    flex: 0 1 170px;
    width: 170px;
}

.field-grow {
    flex: 1 1 200px;
    min-width: 180px;
}

.field-action {
    flex: 0 0 120px;
    width: 120px;
}

.field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.field input {
    width: 100%;
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    line-height: 1.4;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input[type="date"] {
    line-height: normal;
}

.field input::-webkit-input-placeholder {
    color: var(--text-tertiary);
}

.field input::placeholder {
    color: var(--text-tertiary);
}

.field input:focus {
    outline: none;
    border-color: var(--text-tertiary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Buttons */
.btn {
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    height: 40px;
    padding: 0 16px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    background: var(--surface-raised);
    color: var(--text);
}

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
}

.w-full {
    width: 100%;
}

/* Footer */
.site-footer {
    padding: 20px 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
}

/* Utilities */
.text-muted {
    color: var(--text-tertiary);
}

.tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    .site-main {
        padding: 20px 0 32px;
    }

    .field-date,
    .field-grow,
    .field-action {
        flex: 1 1 100%;
        width: 100%;
    }

    .card-body,
    .card-toolbar {
        padding-left: 16px;
        padding-right: 16px;
    }
}
