:root { --green: #3F6B5C; --green-dark: #315448; --graphite: #545454; --canvas: #f5f7f6; --line: #dfe6e2; --muted: #6d7773; }
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: #26332e; background: var(--canvas); font: 14px/1.5 "Segoe UI", Arial, sans-serif; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 264px; min-height: 100vh; display: flex; flex-direction: column; flex: 0 0 264px; background: var(--green); color: #fff; }
.brand { min-height: 100px; display: flex; align-items: center; gap: 10px; padding: 22px 22px 18px; background: #fff; color: var(--green); border-bottom: 4px solid #dbe7e1; }
.brand:hover { color: var(--green-dark); }
.brand-logo { display: block; width: 52px; flex: 0 0 52px; }
.brand-logo img { display: block; width: 100%; height: auto; }
.brand-name { font-size: 17px; font-weight: 700; line-height: 1.15; }
.sidebar-nav { padding: 18px 12px; flex: 1; }
.nav-label { margin: 13px 11px 6px; color: rgba(255,255,255,.66); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-label:first-child { margin-top: 0; }
.nav-entry { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 8px 11px; color: rgba(255,255,255,.94); border-radius: 7px; font-weight: 500; }
.nav-entry:hover, .nav-entry:focus { color: #fff; background: rgba(255,255,255,.13); }
.nav-icon { width: 21px; height: 21px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 21px; border: 1px solid rgba(255,255,255,.45); border-radius: 5px; font-size: 11px; font-weight: 700; }
.sidebar-footer { padding: 16px 22px; border-top: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.68); font-size: 11px; }
.page-wrap { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.topbar { height: 72px; display: flex; align-items: center; gap: 16px; padding: 0 34px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-spacer { flex: 1; }
.sidebar-toggle { display: none; border: 0; background: transparent; width: 42px; height: 42px; padding: 10px; }
.sidebar-toggle span { display: block; height: 2px; margin: 4px 0; background: var(--graphite); }
.mobile-brand { display: none; height: 40px; }
.mobile-brand img { height: 100%; width: auto; }
.session-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; background: #a7b4ad; border-radius: 50%; }
.main-content { flex: 1; width: 100%; max-width: 1500px; margin: 0 auto; padding: 26px 34px 42px; }
.page-breadcrumb { margin-bottom: 22px; font-size: 12px; }
.breadcrumb-item + .breadcrumb-item::before { color: #a4afaa; }
.breadcrumb-item.active { color: var(--muted); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 4px; color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
h1, h2 { color: #26332e; font-weight: 700; }
h1 { margin: 0; font-size: clamp(25px, 3vw, 32px); letter-spacing: -.025em; }
h2 { margin: 0; font-size: 19px; }
.page-description { max-width: 650px; margin: 9px 0 0; color: var(--muted); font-size: 15px; }
.role-notice { min-width: 210px; padding: 11px 15px; color: #65736d; background: #edf3f0; border-left: 3px solid var(--green); border-radius: 4px; font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric-card, .content-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 2px 8px rgba(27,53,42,.035); }
.metric-card { min-height: 150px; padding: 20px; display: flex; flex-direction: column; }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-card strong { margin: auto 0 2px; color: var(--green); font-size: 32px; line-height: 1; }
.metric-card > span:last-child { color: #93a099; font-size: 12px; }
.content-card { padding: 23px; }
.card-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.action-link { display: flex; align-items: center; gap: 13px; padding: 17px; color: inherit; background: #fbfcfb; border: 1px solid var(--line); border-radius: 7px; transition: border-color .15s, box-shadow .15s; }
.action-link:hover { color: inherit; border-color: #a9c2b7; box-shadow: 0 4px 12px rgba(34,73,57,.08); }
.action-link > span { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 34px; color: #fff; background: var(--green); border-radius: 7px; font-size: 13px; font-weight: 700; }
.action-link strong, .action-link small { display: block; }
.action-link small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.module-empty { max-width: 850px; }
.module-empty .content-card { padding: 30px; }
.module-list { margin: 18px 0 0; padding-left: 20px; color: var(--muted); }
.module-list li { margin: 6px 0; }
.app-footer { padding: 15px 34px; color: #78837e; background: #fff; border-top: 1px solid var(--line); font-size: 12px; }
.app-footer span { margin-left: 8px; color: #a1aaa6; }
.sidebar-backdrop { display: none; }
.user-session { display: flex; align-items: center; gap: 8px; color: var(--graphite); font-size: 12px; }
.user-name { font-weight: 600; }
.role-badge { padding: 3px 8px; color: var(--green-dark); background: #edf3f0; border-radius: 10px; font-size: 11px; }
.logout-button { border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; color: var(--graphite); background: #fff; font-size: 12px; }
.logout-button:hover { border-color: var(--green); color: var(--green); }
.auth-page { min-height: calc(100vh - 190px); display: grid; place-items: center; padding: 26px 0; }
.auth-card { width: min(100%, 440px); padding: 30px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(27,53,42,.08); }
.auth-card-wide { width: min(100%, 760px); }
.auth-form { margin-top: 24px; }
.auth-form .field { margin-bottom: 15px; }
.auth-form .field label { display: block; margin-bottom: 5px; color: var(--graphite); font-size: 12px; font-weight: 600; }
.auth-form .field input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #bfcac4; border-radius: 6px; }
.check-field { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.btn-atlanta { color: #fff; background: var(--green); border-color: var(--green); }
.btn-atlanta:hover { color: #fff; background: var(--green-dark); border-color: var(--green-dark); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.crud-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 20px; align-items: start; }
.search-row { display: flex; gap: 8px; margin-bottom: 17px; }
.search-row input, .crud-form input, .crud-form select, .crud-form textarea { width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid #bfcac4; border-radius: 6px; background: #fff; }
.crud-form textarea { min-height: 72px; resize: vertical; }
.crud-form .field { margin-bottom: 12px; }
.crud-form .field label { display: block; margin-bottom: 4px; color: var(--graphite); font-size: 12px; font-weight: 600; }
.app-table { margin-bottom: 0; font-size: 13px; }
.app-table thead th { color: var(--graphite); background: #f4f7f5; border-bottom-width: 1px; font-weight: 700; }
.table-actions { display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.table-actions form { display: inline; }
.table-actions button, .table-actions a { padding: 0; color: var(--green); border: 0; background: transparent; font-size: 12px; }
.table-actions .danger { color: #a43d3d; }
/* FixedColumns deja la última columna sobre el contenido desplazable. El fondo
   opaco y el ancho reservado evitan que las acciones se mezclen con la celda anterior. */
table.dataTable th.dtfc-fixed-end,
table.dataTable td.dtfc-fixed-end,
table.dataTable th.dtfc-fixed-right,
table.dataTable td.dtfc-fixed-right { min-width: 205px; background: #fff !important; box-shadow: -5px 0 8px rgba(33, 52, 43, .12); }
table.dataTable thead th.dtfc-fixed-end,
table.dataTable thead th.dtfc-fixed-right { background: #f4f7f5 !important; }
table.dataTable td.dtfc-fixed-end .table-actions,
table.dataTable td.dtfc-fixed-right .table-actions { min-width: 190px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 15px; color: var(--muted); font-size: 12px; }
.pager a { padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; }
details { margin-top: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
details summary { color: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; }
.vale-form { max-width: 1050px; }
.vale-reference { max-width: 1180px; }
.vale-entry-header { display:flex;justify-content:space-between;align-items:center;gap:20px;padding-bottom:18px;margin-bottom:22px;border-bottom:2px solid var(--green-dark); }
.vale-entry-header img { width:min(390px,70%);height:auto; }.vale-entry-header div{text-align:right}.vale-entry-header small,.vale-entry-header strong{display:block}.vale-entry-header strong{color:#b42a1f;font-size:23px;letter-spacing:.05em}
.vale-entry-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px; }.vale-entry-grid .field{margin:0}.vale-entry-grid .full{grid-column:1 / -1}.km-grid{margin:18px 0}
.route-heading { display:grid;grid-template-columns:120px 1fr 1fr 120px;gap:8px;margin:0 0 5px;color:var(--graphite);font-size:12px;font-weight:700;text-transform:uppercase; }.route-form .route-field label{display:none}
.vale-form .field { margin-bottom: 14px; }
.vale-form .field label, .route-field label { display: block; margin-bottom: 4px; color: var(--graphite); font-size: 12px; font-weight: 600; }
.vale-form .field input, .vale-form .field select, .vale-form .field textarea { width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid #bfcac4; border-radius: 6px; background: #fff; }
.vale-form .field textarea { min-height: 82px; resize: vertical; }
.report-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; align-items: end; }
.report-filter .field label { display: block; margin-bottom: 4px; color: var(--graphite); font-size: 12px; font-weight: 600; }
.report-filter .field input, .report-filter .field select { width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid #bfcac4; border-radius: 6px; background: #fff; }
.report-actions, .report-row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.report-row-actions { white-space: nowrap; }
.link-button { padding: 0; color: var(--green); border: 0; background: transparent; font-size: 12px; }
.form-hint { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.form-section { margin: 22px 0 10px; font-size: 17px; }
.route-form { display: grid; grid-template-columns: 120px 1fr 1fr 120px; gap: 8px; margin-bottom: 12px; }
.route-field input, .route-field select { width: 100%; min-height: 38px; padding: 7px; border: 1px solid #bfcac4; border-radius: 6px; background: #fff; }
.printable-vale { max-width: 900px; margin: 0 auto; color: #1f2f29; }
.printable-vale header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--green); padding-bottom: 12px; }
.printable-vale header h1 { font-size: 21px; }.print-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 18px 0; }.signature-boxes { display:grid;grid-template-columns:1fr 1fr;gap:40px;margin-top:40px;text-align:center }.signature-boxes span {display:block;border-bottom:1px solid #333;height:50px;margin-top:10px}
@media print { .sidebar,.topbar,.app-footer,.no-print,.page-breadcrumb { display:none!important; }.page-wrap,.main-content { display:block!important;padding:0!important;margin:0!important; }.printable-vale { border:0!important;box-shadow:none!important;width:100%!important;max-width:none!important; } }
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .action-grid { grid-template-columns: 1fr; } .crud-layout { grid-template-columns: 1fr; } .report-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 991.98px) { .sidebar { position: fixed; z-index: 1045; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 6px 0 20px rgba(0,0,0,.18); } .sidebar-open .sidebar { transform: translateX(0); } .sidebar-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(13,27,20,.45); } .sidebar-open .sidebar-backdrop { display: block; } .sidebar-toggle, .mobile-brand { display: block; } .topbar { padding: 0 18px; } .main-content { padding: 22px 20px 32px; } .app-footer { padding: 15px 20px; } }
@media (max-width: 575.98px) { .topbar { height: 62px; } .session-status { display: none; } .user-name { display: none; } .page-heading { display: block; } .role-notice { min-width: 0; margin-top: 18px; } .dashboard-grid { grid-template-columns: 1fr; gap: 12px; } .metric-card { min-height: 112px; } .content-card { padding: 17px; } .main-content { padding: 18px 15px 28px; } .app-footer span { display: block; margin: 2px 0 0; } .auth-card { padding: 22px; } .form-grid, .report-filter,.vale-entry-grid { grid-template-columns: 1fr; } .route-form { grid-template-columns: 1fr 1fr; gap: 10px; } .route-heading{display:none}.route-form .route-field label{display:block}.vale-entry-grid .full{grid-column:auto}.vale-entry-header{align-items:flex-start}.vale-entry-header div{text-align:left}.vale-entry-header img{width:250px} }
