:root {
    --sap-shell-bg: #1c2d42;
    --sap-brand-blue: #0070f2;
    --sap-bg-gray: #f4f6f9;
    --sap-text-main: #32363a;
    --sap-border-color: #d9d9d9;
    --sap-tile-bg: #ffffff;
}
* { box-sizing: border-box; }
body {
    margin:0;
    padding:0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:var(--sap-bg-gray);
    color:var(--sap-text-main);
    font-size:14px;
    line-height:1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--sap-brand-blue); text-decoration: none; }
.sap-shellbar { background:var(--sap-shell-bg); color:#fff; height:48px; display:flex; align-items:center; justify-content:space-between; padding:0 16px; box-shadow:0 2px 4px rgba(0,0,0,.1); position: sticky; top: 0; z-index: 10; }
.sap-shellbar-left,.sap-shellbar-right{display:flex;align-items:center;gap:15px}.sap-logo{font-weight:bold;font-size:16px;letter-spacing:1px;border-right:1px solid rgba(255,255,255,.2);padding-right:15px;color:#fff}.sap-system-title{font-size:14px;color:#e5e5e5}.shell-link{color:#fff}.sap-container{padding:24px;max-width:1400px;margin:0 auto}.muted{color:#6a6d70}.sap-tile-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:16px;margin-top:20px}.sap-tile{background:var(--sap-tile-bg);border:1px solid var(--sap-border-color);border-radius:4px;min-height:170px;padding:16px;display:flex;flex-direction:column;justify-content:space-between;cursor:pointer;box-shadow:0 1px 3px rgba(0,0,0,.05);transition:transform .1s,box-shadow .1s;text-decoration:none;color:inherit}.sap-tile:hover{border-color:var(--sap-brand-blue);box-shadow:0 4px 8px rgba(0,0,0,.1);transform:translateY(-2px)}.sap-tile-title{font-size:14px;font-weight:bold;line-height:1.2}.sap-tile-subtitle{font-size:12px;color:#6a6d70;margin-top:4px}.sap-tile-icon{font-size:28px;color:var(--sap-brand-blue);align-self:flex-end}.sap-table-card,.sap-form-card{background:#fff;border:1px solid var(--sap-border-color);border-radius:4px;padding:16px;margin-top:20px}.sap-table{width:100%;border-collapse:collapse;margin-top:12px}.sap-table th{background:#f2f2f2;text-align:left;padding:10px 12px;font-weight:bold;border-bottom:2px solid var(--sap-border-color);font-size:13px}.sap-table td{padding:10px 12px;border-bottom:1px solid var(--sap-border-color);font-size:13px;vertical-align:top}.sap-table tr:hover{background:#f5f9ff}.sap-badge{padding:2px 8px;border-radius:10px;font-size:11px;font-weight:bold;display:inline-block}.sap-badge-success{background:#e1f4e9;color:#1e7e34}.sap-badge-warning{background:#fff3cd;color:#856404}.sap-badge-danger{background:#f8d7da;color:#721c24}.sap-badge-info{background:#d7ecff;color:#005fb8}.sap-btn{border:1px solid var(--sap-brand-blue);background:var(--sap-brand-blue);color:#fff;padding:8px 13px;border-radius:4px;cursor:pointer;font-weight:bold}.sap-btn.secondary{background:#fff;color:var(--sap-brand-blue)}.sap-btn.danger{background:#bb0000;border-color:#bb0000}.sap-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}.sap-field label{display:block;font-weight:bold;margin-bottom:6px}.sap-field input,.sap-field select,.sap-field textarea{width:100%;border:1px solid var(--sap-border-color);border-radius:4px;padding:9px;background:#fff}.sap-actions{display:flex;gap:10px;align-items:center;margin-top:14px}.alert{border:1px solid #badbcc;background:#d1e7dd;color:#0f5132;padding:10px 12px;border-radius:4px;margin:10px 0}.alert.error{border-color:#f5c2c7;background:#f8d7da;color:#842029}.login-panel{max-width:420px;margin:80px auto;background:#fff;border:1px solid var(--sap-border-color);padding:22px;border-radius:4px}.checkbox-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:8px}.checkbox-item{border:1px solid var(--sap-border-color);padding:8px;border-radius:4px;background:#fff}

/* ============================================================
   EPMS Safe UI Refresh
   Non-breaking visual layer only.
   Keeps all existing class names and workflow-related markup.
   ============================================================ */

:root {
    --sap-card-radius: 10px;
    --sap-btn-radius: 8px;
    --sap-shadow-sm: 0 1px 3px rgba(28, 45, 66, 0.08);
    --sap-shadow-md: 0 8px 20px rgba(28, 45, 66, 0.10);
    --sap-soft-blue: #e8f3ff;
    --sap-soft-border: #e5eaf0;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.sap-container {
    padding: 28px;
}

h1,
h2,
h3 {
    letter-spacing: -0.02em;
}

h2 {
    margin: 8px 0 4px;
    font-size: 26px;
    font-weight: 700;
}

h3 {
    font-size: 17px;
    font-weight: 700;
}

.sap-shellbar {
    min-height: 52px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
}

.sap-logo {
    font-size: 17px;
}

.sap-system-title {
    opacity: .95;
}

.shell-link {
    border-radius: 6px;
    padding: 6px 8px;
}

.shell-link:hover {
    background: rgba(255, 255, 255, .12);
}

.sap-tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 18px;
}

.sap-tile {
    min-height: 155px;
    border-radius: var(--sap-card-radius);
    border-color: var(--sap-soft-border);
    box-shadow: var(--sap-shadow-sm);
}

.sap-tile:hover {
    box-shadow: var(--sap-shadow-md);
}

.sap-tile-title {
    font-size: 15px;
}

.sap-tile-subtitle {
    line-height: 1.35;
}

.sap-tile-icon {
    font-size: 30px;
}

.sap-table-card,
.sap-form-card,
.login-panel,
.checkbox-item {
    border-color: var(--sap-soft-border);
    border-radius: var(--sap-card-radius);
    box-shadow: var(--sap-shadow-sm);
}

.sap-table-card,
.sap-form-card {
    padding: 18px;
}

.sap-table-card h3,
.sap-form-card h3 {
    margin-top: 0;
    margin-bottom: 14px;
}

.sap-table {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--sap-soft-border);
    border-radius: 8px;
}

