/* GMD Operations — mobile-first, brand: navy #0E2A47, steel #5B7186, bg #F4F7FB/#E2EAF3, gold #C89B5A */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: Arial, Helvetica, sans-serif; background: #F4F7FB; color: #0E2A47; font-size: 16px; line-height: 1.45; }
a { color: #0E2A47; }
h1 { font-size: 24px; margin: 14px 0 10px; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 14px 0 8px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 12px 14px 48px; }
.muted { color: #5B7186; }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.w100 { width: 100%; }
.center { text-align: center; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; background: #0E2A47; padding: 8px 14px; box-shadow: 0 2px 8px rgba(14,42,71,.25); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand-logo { height: 36px; width: auto; background: #fff; border-radius: 8px; padding: 3px 5px; }
.brand-name { font-family: Georgia, 'Times New Roman', serif; font-size: 19px; letter-spacing: .02em; }
.menu-btn { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; font-size: 22px; line-height: 1; border-radius: 8px; padding: 7px 12px; cursor: pointer; }

/* Drawer (slides in from the right) */
.overlay { position: fixed; inset: 0; background: rgba(14,42,71,.45); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; height: 100dvh; width: min(320px, 86vw); background: #fff; z-index: 60; transform: translateX(105%); transition: transform .25s ease; box-shadow: -8px 0 24px rgba(14,42,71,.25); display: flex; flex-direction: column; padding: 16px; overflow-y: auto; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.drawer-user strong { display: block; font-size: 17px; }
.drawer-user span { color: #5B7186; font-size: 13px; }
.drawer-close { background: none; border: none; font-size: 28px; line-height: 1; cursor: pointer; color: #0E2A47; padding: 2px 6px; }
.drawer-links { list-style: none; margin: 6px 0 14px; padding: 0; }
.drawer-links li a { display: block; padding: 11px 10px; border-radius: 10px; text-decoration: none; font-weight: bold; }
.drawer-links li a:hover { background: #E2EAF3; }
.drawer-sec { border-top: 1px solid #E2EAF3; padding-top: 12px; margin-bottom: 12px; }
.drawer-label { display: block; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #5B7186; margin-bottom: 6px; }
.lang-form { display: flex; gap: 8px; align-items: center; }
.lang-form button { border: 1px solid #5B7186; background: #fff; color: #0E2A47; border-radius: 8px; padding: 6px 14px; cursor: pointer; font-weight: bold; }
.lang-form button.active { background: #0E2A47; color: #fff; }
.logout-form { margin-top: auto; }

/* Cards, buttons, forms */
.card { background: #fff; border: 1px solid #E2EAF3; border-radius: 14px; padding: 16px; margin: 12px 0; box-shadow: 0 4px 14px rgba(14,42,71,.05); }
.btn { display: inline-block; background: #E2EAF3; color: #0E2A47; border: 1px solid #c8d6e5; border-radius: 10px; padding: 9px 16px; font-size: 15px; font-weight: bold; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: #0E2A47; border-color: #0E2A47; color: #fff; }
.btn-gold { background: #C89B5A; border-color: #C89B5A; color: #fff; }
.btn-ghost { background: #fff; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .38; cursor: not-allowed; }
.stack-form label, .login-card label { display: block; margin: 10px 0; font-weight: bold; font-size: 14px; }
.stack-form input, .stack-form select, .stack-form textarea, .login-card input, .login-card select, .filter-bar input, .filter-bar select, .chat-form input {
    width: 100%; padding: 10px; margin-top: 4px; border: 1px solid #c8d6e5; border-radius: 10px; font-size: 16px; background: #fff; color: #0E2A47; font-weight: normal;
}
.stack-form fieldset { border: 1px solid #E2EAF3; border-radius: 10px; margin: 10px 0; }
.stack-form legend { font-weight: bold; font-size: 14px; padding: 0 6px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: normal; margin: 6px 0; }
label.check input { width: auto; margin: 0; }
.inline-form { display: inline-block; margin: 6px 6px 6px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.filter-bar input[type="search"] { flex: 1 1 180px; width: auto; }
.filter-bar select { flex: 0 1 200px; width: auto; }

/* Flash messages */
.flash { border-radius: 10px; padding: 11px 14px; margin: 10px 0; font-weight: bold; }
.flash-success { background: #e2f4e8; color: #14532d; border: 1px solid #9ed3ae; }
.flash-error { background: #fdeaea; color: #7f1d1d; border: 1px solid #f0b4b4; }
.flash-info { background: #E2EAF3; color: #0E2A47; border: 1px solid #c8d6e5; }

/* Jobs */
.job-list { display: flex; flex-direction: column; gap: 10px; }
.job-card { display: flex; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid #E2EAF3; border-radius: 12px; padding: 13px 15px; text-decoration: none; box-shadow: 0 3px 10px rgba(14,42,71,.05); }
.job-card-main { display: flex; flex-direction: column; min-width: 0; }
.job-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
ul.clean { list-style: none; margin: 0; padding: 0; }
ul.clean li { padding: 7px 0; border-bottom: 1px solid #eef3f8; }
ul.clean li:last-child { border-bottom: none; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: #5B7186; font-weight: bold; font-size: 14px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip { background: #E2EAF3; border-radius: 999px; padding: 6px 12px; text-decoration: none; font-size: 14px; }

/* Badges */
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: bold; white-space: nowrap; }
.st-aprobado { background: #dbe5ee; color: #33506b; }
.st-medicion { background: #e6e0f5; color: #4b3690; }
.st-produccion { background: #fdeed3; color: #8a5a00; }
.st-material_completo { background: #d8edf5; color: #155e75; }
.st-listo { background: #d9f2e2; color: #14532d; }
.st-programado { background: #0E2A47; color: #fff; }
.st-instalado { background: #cdeeee; color: #0f4c4c; }
.st-cerrado { background: #e5e7eb; color: #4b5563; }
.st-con_pendientes { background: #fbdcdc; color: #7f1d1d; }
.vs-propuesta { background: #fdf3e0; color: #8a5a00; border: 1px solid #C89B5A; }
.vs-confirmada { background: #0E2A47; color: #fff; }
.mat-ok { background: #d9f2e2; color: #14532d; }
.mat-pend { background: #fdeed3; color: #8a5a00; }
.corr-pendiente { background: #fdeed3; color: #8a5a00; }
.corr-aprobada { background: #d9f2e2; color: #14532d; }
.corr-rechazada { background: #fbdcdc; color: #7f1d1d; }

/* Workflow / materials / visits */
.flow-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.flow-step { background: #E2EAF3; color: #5B7186; border-radius: 999px; padding: 4px 11px; font-size: 13px; }
.flow-step.current { background: #0E2A47; color: #fff; font-weight: bold; }
.flow-step.current.warn { background: #B3261E; }
.mat-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mat-name { flex: 1 1 160px; }
.visit-block { padding: 8px 0; border-bottom: 1px solid #eef3f8; }
.visit-block:last-child { border-bottom: none; }
.visit-line { padding: 3px 0; }
.visit-time { font-weight: bold; }

/* Calendar */
.cal-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.seg { display: flex; gap: 6px; }
.seg-btn { background: #fff; border: 1px solid #c8d6e5; border-radius: 8px; padding: 6px 12px; text-decoration: none; font-weight: bold; font-size: 14px; }
.seg-btn.active { background: #0E2A47; color: #fff; }
.cal-title { margin: 4px 0 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: bold; color: #5B7186; padding: 4px 0; }
.cal-cell { background: #fff; border: 1px solid #E2EAF3; border-radius: 8px; min-height: 74px; padding: 4px; overflow: hidden; }
.cal-cell.today { border-color: #C89B5A; box-shadow: inset 0 0 0 1px #C89B5A; }
.cal-daynum { font-weight: bold; text-decoration: none; font-size: 13px; }
.cal-visit { display: block; font-size: 11px; line-height: 1.3; border-radius: 6px; padding: 2px 4px; margin-top: 3px; text-decoration: none; overflow-wrap: anywhere; }
.cal-visit.vs-propuesta { background: #fdf3e0; color: #8a5a00; border: 1px solid #C89B5A; }
.cal-visit.vs-confirmada { background: #0E2A47; color: #fff; }

/* Time */
.punch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.btn-punch { padding: 16px 10px; font-size: 16px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #E2EAF3; vertical-align: top; }
th { color: #5B7186; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.corr-block { padding: 10px 0; border-bottom: 1px solid #eef3f8; }
.corr-block:last-child { border-bottom: none; }

/* Chat */
.chat-card { display: flex; flex-direction: column; gap: 10px; }
.bubble { border-radius: 14px; padding: 11px 14px; max-width: 92%; }
.bubble p { margin: 4px 0; }
.bubble ul { margin: 6px 0; padding-left: 18px; }
.bubble-user { background: #0E2A47; color: #fff; align-self: flex-end; }
.bubble-luna { background: #E2EAF3; align-self: flex-start; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; width: auto; margin-top: 0; }

/* Login */
.login-body { display: flex; min-height: 100dvh; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: #fff; border: 1px solid #E2EAF3; border-radius: 18px; padding: 28px 24px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 12px 32px rgba(14,42,71,.10); }
.login-logo { width: 150px; height: auto; }
.login-card h1 { font-family: Georgia, 'Times New Roman', serif; margin: 10px 0 2px; }
.login-sub { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: #C89B5A; margin: 0 0 12px; }
.login-card form { text-align: left; }
.login-card .lang-form { justify-content: center; margin-top: 14px; }
.claim-box { background: #fdf3e0; border: 1px solid #C89B5A; border-radius: 10px; padding: 8px 12px; margin: 8px 0; text-align: left; }

@media (max-width: 560px) {
    .grid2, .grid3 { grid-template-columns: 1fr; }
    .kv { grid-template-columns: 105px 1fr; }
    .cal-cell { min-height: 58px; }
    h1 { font-size: 21px; }
    .brand-name { font-size: 17px; }
}

/* Dashboard */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.kpi-card { background: #fff; border: 1px solid #E2EAF3; border-radius: 14px; padding: 14px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 4px 14px rgba(14,42,71,.05); min-width: 0; }
.kpi-num { font-size: 28px; font-weight: bold; line-height: 1.1; }
.kpi-label { font-size: 12px; font-weight: bold; color: #5B7186; text-transform: uppercase; letter-spacing: .05em; }
.kpi-sub { font-size: 12px; color: #5B7186; }
@media (min-width: 720px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid #E2EAF3; border-left: 5px solid #5B7186; border-radius: 10px; padding: 10px 12px; }
.att-main { min-width: 0; overflow-wrap: anywhere; }
.att-red { border-left-color: #B3261E; }
.att-amber { border-left-color: #C89B5A; }
.att-blue { border-left-color: #0E2A47; }
.visit-card { border: 1px solid #E2EAF3; border-radius: 12px; padding: 12px 14px; margin: 8px 0; overflow-wrap: anywhere; }
.visit-card-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.visit-warn { background: #fdeaea; color: #7f1d1d; border-radius: 8px; padding: 7px 10px; font-size: 13px; font-weight: bold; margin-top: 8px; }
.day-head { font-size: 14px; font-weight: bold; color: #5B7186; margin: 12px 0 4px; }
.staff-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #eef3f8; }
.staff-row:last-child { border-bottom: none; }
.staff-row > div { min-width: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; }
.dot-working { background: #1d9e57; }
.dot-break { background: #C89B5A; }
.dot-out { background: #b7c3cf; }
.conn-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef3f8; flex-wrap: wrap; }
.conn-row:last-child { border-bottom: none; }
