/* ── Header ── */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-top: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 16px var(--accent-glow);
    flex-shrink: 0;
}

h1 {
    font-size: clamp(1.2rem, 4vw, 1.55rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.1;
}

h1 span { color: var(--accent); }

.entry-count-badge {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px;
    white-space: nowrap;
}

/* ── Tab navigation ── */
.tab-nav {
    display: flex;
    gap: 2px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    border-radius: 7px;
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 9px 16px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.tab-btn:hover { color: var(--text-dim); }

.tab-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-dim);
}

.tab-btn .tab-count {
    font-family: var(--mono);
    font-size: 0.65rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1px 6px;
}

.tab-btn.active .tab-count {
    background: rgba(0,229,160,0.08);
    border-color: rgba(0,229,160,0.25);
    color: var(--accent);
}

/* ── Color Palette ── */
.palette-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.palette-label {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.palette-swatches {
    display: flex;
    gap: 10px;
    align-items: center;
}

.palette-swatch {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.12);
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
    flex-shrink: 0;
}

.palette-swatch:hover {
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(255,255,255,0.15);
}

.palette-swatch input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
}

/* ── Input card ── */
.input-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-card:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.input-wrap { flex: 1; position: relative; }

input[type="text"], input[type="date"], input[type="time"], input[type="datetime-local"] {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 16px;
    padding: 12px 14px;
    outline: none;
    transition: border-color var(--transition);
    -webkit-appearance: none;
}

input[type="date"], input[type="time"], input[type="datetime-local"] {
    color-scheme: dark;
    cursor: pointer;
}

input[type="text"]::placeholder { color: var(--text-muted); }
input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus { border-color: var(--accent); }

.btn-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-shrink: 0;
}
#procTemplateSelect {
    min-width: 118px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.8rem;
    padding: 0 10px;
    cursor: pointer;
}
#procTemplateSelect:focus { border-color: var(--accent); outline: none; }

.add-btn {
    background: var(--accent);
    color: #0d0f14;
    border: none;
    border-radius: 8px;
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 12px 22px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
    display: flex;
    align-items: center;
    gap: 7px;
}

.add-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.add-btn:active { transform: translateY(0); }

/* ── Custom entry button ── */
.custom-trigger-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 16px;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    position: relative;
}

.custom-trigger-btn:hover {
    border-color: var(--custom);
    color: var(--custom);
    background: var(--custom-dim);
    box-shadow: 0 0 10px rgba(245,166,35,0.2);
}

.custom-trigger-btn.active {
    border-color: var(--custom);
    color: var(--custom);
    background: var(--custom-dim);
}

/* ── Custom entry panel ── */
.custom-panel {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.28s ease, opacity 0.22s ease, margin-top 0.22s ease;
    margin-top: 0;
}

.custom-panel.open {
    max-height: 240px;
    opacity: 1;
    margin-top: 14px;
}

.custom-panel-inner {
    border-top: 1px solid var(--custom-border);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-panel-label {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--custom);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-panel-label::before {
    content: '✦';
    font-size: 9px;
}

.custom-fields {
    display: flex;
    gap: 10px;
}

.custom-fields input[type="date"],
.custom-fields input[type="time"] {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.82rem;
}

.custom-add-btn {
    background: var(--custom-dim);
    color: var(--custom);
    border: 1px solid var(--custom-border);
    border-radius: 8px;
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 18px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    flex-shrink: 0;
}

.custom-add-btn:hover {
    background: rgba(245, 166, 35, 0.18);
    box-shadow: 0 0 12px rgba(245,166,35,0.2);
}

.hint {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ── Section header ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 2px;
}

.section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Import / Export buttons (icon-only) ── */
.icon-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.icon-btn svg { flex-shrink: 0; }

.icon-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 8px var(--accent-dim);
}

/* Clear button */
.clear-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.7rem;
    padding: 4px 8px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    height: 28px;
    display: flex;
    align-items: center;
}

.clear-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-dim);
}

/* Persistence info button */
.info-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.72rem;
    cursor: default;
}

.question-mark {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    flex-shrink: 0;
    font-family: var(--mono);
}

.question-mark:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
}

.tooltip {
    position: fixed;
    width: min(300px, calc(100vw - 24px));
    background: var(--surface2);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.6;
    color: var(--text-dim);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.tooltip p + p { margin-top: 8px; }
.tooltip strong { color: var(--text); }

.tooltip-title {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    font-size: 0.75rem;
}

.tooltip.visible {
    opacity: 1;
    pointer-events: auto;
}