.sap-table th {
    background: #f7f9fb;
    color: #344054;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .035em;
    border-bottom: 1px solid var(--sap-border-color);
    white-space: nowrap;
}

.sap-table td {
    border-bottom: 1px solid #edf1f5;
    vertical-align: middle;
}

.sap-table tbody tr:last-child td {
    border-bottom: 0;
}

.sap-table tr:hover {
    background: #f8fbff;
}

.sap-table td:last-child,
.sap-table th:last-child {
    white-space: nowrap;
}

.sap-actions {
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 18px;
}

.sap-btn,
button.sap-btn,
input[type="submit"].sap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border-radius: var(--sap-btn-radius);
    font-size: 13px;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 112, 242, .16);
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease;
    white-space: nowrap;
}

.sap-btn:hover,
button.sap-btn:hover,
input[type="submit"].sap-btn:hover {
    filter: brightness(.96);
    box-shadow: 0 4px 12px rgba(0, 112, 242, .22);
    transform: translateY(-1px);
}

.sap-btn:active,
button.sap-btn:active,
input[type="submit"].sap-btn:active {
    transform: translateY(0);
}

.sap-btn.secondary:hover {
    background: var(--sap-soft-blue);
}

td .sap-btn,
td button.sap-btn {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 12px;
}

.sap-badge {
    padding: 4px 9px;
    border-radius: 999px;
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
}

.sap-badge-success {
    border-color: #b8dfc2;
}

.sap-badge-warning {
    border-color: #efd899;
}

.sap-badge-danger {
    border-color: #efb6bd;
}

.sap-badge-info {
    border-color: #a9d5ff;
}

.sap-form-grid {
    gap: 16px;
}

.sap-field label {
    color: #344054;
    font-size: 13px;
}

.sap-field input,
.sap-field select,
.sap-field textarea {
    min-height: 38px;
    border-color: #cfd8e3;
    border-radius: 8px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.sap-field textarea {
    min-height: 92px;
    resize: vertical;
}

.sap-field input:focus,
.sap-field select:focus,
.sap-field textarea:focus {
    border-color: var(--sap-brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 112, 242, .14);
}

.sap-field input[readonly],
.sap-field input:disabled,
.sap-field select:disabled,
.sap-field textarea:disabled {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.alert {
    border-radius: 8px;
    font-weight: 600;
}

.login-panel {
    box-shadow: var(--sap-shadow-md);
}

.checkbox-grid {
    gap: 10px;
}

.checkbox-item {
    transition: border-color .15s ease, box-shadow .15s ease;
}

.checkbox-item:hover {
    border-color: #b8d7f5;
    box-shadow: var(--sap-shadow-sm);
}

/* Report tiles added in the reporting hub */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.report-tile {
    border: 1px solid var(--sap-soft-border);
    border-radius: var(--sap-card-radius);
    padding: 16px;
    background: #fff;
    min-height: 115px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--sap-shadow-sm);
}

.report-tile:hover {
    box-shadow: var(--sap-shadow-md);
}

/* Prevent action columns from looking broken on narrow tables */
td[style*="white-space:nowrap"],
.sap-table td:last-child {
    vertical-align: middle;
}

/* Responsive safety */
@media (max-width: 900px) {
    .sap-container {
        padding: 18px;
    }

    .sap-table-card {
        overflow-x: auto;
    }

    .sap-table {
        min-width: 760px;
    }

    .sap-actions {
        align-items: stretch;
    }

    .sap-actions .sap-btn {
        flex: 1 1 auto;
    }

    h2 {
        font-size: 22px;
    }
}

@media (max-width: 640px) {
    .sap-container {
        padding: 14px;
    }

    .sap-form-grid {
        grid-template-columns: 1fr;
    }

    .sap-btn {
        width: 100%;
    }

    .sap-tile-grid {
        grid-template-columns: 1fr;
    }

    .sap-table-card,
    .sap-form-card {
        padding: 14px;
    }
}

/* Print-friendly reports */
@media print {
    .sap-shellbar,
    .sap-actions,
    .sap-btn,
    button {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .sap-table-card,
    .sap-form-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}
