/* KrasoftReport — design language aligned with KrasoftPlatform
   (sticky translucent topbar, Inter, blue-500 primary, oklch-inspired
   neutral palette, rounded-md radii). */

:root {
    --background: #ffffff;
    --foreground: #0a0f1c;
    --muted: #f4f5f8;
    --muted-foreground: #6b7280;
    --border: #e5e7eb;
    --primary: #3b82f6;
    --primary-foreground: #ffffff;
    --primary-hover: #2563eb;
    --accent: #eff6ff;
    --radius: 10px;
    --topbar-height: 0px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--foreground);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1;
}

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

/* Page */
.page-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 20px;
}

.py-4 {
    padding-top: 24px;
    padding-bottom: 24px;
}

/* Report grid */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.report-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.report-card:hover {
    border-color: var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(59, 130, 246, 0.08);
    transform: translateY(-1px);
}

.report-card h3 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
}

.report-path {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Empty state */
.empty-state {
    background: var(--background);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    color: var(--muted-foreground);
}

.empty-state code {
    background: var(--muted);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
}

/* Viewer / Designer / Dashboard hosts */
.viewer-host,
.designer-host,
.dashboard-host {
    width: 100%;
    height: calc(100vh - var(--topbar-height) - 16px);
    margin-top: 0;
    background: var(--background);
}

/* Designer ↔ Viewer toggle.
   Viewer mode: built-in Export/Parameters icons sit at the far-right of the
   dashboard's title bar — anchor our toggle just left of them (right: 90px)
   so the dashboard title (which extends from the left) doesn't get covered.
   Designer mode: no Export icon on the right (designer has its own toolbar),
   so we can hug the edge at right: 16px. */
.dashboard-full {
    position: relative;
}

.dashboard-mode-toggle {
    position: absolute;
    top: 12px;
    right: 90px;
    z-index: 10;
}

.dashboard-mode-toggle.is-designer {
    right: 16px;
}

/* File manager — full-height widget host. */
.file-manager-host {
    height: calc(100vh - var(--topbar-height) - 180px);
    min-height: 480px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
}

.file-manager-breadcrumb {
    margin: -12px 0 16px;
    color: var(--muted-foreground);
    font-size: 13px;
}

.file-manager-breadcrumb code {
    background: var(--muted);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: var(--foreground);
}

/* Excel / Word viewer host — full-height container for SpreadsheetControl
   or RichEdit. */
.file-viewer-host {
    height: calc(100vh - var(--topbar-height) - 180px);
    min-height: 520px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    overflow: hidden;
}

.dashboard-mode-toggle .mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary);
    color: var(--primary-foreground);
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background 0.15s, transform 0.05s;
}

.dashboard-mode-toggle .mode-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.dashboard-mode-toggle .mode-btn:active {
    transform: translateY(1px);
}

/* Dashboard Full — param debug view */
.param-debug {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.param-debug h2 {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 600;
}

.param-debug h3 {
    margin: 24px 0 8px;
    font-size: 14px;
    color: var(--muted-foreground);
    font-weight: 600;
}

.param-debug .note {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 10px 12px;
    border-radius: 6px;
    color: #78350f;
    font-size: 13px;
}

.param-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

.param-table th,
.param-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.param-table th {
    background: var(--muted);
    color: var(--muted-foreground);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.param-table td code {
    background: var(--muted);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.xml-dump {
    background: #0a0f1c;
    color: #cbd5e1;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

.param-debug details {
    margin-top: 16px;
}

.param-debug summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--muted-foreground);
    padding: 6px 0;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 16px 0;
    color: var(--muted-foreground);
    font-size: 12px;
    background: transparent;
}

/* Inter — bundled web font for the KrasoftPlatform look-and-feel. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
