/* MegaFön Portal */

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

:root {
    --bg: #fafaf8;
    --surface: #fff;
    --border: #e5e3de;
    --border-strong: #c8c5bd;
    --text: #1a1916;
    --text-2: #6b6860;
    --text-3: #9c998f;
    --accent: #E8721C;
    --green: #2D8A4E;
    --blue: #3B7EC9;
    --warn: #C27A1A;
    --err: #C93B3B;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 48px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.hdr-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
}

.hdr-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-3);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.hdr-search:hover {
    border-color: var(--border-strong);
    color: var(--text-2);
}

.hdr-shortcut {
    font-size: 11px;
    color: var(--text-3);
    margin-left: 4px;
}

/* Main */
.main {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    flex: 1;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Tool cards */
.tools {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.tool {
    display: block;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}

.tool:hover {
    border-color: var(--border-strong);
}

.tool-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tool-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
}

.tool-status {
    font-size: 11px;
    font-weight: 500;
    display: none;
}

.tool-status.is-ok {
    display: inline;
    color: var(--green);
}

.tool-status.is-warn {
    display: inline;
    color: var(--warn);
}

.tool-status.is-err {
    display: inline;
    color: var(--err);
}

.tool-data {
    font-size: 28px;
    font-weight: 600;
    font-feature-settings: 'tnum';
    line-height: 1.1;
    margin-bottom: 2px;
}

.tool-sub {
    font-size: 12px;
    color: var(--text-3);
}

/* Split layout */
.split {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 24px;
}

.section-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    margin-bottom: 8px;
}

/* Activity */
.activity-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.activity-empty {
    padding: 32px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-3);
}

.a-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

.a-item:last-child { border-bottom: none; }

.a-item:hover { background: var(--bg); }

.a-source {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-3);
    width: 44px;
    flex-shrink: 0;
}

.a-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.a-time {
    font-size: 11px;
    color: var(--text-3);
    flex-shrink: 0;
}

/* Quick actions */
.qlink {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 6px;
    background: var(--surface);
    transition: border-color 0.15s ease;
}

.qlink:hover {
    border-color: var(--border-strong);
}

/* Footer */
.ftr {
    display: flex;
    gap: 12px;
    padding: 12px 24px;
    font-size: 11px;
    color: var(--text-3);
    border-top: 1px solid var(--border);
}

.ftr a {
    color: var(--text-3);
    text-decoration: none;
}

.ftr a:hover { color: var(--accent); }

/* Command palette */
.cmd {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(26, 25, 22, 0.3);
    border: none;
    padding: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20vh;
}

.cmd[open] { display: flex; }

.cmd-inner {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.cmd-input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    outline: none;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.cmd-input::placeholder { color: var(--text-3); }

.cmd-results { max-height: 240px; overflow-y: auto; }

.cmd-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-3);
}

.cmd-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    text-decoration: none;
    color: inherit;
    font-size: 13px;
}

.cmd-result:hover { background: var(--bg); }

.cmd-result-source {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-3);
    width: 44px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .tools { grid-template-columns: 1fr; }
    .split { grid-template-columns: 1fr; }
}
