/* Netconsultora - UI base
   Estilo sobrio de panel administrativo: compacto, claro y sin adornos innecesarios. */
:root {
    --bg: #f3f5f7;
    --surface: #ffffff;
    --surface-soft: #f8fafb;
    --border: #dfe3e8;
    --border-strong: #cbd1d8;
    --text: #252a30;
    --muted: #69727d;
    --primary: #315f8f;
    --primary-dark: #274d75;
    --primary-soft: #edf3f8;
    --success: #2f6b4f;
    --success-soft: #edf6f0;
    --warning: #8a651d;
    --warning-soft: #fbf5e6;
    --danger: #9a3e3e;
    --danger-soft: #faeeee;
    --radius: 6px;
}

* { box-sizing: border-box; }
html { font-size: 14px; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* Cabecera */
.topbar {
    min-height: 56px;
    padding: 0 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 28px;
}
.brand { flex: 0 0 auto; }
.brand a {
    color: #26323d;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -.15px;
    text-decoration: none;
}
.main-nav {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: 56px;
    margin: 0;
}
.main-nav a {
    display: flex;
    align-items: center;
    padding: 0 11px;
    color: #5d6670;
    font-size: 13px;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover {
    color: var(--text);
    background: #fafbfc;
    text-decoration: none;
}
.main-nav a.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.user-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    color: #5d6670;
    font-size: 13px;
}
.user-menu a { color: #68727d; }

/* Contenedor y títulos */
.container {
    width: min(1180px, calc(100% - 40px));
    margin: 26px auto 42px;
}
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}
.page-header h1 {
    margin: 0 0 3px;
    font-size: 23px;
    line-height: 1.25;
    font-weight: 650;
    letter-spacing: -.3px;
}
.page-header p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* Botones */
.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 13px;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 550;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.button:hover,
button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}
.button.secondary,
button.secondary {
    background: #fff;
    color: #4f5963;
    border-color: var(--border-strong);
}
.button.secondary:hover,
button.secondary:hover { background: #f7f8f9; color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }

/* Tarjetas */
.card,
.table-card,
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.card { padding: 18px; }
.card h2 { margin: 0; font-size: 16px; font-weight: 650; }
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.metric-card {
    min-height: 104px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: inherit;
    text-decoration: none;
    transition: border-color .12s ease, background .12s ease;
}
.metric-card:hover {
    color: inherit;
    text-decoration: none;
    border-color: #b9c5d1;
    background: #fcfdfe;
}
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card strong { font-size: 25px; line-height: 1; font-weight: 650; color: #27313a; }

/* Buscadores y formularios */
.search-form {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.search-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
}
.search-form input[type="search"] { flex: 1 1 300px; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    outline: none;
}
input, select { min-height: 36px; padding: 7px 9px; }
textarea { padding: 8px 9px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9aa2aa; }
input:focus, select:focus, textarea:focus {
    border-color: #8faac3;
    box-shadow: 0 0 0 2px rgba(49,95,143,.08);
}
.search-form > input,
.search-form > select { width: auto; min-width: 150px; }
.search-form > input[type="search"] { min-width: 260px; }
.search-form a { align-self: center; padding: 7px 4px; font-size: 13px; }
.form-card { padding: 20px; overflow: visible; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 18px;
}
.form-row,
.form-card > label,
.form-grid > label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #555f69;
    font-size: 12px;
    font-weight: 550;
}
.form-row.full { grid-column: 1 / -1; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}
.checkbox-row label { flex-direction: row; align-items: center; gap: 7px; }
.checkbox-row input { width: auto; min-height: auto; }

/* Tablas */
.table-card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td {
    padding: 10px 13px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #edf0f2;
}
th {
    background: var(--surface-soft);
    color: #68727c;
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .35px;
    white-space: nowrap;
}
td { font-size: 13px; }
td strong { font-weight: 600; color: #303941; }
tbody tr:hover { background: #fbfcfd; }
tr:last-child td { border-bottom: 0; }

/* Estados / avisos */
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 600;
}
.badge-active { background: var(--success-soft); color: var(--success); border-color: #d6e8dc; }
.badge-inactive { background: #f2f3f4; color: #6e767e; border-color: #e2e4e6; }
.alert {
    padding: 10px 12px;
    margin: 0 0 15px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    font-size: 13px;
}
.alert-success { background: var(--success-soft); border-color: #d6e8dc; color: var(--success); }
.alert-error { background: var(--danger-soft); border-color: #eed5d5; color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 28px !important; }

/* Detalle / historial */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .75fr); gap: 15px; }
.details { display: grid; grid-template-columns: 130px 1fr; gap: 9px 14px; }
.details dt { color: var(--muted); font-size: 12px; font-weight: 550; }
.details dd { margin: 0; font-size: 13px; }
.timeline-item {
    border-left: 2px solid #d9dee3;
    padding: 0 0 14px 13px;
    margin-left: 3px;
}
.timeline-item small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.compact { font-size: 13px; }
.welcome-card { margin-top: 20px; }

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: var(--bg);
}
.login-box {
    width: min(380px, 100%);
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
}
.login-box h1 { margin: 0 0 5px; font-size: 21px; }
.login-box label { display: block; margin-top: 14px; margin-bottom: 5px; color: #59636d; font-size: 12px; font-weight: 550; }
.login-box input { width: 100%; }
.login-box button { width: 100%; margin-top: 18px; }

/* Agenda / Hoy */
.today-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.section-title h2 { margin: 0; }
.section-title a { font-size: 12px; }
.today-list { display: flex; flex-direction: column; }
.today-item {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 11px 2px;
    border-top: 1px solid #edf0f2;
    color: inherit;
    text-decoration: none;
}
.today-item:first-child { border-top: 0; }
.today-item:hover { color: inherit; text-decoration: none; background: #fbfcfd; }
.today-item strong { display: block; font-size: 13px; font-weight: 600; }
.today-item small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.item-meta { text-align: right; white-space: nowrap; color: #58626c; }
.item-meta span { font-size: 11px; }
.item-meta strong { font-size: 13px; }
.compact .today-item { padding: 9px 2px; }

@media (max-width: 1000px) {
    .dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .topbar { padding: 0 18px; gap: 15px; }
    .main-nav { overflow-x: auto; }
}
@media (max-width: 800px) {
    .container { width: min(100% - 24px, 1180px); margin-top: 18px; }
    .topbar { min-height: auto; padding: 11px 12px; flex-wrap: wrap; }
    .main-nav { order: 3; width: 100%; height: 38px; }
    .main-nav a { height: 38px; padding: 0 9px; }
    .user-menu { margin-left: auto; }
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .today-columns, .detail-grid, .form-grid { grid-template-columns: 1fr; }
    .form-row.full { grid-column: auto; }
    .page-header { flex-direction: column; align-items: stretch; margin-bottom: 16px; }
    .actions { width: 100%; }
    .actions .button { flex: 1 1 auto; }
    .search-form > input[type="search"], .search-form > input, .search-form > select { min-width: 0; flex: 1 1 160px; }
    .search-form button { flex: 0 0 auto; }
    .details { grid-template-columns: 110px 1fr; }
}
@media (max-width: 520px) {
    html { font-size: 13px; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .metric-card { min-height: 90px; padding: 13px; }
    .metric-card strong { font-size: 22px; }
    .card { padding: 14px; }
    .form-card { padding: 15px; }
    .user-menu { font-size: 12px; }
    .brand a { font-size: 15px; }
}
