/* ---- Base ---- */
* { box-sizing: border-box; }

body{
    font-family: Arial, sans-serif;
    background: #f3f5f7;
    color: #333;
    margin: 0;
}

/* ---- Layout ---- */
.site-header{
    background: #dbe7f1;
    color: #1f3347;
    padding: 12px 24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom: 18px;
}

.site-title{
    margin:0;
    font-size:20px;
    font-weight:bold;
    margin-right:20px;
}

.site-title a,
.site-title a:visited{
    color:#1f3347;
    text-decoration:none;
    font-weight:inherit;
}

.site-title a:hover{ text-decoration: underline; }

.site-title-link{ color:#1f3347; text-decoration:none; }
.site-title-link:hover{ text-decoration: underline; }

.nav-links{
    display:flex;
    gap:18px;
}

.nav-links a{
    color:#1f3347;
    text-decoration:none;
    margin-left:16px;
    font-size:14px;
}
.nav-links a:hover{ text-decoration: underline; }

.page{
    max-width:1100px;
    width:100%;
    margin:20px auto;
    padding:0 20px;
}

.page.wide{
    max-width:1600px;
    width:100%;
}

.page-title{
    margin-top:0;
    color:#6A7F94;
}

.header-row{
    display:flex;
    align-items:center;
    width:100%;
}

.header-user{
    margin-left:auto;
    font-size:14px;
    white-space:nowrap;
    display:flex;
    align-items:center;
    gap:10px;
}

.logged-user{
    color:#1f3347;
}

.site-logo-link{
    display:inline-flex;
    align-items:center;
    text-decoration:none;
}

.site-logo{
    height:32px;
    width:auto;
    display:block;
}

/* ---- Cards ---- */
.card{
    background:#fff;
    border-radius:8px;
    padding:20px;
    box-shadow:0 2px 6px rgba(0,0,0,0.08);
    border-left:5px solid #6A7F94;
    margin-bottom:20px;
}

/* ---- Forms ---- */
form{ margin-top:10px; }

.form-group{ margin-bottom:12px; }

.form-group label{
    display:block;
    font-weight:bold;
    color:#6A7F94;
    margin-bottom:4px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"]{
    width:100%;
    padding:8px;
    border-radius:4px;
    border:1px solid #6A7F94;
    outline:none;
    background:#fdfefe;
}

.form-group input:focus{ border-color:#4f6070; }

.form-group textarea{
    width:100%;
    padding:8px;
    border-radius:4px;
    border:1px solid #6A7F94;
    outline:none;
    background:#fdfefe;
    resize:vertical;
}

/* ---- Buttons ---- */
.btn{
    display:inline-block;
    padding:9px 18px;
    border-radius:4px;
    border:none;
    cursor:pointer;
    font-size:14px;
    text-decoration:none;
    text-align:center;
}

.btn-primary{ background-color:#6A7F94; color:#fff; }
.btn-primary:hover{ background-color:#5b6e81; }

.btn-secondary{
    background-color:transparent;
    color:#6A7F94;
    border:1px solid #6A7F94;
}
.btn-secondary:hover{ background-color:#e2e7ec; }

/* ---- Flash ---- */
.flash-messages{ margin-bottom:15px; }
.flash{
    padding:8px 12px;
    border-radius:4px;
    font-size:14px;
    margin-bottom:6px;
}
.flash-info{ background:#e3edf7; border:1px solid #6A7F94; color:#284155; }
.flash-success{ background:#e4f4e7; border:1px solid #4caf50; color:#256029; }
.flash-warning{ background:#fff8e1; border:1px solid #ffb300; color:#8a6d1f; }
.flash-danger{ background:#ffebee; border:1px solid #e53935; color:#b71c1c; }

/* ---- Tables ---- */
.table{
    width:100%;
    border-collapse:collapse;
    margin-top:10px;
    font-size:14px;
}

.table th,
.table td{
    border-bottom:1px solid #dde2e7;
    padding:8px;
    text-align:left;
}

.table th{
    background:#e3e7ec;
    color:#333;
}

/* ---- Helpers ---- */
.text-muted{ color:#777; font-size:13px; }

.link{ color:#6A7F94; text-decoration:none; }
.link:hover{ text-decoration: underline; }

/* ---- Home tiles ---- */
.tile-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap:16px;
    margin-top:10px;
}

.tile-link{ text-decoration:none; color:inherit; }

.tile{
    background:#ffffff;
    border-radius:10px;
    padding:18px;
    box-shadow:0 2px 6px rgba(0,0,0,0.08);
    border-top:5px solid #6A7F94;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    min-height:130px;
    transition:transform 0.1s ease, box-shadow 0.1s ease;
}

.tile:hover{
    transform:translateY(-2px);
    box-shadow:0 4px 10px rgba(0,0,0,0.12);
}

.tile-title{
    margin:0 0 6px 0;
    font-size:18px;
    color:#364554;
}

.tile-subtitle{ margin:0; font-size:13px; color:#777; }

.tile-disabled{
    opacity:0.45;
    cursor:not-allowed;
    border-top:5px solid #b7c3cd;
}
.tile-disabled:hover{ transform:none; box-shadow:none; }

@media (max-width: 900px){
    .page,
    .page.wide{
        max-width:100%;
        margin:16px auto;
        padding:0 12px;
    }
}

/* ---- GID helpers ---- */
.gid-grid-2{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
}
@media (max-width: 900px){
    .gid-grid-2{ grid-template-columns:1fr; }
}

/* ---- Scroll areas ---- */
.table-scroll{
    max-height:320px;
    overflow-y:auto;
}
.table-scroll-5{
    max-height:190px;
    overflow-y:auto;
}

/* projects grid */
.project-grid{
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:8px;
}
.project-item{
    display:block;
    padding:6px 8px;
    border:1px solid #dde2e7;
    border-radius:6px;
    background:#fff;
    text-decoration:none;
    color:inherit;
    font-size:14px;
}
.project-item:hover{ background:#e3edf7; }

@media (max-width: 900px){
    .project-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
    .project-grid{ grid-template-columns:1fr; }
}

/* Selected badge */
.gid-selected{
    display:inline-block;
    padding:2px 8px;
    border-radius:6px;
    background:#e3edf7;
    color:#0b3a6f;
    font-weight:600;
}
.gid-selected.active{
    background:#cfe3ff;
    border:1px solid #8bb6ff;
}

/* Clear buttons */
.btn-clear-active{
    background:#ffe9e9;
    border-color:#ff9a9a;
    color:#7a0000;
}
.btn-clear-active:hover{ background:#ffd3d3; }

/* ---- Modal ---- */
.modal-backdrop{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.35);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px;
    z-index:9999;
}

.modal{
    background:#fff;
    border-radius:12px;
    max-width:960px;
    width:100%;
    max-height:85vh;
    overflow:auto;
    box-shadow:0 8px 24px rgba(0,0,0,0.2);
    border-left:5px solid #6A7F94;
    padding:16px;
}

.modal-close-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:10px;
}

.modal-title{
    margin:0;
    color:#6A7F94;
}

/* ---- GID right pane layout (fixed order) ---- */
.gid-layout{
    display:grid;
    grid-template-columns:minmax(0, 1fr) 300px;
    gap:16px;
    align-items:start;
    grid-template-areas:"main right";
}

.gid-main{ min-width:0; grid-area:main; }
.gid-right{ grid-area:right; position:relative; }
.gid-right-inner{ position:sticky; top:12px; display:flex; flex-direction:column; gap:12px; }

@media (max-width: 1100px){
    .gid-layout{
        grid-template-columns:1fr;
        grid-template-areas:
            "main"
            "right";
    }
    .gid-right-inner{ position:static; }
}

/* Wide pump table usability */
#panel-pumps .table{ min-width:980px; }
#panel-pumps .table-scroll{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

/* ---- Dashboard widget ---- */
.gid-widget{ border-left:5px solid #0b3a6f; }

.gid-side-title{
    font-size:14px;
    font-weight:700;
    color:#364554;
    margin-bottom:2px;
}

.gid-side-subtitle{
    font-size:12px;
    color:#8a96a3;
    margin-bottom:10px;
}

.gid-total-number{
    font-size:36px;
    font-weight:800;
    color:#0b3a6f;
    line-height:1;
}

.gid-total-label{
    font-size:13px;
    color:#6b7785;
    margin-top:4px;
    margin-bottom:12px;
}

/* KPI list */
.gid-kpi-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.gid-kpi{
    padding:10px;
    border-radius:10px;
    background:#f7f9fb;
    border:1px solid #e3e7ec;
}

.gid-kpi-top{
    display:grid;
    grid-template-columns: 1fr auto;
    gap:10px;
    align-items:baseline;
    margin-bottom:6px;
}

.gid-kpi-label{
    font-size:13px;
    font-weight:600;
    color:#364554;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.gid-kpi-value{
    font-size:13px;
    font-weight:700;
    color:#0b3a6f;
}

.gid-kpi-bar{
    height:6px;
    background:#e3e7ec;
    border-radius:999px;
    overflow:hidden;
}

.gid-kpi-fill{
    height:100%;
    background:#0b3a6f;
}

.gid-kpi-sub{
    font-size:11px;
    color:#8a96a3;
    margin-top:5px;
}

/* ---- Recent service list (right pane) ---- */
.gid-recent-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.gid-recent-item{
    padding:10px;
    border-radius:10px;
    background:#f7f9fb;
    border:1px solid #e3e7ec;
}

.gid-recent-top{
    display:flex;
    justify-content:space-between;
    align-items:baseline;
    gap:10px;
    margin-bottom:4px;
}

.gid-recent-created{
    font-size:12px;
    font-weight:700;
    color:#364554;
    white-space:nowrap;
}

.gid-recent-serial{
    font-size:12px;
    color:#0b3a6f;
    font-weight:700;
    white-space:nowrap;
}

.gid-recent-title{
    font-size:13px;
    font-weight:700;
    color:#364554;
    line-height:1.2;
    margin-bottom:2px;
}

.gid-recent-desc{
    font-size:12px;
    color:#4b5866;
    line-height:1.25;
    margin-bottom:6px;
    word-break: break-word;
}

.gid-recent-meta{
    font-size:11px;
    color:#8a96a3;
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    align-items:center;
}

.gid-recent-user{
    color:#0b3a6f;
    font-weight:700;
}

.gid-recent-dot{
    opacity: 0.7;
}

/* clickable recent service rows */
.gid-recent-clickable{
    cursor: pointer;
    transition: transform 0.06s ease, box-shadow 0.06s ease, background 0.06s ease;
}

.gid-recent-clickable:hover{
    background: #f0f5fb;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.gid-recent-clickable:active{
    transform: translateY(0);
}

/* Service action button */
.btn-service{
    background: #0b3a6f;
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.btn-service:hover{
    background: #082a4f;
}

/* ===== Admin status badges ===== */
.badge {
    display: inline-block;
    padding: 2px 7px;
    font-size: 12px;
    border-radius: 6px;
    font-weight: 600;
}

.badge-admin {
    background: #3b82f6;
    color: white;
}

.badge-active {
    background: #2e7d32;
    color: white;
}

.badge-disabled {
    background: #c0392b;
    color: white;
}

.badge-engineer {
    background: #6b7280;
    color: white;
}

.badge-muted {
    background: #e5e7eb;
    color: #555;
}

/* =========================
   USER ROLE BADGES
========================= */

.role-badge{
    display:inline-block;
    padding:2px 8px;
    font-size:12px;
    border-radius:6px;
    margin-left:6px;
    font-weight:600;
}

.role-admin{
    background:#2563eb;
    color:white;
}

.role-manager{
    background:#7c3aed;
    color:white;
}

.role-user{
    background:#e5e7eb;
    color:#555;
}

/* =========================
   LOGOUT ICON
========================= */

.logout-icon{
    display:flex;
    align-items:center;
    text-decoration:none;
    opacity:0.75;
}

.logout-icon:hover{
    opacity:1;
}

.logout-icon svg{
    width:18px;
    height:18px;
    fill:#5b6e81;
}

.logout-icon:hover svg{
    fill:#1f3347;
}

/* =========================
   SERVICE PLANNER
========================= */

.sp-wrap{
    padding:12px 0 0;
    width:100%;
}

.sp-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    margin-bottom:14px;
    gap:10px;
    flex-wrap:wrap;
}

.sp-title{
    margin:0 0 8px 0;
}

.sp-week-nav{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-bottom:8px;
}

.sp-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.sp-btn{
    padding:6px 12px;
    border:1px solid #ccc;
    background:#fff;
    border-radius:6px;
    cursor:pointer;
    font-size:13px;
    text-decoration:none;
    color:inherit;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.sp-btn:hover{
    background:#f5f5f5;
}

.sp-btn:disabled{
    opacity:0.6;
    cursor:not-allowed;
}

.sp-link-btn{
    text-decoration:none;
}

.sp-status{
    margin:10px 0 14px;
    padding:8px 10px;
    border-radius:6px;
    background:#f7f7f7;
    border:1px solid #ddd;
    font-size:13px;
}

.sp-table-wrap{
    width:100%;
    overflow-x:hidden;
}

.sp-table{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    background:#fff;
}

.sp-table th,
.sp-table td{
    border:1px solid #ddd;
    padding:6px;
    vertical-align:middle;
    word-wrap:break-word;
}

.sp-table th{
    background:#f3f4f6;
    text-align:center;
    font-weight:600;
    font-size:13px;
}

.sp-table td select,
.sp-table td input{
    width:100%;
    box-sizing:border-box;
    padding:4px 5px;
    font-size:12px;
}

.sp-table td input:disabled,
.sp-table td select:disabled{
    background:#f3f4f6;
    color:#666;
}

.sp-table .left-col{
    width:16%;
}

.sp-table .day-col{
    width:7%;
}

.sp-table .total-cell{
    text-align:center;
    font-weight:600;
    background:#fafafa;
    width:6%;
}

.sp-row-status{
    text-align:center;
    font-size:12px;
    font-weight:600;
    width:8%;
    white-space:nowrap;
}

.status-draft{
    color:#555;
}

.status-submitted{
    color:#946200;
}

.status-approved{
    color:#1f6b2e;
}

.status-rejected{
    color:#a12626;
}

.sp-row-actions{
    text-align:center;
    width:5%;
}

.sp-lock-mark{
    font-size:14px;
    opacity:0.8;
}

.sp-table .weekend{
    background:#fcfcfc;
}

.sp-table .holiday{
    background:#fff3f3;
}

.sp-table td.overtime{
    background:#ffe8e8;
    font-weight:700;
}

.sp-table td.overtime input{
    background:#fff1f1;
    border:1px solid #e08d8d;
    font-weight:700;
}

.locked-row{
    background:#f8f8f8;
}

.locked-row td{
    background:#f8f8f8;
}

.locked-row .total-cell{
    background:#efefef;
}

.sp-muted{
    color:#666;
    font-size:12px;
}

.sp-totals-row td{
    background:#f6f7f9;
    font-weight:700;
}

.sp-day-total{
    text-align:center;
}

.sp-day-total.weekend-total{
    background:#fff1f1;
}

@media (max-width: 1100px){
    .sp-table-wrap{
        overflow-x:auto;
    }

    .sp-table{
        min-width:1120px;
        table-layout:auto;
    }
}

/* =========================
   SERVICE PLANNER APPROVAL
========================= */

.spa-wrap{
    padding:12px 0 0;
    width:100%;
}

.spa-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:14px;
}

.spa-title{
    margin:0 0 10px 0;
}

.spa-controls-row{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    margin-bottom:8px;
}

.spa-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.spa-label{
    font-size:13px;
    font-weight:600;
    color:#364554;
}

.spa-select{
    min-width:260px;
    padding:6px 8px;
    border:1px solid #ccc;
    border-radius:6px;
    background:#fff;
}

.spa-review-box{
    margin:10px 0 14px;
    padding:12px;
    border:1px solid #ddd;
    border-radius:8px;
    background:#fbfbfb;
}

.spa-textarea{
    width:100%;
    box-sizing:border-box;
    margin-top:6px;
    padding:8px 10px;
    border:1px solid #ccc;
    border-radius:6px;
    resize:vertical;
    font-size:13px;
}

.spa-review-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:10px;
}

.spa-approve-btn{
    border-color:#9bc79b;
}

.spa-reject-btn{
    border-color:#d7a1a1;
}

.spa-table .spa-check-col{
    width:5%;
}

.spa-check-cell{
    text-align:center;
}

.spa-no-check{
    opacity:0.6;
}

.spa-status-row.status-submitted{
    background:#fffaf0;
}

.spa-status-row.status-approved{
    background:#f3fbf3;
}

.spa-status-row.status-rejected{
    background:#fff5f5;
}

.spa-status-row.status-draft{
    background:#fafafa;
}
/* =========================================================
   Dark KRONos redesign overrides
   Similar to the Ladev.ru placeholder page
   ========================================================= */

:root{
    --kron-bg:#0d1117;
    --kron-panel:rgba(255,255,255,0.035);
    --kron-panel-strong:rgba(255,255,255,0.055);
    --kron-border:#30363d;
    --kron-text:#f0f6fc;
    --kron-muted:#8b949e;
    --kron-green:#238636;
    --kron-green-hover:#2ea043;
    --kron-header:rgba(13,17,23,0.92);
}

body{
    background:var(--kron-bg);
    color:var(--kron-text);
}

.site-header{
    position:sticky;
    top:0;
    z-index:1000;
    background:var(--kron-header);
    color:var(--kron-text);
    padding:12px 24px;
    margin-bottom:24px;
    border-bottom:1px solid var(--kron-border);
    backdrop-filter:blur(10px);
    box-shadow:0 8px 24px rgba(0,0,0,0.22);
}

.header-row{
    max-width:1600px;
    margin:0 auto;
    gap:18px;
}

.site-title{
    margin-right:12px;
}

.site-logo-link{
    background:#ffffff;
    border:1px solid rgba(255,255,255,0.16);
    border-radius:10px;
    padding:6px 10px;
    box-shadow:0 2px 10px rgba(0,0,0,0.18);
}

.site-logo{
    height:30px;
}

.nav-links{
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

.nav-links a{
    color:var(--kron-text);
    text-decoration:none;
    margin-left:0;
    font-size:14px;
    font-weight:600;
    padding:9px 14px;
    border:1px solid var(--kron-border);
    border-radius:8px;
    background:rgba(255,255,255,0.03);
    transition:background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover{
    text-decoration:none;
    background:var(--kron-green);
    border-color:var(--kron-green);
    transform:translateY(-1px);
}

.header-user{
    color:var(--kron-text);
}

.logged-user{
    color:var(--kron-text);
}

.logout-form{
    display:inline-flex;
    margin:0;
}

.logout-icon{
    border:none;
    background:transparent;
    padding:0;
    cursor:pointer;
}

.logout-icon svg{
    fill:var(--kron-muted);
}

.logout-icon:hover svg{
    fill:var(--kron-text);
}

.page-title{
    color:var(--kron-text);
}

.card{
    background:var(--kron-panel);
    border:1px solid var(--kron-border);
    border-left:1px solid var(--kron-border);
    border-radius:14px;
    box-shadow:0 12px 32px rgba(0,0,0,0.22);
    backdrop-filter:blur(4px);
}

.text-muted,
.tile-subtitle{
    color:var(--kron-muted);
}

.link,
.site-title a,
.site-title a:visited{
    color:var(--kron-text);
}

.btn{
    border-radius:8px;
    font-weight:700;
    transition:background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.btn:hover{
    transform:translateY(-1px);
}

.btn-primary{
    background-color:var(--kron-green);
    color:var(--kron-text);
}

.btn-primary:hover{
    background-color:var(--kron-green-hover);
}

.btn-secondary{
    background-color:transparent;
    color:var(--kron-text);
    border:1px solid var(--kron-border);
}

.btn-secondary:hover{
    background-color:rgba(255,255,255,0.06);
}

.table th{
    background:rgba(255,255,255,0.07);
    color:var(--kron-text);
}

.table td,
.table th{
    border-bottom:1px solid var(--kron-border);
}

.form-group label{
    color:var(--kron-text);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea,
select{
    background:#ffffff;
    color:#111827;
    border:1px solid var(--kron-border);
    border-radius:8px;
}

/* ---- /kronos home page ---- */
.page.home-page{
    max-width:1180px;
}

.home-hero{
    min-height:220px;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:42px 28px;
    margin-bottom:24px;
}

.eyebrow{
    margin:0 0 8px 0;
    color:var(--kron-muted);
    font-size:14px;
    letter-spacing:0.08em;
    text-transform:uppercase;
    font-weight:700;
}

.home-hero h2{
    margin:0;
    font-size:clamp(42px, 7vw, 76px);
    line-height:1;
    letter-spacing:-0.04em;
    color:var(--kron-text);
}

.home-lead{
    margin:14px 0 0 0;
    font-size:18px;
    color:var(--kron-muted);
}

.module-section{
    margin-bottom:28px;
}

.module-section-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:16px;
    margin-bottom:14px;
}

.module-section-header h3{
    margin:0;
    font-size:22px;
    color:var(--kron-text);
}

.module-section-header p{
    margin:0;
}

.app-tile-grid{
    grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
    gap:18px;
}

.tile.app-tile{
    min-height:170px;
    padding:22px;
    border:1px solid var(--kron-border);
    border-top:1px solid var(--kron-border);
    background:var(--kron-panel-strong);
    color:var(--kron-text);
    border-radius:14px;
    box-shadow:0 12px 28px rgba(0,0,0,0.18);
}

.tile.app-tile:hover{
    transform:translateY(-3px);
    border-color:rgba(46,160,67,0.6);
    box-shadow:0 18px 36px rgba(0,0,0,0.26);
}

.tile-title{
    color:var(--kron-text);
    font-size:20px;
}

.tile-button{
    align-self:flex-start;
    margin-top:22px;
    padding:10px 18px;
    border-radius:8px;
    background:var(--kron-green);
    color:var(--kron-text);
    font-size:14px;
    font-weight:700;
}

.tile-button-disabled{
    background:rgba(255,255,255,0.08);
    color:var(--kron-muted);
}

.tile-disabled{
    opacity:0.55;
}

.tile-disabled:hover{
    transform:none;
    border-color:var(--kron-border);
    box-shadow:0 12px 28px rgba(0,0,0,0.18);
}

@media (max-width: 900px){
    .site-header{
        padding:10px 12px;
    }

    .header-row{
        align-items:flex-start;
        flex-wrap:wrap;
    }

    .nav-links{
        order:3;
        width:100%;
    }

    .nav-links a{
        padding:8px 10px;
        font-size:13px;
    }

    .header-user{
        margin-left:auto;
    }

    .home-hero{
        min-height:190px;
    }

    .module-section-header{
        align-items:flex-start;
        flex-direction:column;
    }
}

/* =========================================================
   LADEV-STYLE /kronos HOME PAGE + STICKY HEADER OVERRIDES
   Reference: uploaded Ladev.ru index.html
========================================================= */

body{
    background:linear-gradient(180deg, #f3f6fa 0%, #eef2f7 100%);
    color:#1f2937;
}

.site-header{
    position:sticky;
    top:0;
    z-index:1000;
    background:#ffffff;
    color:#1f2937;
    border-bottom:1px solid #dbe3ec;
    box-shadow:0 4px 12px rgba(15,23,42,0.05);
    margin-bottom:0;
    padding:12px 24px;
}

.header-row{
    max-width:1600px;
    margin:0 auto;
}

.nav-links a,
.logged-user,
.site-title a,
.site-title a:visited{
    color:#1f3347;
}

.nav-links a:hover{
    color:#2457c5;
    text-decoration:none;
}

.page.home-page{
    max-width:none;
    margin:0;
    padding:0;
}

.page.home-page .flash-messages{
    max-width:1100px;
    margin:18px auto 0;
    padding:0 16px;
}

.kronos-box{
    min-height:calc(100vh - 58px);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:32px 16px;
}

.kronos-container{
    width:100%;
    max-width:1100px;
}

.portal-grid{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:18px;
}

.portal-card{
    background:#ffffff;
    border:1px solid #dbe3ec;
    border-radius:18px;
    padding:22px;
    text-decoration:none;
    color:inherit;
    box-shadow:0 8px 24px rgba(15,23,42,0.06);
    transition:transform 0.18s ease, box-shadow 0.18s ease;
    min-height:200px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}

.portal-card.active:hover{
    transform:translateY(-4px);
    box-shadow:0 14px 32px rgba(15,23,42,0.12);
}

.portal-card.disabled{
    opacity:0.8;
    cursor:default;
}

.icon-wrap{
    width:56px;
    height:56px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#f3f7fc;
    border:1px solid #dde7f2;
    margin-bottom:16px;
}

.portal-card h2{
    margin:0 0 10px;
    font-size:22px;
    color:#0f172a;
}

.portal-card p{
    margin:0;
    color:#667085;
    font-size:14px;
    line-height:1.6;
}

.card-footer{
    margin-top:16px;
    font-size:13px;
    font-weight:700;
}

.active-text{ color:#2457c5; }
.disabled-text{ color:#98a2b3; }

.portal-card svg{
    width:26px;
    height:26px;
    stroke:#2457c5;
}

@media (max-width:980px){
    .portal-grid{
        grid-template-columns:repeat(2, 1fr);
    }
}

@media (max-width:640px){
    .portal-grid{
        grid-template-columns:1fr;
    }

    .kronos-box{
        align-items:flex-start;
    }
}

/* =========================================================
   LIGHT THEME VISIBILITY FIX
   Keep Ladev light background and make labels, placeholders,
   form text, cards and portal buttons readable.
========================================================= */

body{
    background:linear-gradient(180deg, #f3f6fa 0%, #eef2f7 100%) !important;
    color:#1f2937 !important;
}

.page,
.page-title,
.module-section-header h3,
.module-section-header p,
.sp-title,
.spa-title{
    color:#1f2937 !important;
}

.card,
.modal,
.gid-recent-item,
.gid-kpi,
.spa-review-box{
    background:#ffffff !important;
    color:#1f2937 !important;
    border-color:#dbe3ec !important;
    box-shadow:0 8px 24px rgba(15,23,42,0.06) !important;
}

.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6,
.modal h1,
.modal h2,
.modal h3,
.modal h4,
.modal h5,
.modal h6{
    color:#0f172a !important;
}

.form-group label,
.spa-label,
.gid-side-title,
.gid-kpi-label,
.gid-recent-created,
.gid-recent-title,
.tile-title{
    color:#1f2937 !important;
}

.text-muted,
.gid-side-subtitle,
.gid-total-label,
.gid-kpi-sub,
.gid-recent-meta,
.sp-muted,
.tile-subtitle{
    color:#667085 !important;
}

input,
select,
textarea,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea,
.sp-table td input,
.sp-table td select,
.spa-select,
.spa-textarea{
    background:#ffffff !important;
    color:#111827 !important;
    border:1px solid #cfd8e3 !important;
}

input::placeholder,
textarea::placeholder{
    color:#667085 !important;
    opacity:1 !important;
}

input:disabled,
select:disabled,
textarea:disabled,
.sp-table td input:disabled,
.sp-table td select:disabled{
    background:#f3f4f6 !important;
    color:#667085 !important;
}

.table,
.sp-table,
.spa-table{
    background:#ffffff !important;
    color:#1f2937 !important;
}

.table th,
.sp-table th,
.spa-table th{
    background:#eef2f7 !important;
    color:#1f2937 !important;
}

.table td,
.table th,
.sp-table td,
.sp-table th,
.spa-table td,
.spa-table th{
    border-color:#dbe3ec !important;
    color:#1f2937;
}

.project-item{
    background:#ffffff !important;
    color:#1f2937 !important;
    border-color:#dbe3ec !important;
}

.project-item:hover{
    background:#eef4ff !important;
}

.link{
    color:#2457c5 !important;
}

.btn-secondary,
.sp-btn{
    background:#ffffff !important;
    color:#2457c5 !important;
    border:1px solid #cfe0ff !important;
}

.btn-secondary:hover,
.sp-btn:hover{
    background:#eef4ff !important;
}

.btn-primary,
.btn-service{
    background:#2457c5 !important;
    color:#ffffff !important;
}

/* /kronos portal cards */
.portal-card,
.portal-card *{
    color:#1f2937 !important;
}

.portal-card h2{
    color:#0f172a !important;
}

.portal-card p{
    color:#667085 !important;
}

.portal-card .card-footer,
.portal-card .active-text{
    color:#2457c5 !important;
}

.portal-card.disabled{
    opacity:1 !important;
}

.portal-card.disabled .card-footer,
.portal-card .disabled-text{
    color:#98a2b3 !important;
}

.portal-card svg{
    stroke:#2457c5 !important;
    color:#2457c5 !important;
}
