/*
 * EIISYS restrained module theme
 * ------------------------------
 * Presentation only. This stylesheet deliberately does not alter navigation
 * structure, module routing, menu membership, navigator grouping, or business
 * workflows. Each module defines --eis-module-* variables in config/css.php.
 */

:root {
    --eis-module: #0f766e;
    --eis-module-dark: #115e59;
    --eis-module-soft: #ccfbf1;
    --eis-module-rgb: 15, 118, 110;
    --eis-page-bg: #f5f7f9;
    --eis-surface: #ffffff;
    --eis-text: #1f2937;
    --eis-muted: #64748b;
    --eis-border: #dfe5ea;
    --eis-radius: 8px;
    --eis-shadow: 0 2px 8px rgba(15, 23, 42, .07);
}

html { background: var(--eis-page-bg); }
body {
    background: var(--eis-page-bg);
    color: var(--eis-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Keep the legacy W3 navigation and all menu positions exactly as coded. */
.w3-top .w3-bar.w3-teal,
.w3-top > .w3-bar {
    background-color: var(--eis-module) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .16);
}

.w3-top .w3-bar .w3-button {
    transition: background-color .15s ease, color .15s ease;
}

.w3-top .w3-bar .w3-button:hover,
.w3-top .w3-dropdown-hover:hover > .w3-button,
.w3-top .w3-dropdown-hover:hover > a.w3-button {
    background-color: var(--eis-module-dark) !important;
    color: #fff !important;
}

.w3-dropdown-content {
    border: 1px solid var(--eis-border);
    border-top: 3px solid var(--eis-module);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .14) !important;
    overflow: hidden;
}

.w3-dropdown-content .w3-bar-item {
    color: #263238 !important;
}

.w3-dropdown-content .w3-bar-item:hover {
    background: var(--eis-module-soft) !important;
    color: var(--eis-module-dark) !important;
}

/* Existing W3 cards/panels get polish without changing their dimensions/layout. */
.w3-card,
.w3-card-2,
.w3-card-4 {
    border-radius: var(--eis-radius);
    box-shadow: var(--eis-shadow) !important;
}

.w3-white.w3-card,
.w3-white.w3-card-2,
.w3-white.w3-card-4 {
    border: 1px solid var(--eis-border);
}

.w3-panel,
.w3-container {
    scrollbar-color: #cbd5e1 transparent;
}

/* Forms stay familiar, just clearer and more consistent. */
.w3-input,
.w3-select {
    border-radius: 5px;
    border-color: #cbd5e1 !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.w3-input:focus,
.w3-select:focus {
    border-color: var(--eis-module) !important;
    box-shadow: 0 0 0 2px rgba(var(--eis-module-rgb), .12);
    outline: none;
}

button.w3-button,
a.w3-button,
input.w3-button {
    border-radius: 5px;
}

.w3-button.w3-teal,
.w3-teal.w3-button,
button.w3-teal,
a.w3-teal {
    background-color: var(--eis-module) !important;
}

.w3-button.w3-teal:hover,
.w3-teal.w3-button:hover,
button.w3-teal:hover,
a.w3-teal:hover {
    background-color: var(--eis-module-dark) !important;
}

/* Module accent is available to modern navigator tiles already present in EIISYS. */
.tile-btn:hover,
.action-btn:hover {
    border-color: rgba(var(--eis-module-rgb), .28) !important;
}

.tile-icon,
.w3-text-teal {
    color: var(--eis-module) !important;
}

.w3-border-teal {
    border-color: var(--eis-module) !important;
}

/* Tables retain all existing columns, controls and DataTables behavior. */
.w3-table-all,
.w3-table,
table.dataTable {
    background: var(--eis-surface);
}

.w3-table-all {
    border-color: var(--eis-border) !important;
}

.w3-table-all thead th,
.w3-table thead th,
table.dataTable thead th {
    color: #334155;
}

/* Footer remains in its original place and structure. */
.footer {
    border-top: 1px solid var(--eis-border);
    color: var(--eis-muted);
}

/* Small screens: do not introduce a new navigation system; improve only spacing. */
@media (max-width: 600px) {
    .w3-content {
        margin-left: 8px !important;
        margin-right: 8px !important;
    }
}

@media print {
    .w3-top { box-shadow: none !important; }
}
