/* Shared application theme. Keep vendor geometry (grids, schedules, virtual rows)
   intact: this layer changes surfaces and colours, not widget measurements. */
.tmt-theme {
    --tmt-accent: #dc3545;
    --tmt-accent-hover: #bb2d3b;
    --tmt-accent-soft: #fcebed;
    --tmt-background: #f5f6fa;
    --tmt-surface: #fff;
    --tmt-border: #e7e9ee;
    --tmt-text: #253047;
    --tmt-muted: #687386;
    --tmt-radius: 14px;
    --bs-primary: #dc3545;
    --bs-primary-rgb: 220, 53, 69;
    color: var(--tmt-text);
    background: var(--tmt-background);
}

.tmt-theme .main { background: var(--tmt-background); min-width: 0; }
.tmt-theme .tmt-page-container { width: 100%; padding: 0; margin: 0; }
.tmt-theme .navbar { background: var(--tmt-surface); border-bottom: 1px solid var(--tmt-border); box-shadow: 0 2px 10px rgba(25, 38, 60, .03); }
.tmt-theme .card {
    border: 1px solid var(--tmt-border);
    border-radius: var(--tmt-radius);
    box-shadow: 0 4px 20px rgba(25, 38, 60, .03);
}
.tmt-theme .card > .card-header {
    background: transparent;
    border-bottom: 1px solid var(--tmt-border);
    border-radius: var(--tmt-radius) var(--tmt-radius) 0 0;
}
/* Legacy screens position charts and forms relative to the original card spacing.
   Preserve their padding and inline margins; layout changes belong to each view. */
.tmt-theme .card > .card-footer { background: #f8f9fc; border-top: 1px solid var(--tmt-border); border-radius: 0 0 var(--tmt-radius) var(--tmt-radius); }
.tmt-theme .card-title { color: var(--tmt-text); font-weight: 600; }
.tmt-theme .breadcrumb-tmt { background: transparent; color: var(--tmt-muted); }
.tmt-theme .control-label, .tmt-theme .form-label { color: var(--tmt-muted); font-weight: 600; }
.tmt-theme .form-control, .tmt-theme .form-select { border-color: var(--tmt-border); border-radius: 8px; }
.tmt-theme .form-control:focus, .tmt-theme .form-select:focus { border-color: var(--tmt-accent); box-shadow: 0 0 0 3px rgba(220, 53, 69, .12); }
.tmt-theme .btn { border-radius: 8px; }
.tmt-theme .btn-primary, .tmt-theme .e-btn.e-primary:not(.e-flat):not(.e-outline) {
    color: #fff;
    background: var(--tmt-accent);
    border-color: var(--tmt-accent);
}
.tmt-theme .btn-primary:hover, .tmt-theme .btn-primary:active,
.tmt-theme .e-btn.e-primary:not(.e-flat):not(.e-outline):hover {
    color: #fff;
    background: var(--tmt-accent-hover);
    border-color: var(--tmt-accent-hover);
}
.tmt-theme .btn-outline-primary { color: var(--tmt-accent); border-color: var(--tmt-accent); }
.tmt-theme .btn-outline-primary:hover { color: #fff; background: var(--tmt-accent); }
.tmt-theme .btn-link, .tmt-theme .e-btn.e-primary.e-flat, .tmt-theme .e-btn.e-primary.e-outline { color: var(--tmt-accent); }
.tmt-theme .btn:focus-visible { outline: 3px solid var(--tmt-accent); outline-offset: 3px; box-shadow: none; }
.tmt-theme .nav-pills .nav-link.active, .tmt-theme .nav-pills .show > .nav-link { background: var(--tmt-accent); color: #fff; border-radius: 8px; }
.tmt-theme .dropdown-menu { border: 1px solid var(--tmt-border); border-radius: 9px; padding: 6px; box-shadow: 0 8px 28px rgba(25, 38, 60, .12); }
.tmt-theme .dropdown-item { border-radius: 5px; }
.tmt-theme .dropdown-item:hover, .tmt-theme .dropdown-item:focus { background: #f5f6f9; }
.tmt-theme .dropdown-item.active, .tmt-theme .dropdown-item:active { background: var(--tmt-accent); color: #fff; }
.tmt-theme .e-grid { border-color: var(--tmt-border); border-radius: 8px; }
.tmt-theme .e-grid .e-gridheader, .tmt-theme .e-grid .e-headercell { background: #f8f9fc; color: var(--tmt-text); border-color: var(--tmt-border); }
.tmt-theme .e-grid .e-toolbar { background: #fff; border-color: var(--tmt-border); }
.tmt-theme .e-grid .e-rowcell { border-color: var(--tmt-border); }
.tmt-theme .e-dialog, .tmt-theme .modal-content { border: 1px solid var(--tmt-border); border-radius: var(--tmt-radius); box-shadow: 0 16px 48px rgba(25, 38, 60, .16); }
.tmt-theme .e-dialog .e-dlg-header-content, .tmt-theme .modal-header { border-bottom: 1px solid var(--tmt-border); }
.tmt-theme .e-dialog .e-footer-content, .tmt-theme .modal-footer { border-top: 1px solid var(--tmt-border); }
.tmt-theme .e-toast { border-radius: 10px; }
/* The application container now owns the outer spacing, including the Wiki. */
.tmt-theme .wiki-shell { --wiki-border: var(--tmt-border); --wiki-muted: var(--tmt-muted); padding: 0; }

@media print {
    .tmt-theme, .tmt-theme .main { background: #fff; }
    .tmt-theme .content { padding: 0; }
    .tmt-theme .card { box-shadow: none; }
}
