:root {
    --ttep-blue: #2563eb;
    --ttep-blue-dark: #1d4ed8;
    --ttep-green: #16a34a;
    --ttep-orange: #f59e0b;
    --ttep-red: #ef4444;
    --ttep-purple: #8b5cf6;
    --ttep-pink: #ec4899;
    --ttep-gray: #6b7280;
    --ttep-text: #111827;
    --ttep-muted: #6b7280;
    --ttep-border: #e5e7eb;
    --ttep-soft: #f9fafb;
    --ttep-card: #ffffff;
    --ttep-shadow: 0 10px 30px rgba(15, 23, 42, .06);
    --ttep-radius: 16px;
    --ttep-name-col-desktop: 150px;
    --ttep-name-col-tablet: 116px;
    --ttep-name-col-mobile: 86px;
    --ttep-row-height-mobile: 54px;
}

.ttep-app,
.ttep-page {
    max-width: 1280px;
    margin: 0 auto;
    color: var(--ttep-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ttep-page {
    max-width: 1040px;
}

.ttep-muted,
.ttep-help {
    color: var(--ttep-muted);
}

.ttep-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
}

.ttep-top,
.ttep-page-head,
.ttep-dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.ttep-top h1,
.ttep-page h1,
.ttep-dashboard-hero h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.ttep-page-head p,
.ttep-dashboard-hero p {
    margin: 6px 0 0;
}

.ttep-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Calendario: controles más compactos */
.ttep-controls select {
    min-height: 36px;
    padding: 6px 12px;
}

.ttep-controls button {
    min-height: 36px;
    padding: 6px 14px;
}

.ttep-controls select,
.ttep-controls button,
.ttep-form-card input,
.ttep-form-card select,
.ttep-history-filters input,
.ttep-history-filters select,
.ttep-profile-card input,
.ttep-profile-card select {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: var(--ttep-text);
    font-size: 14px;
    box-sizing: border-box;
}

.ttep-controls button,
.ttep-primary-button,
.ttep-secondary-button,
#ttep-save-profile {
    appearance: none;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.ttep-controls button:hover,
.ttep-secondary-button:hover {
    border-color: #9ca3af;
}

.ttep-primary-button,
#ttep-save-profile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    gap: 6px;
    padding: 11px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--ttep-blue);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.ttep-primary-button:hover,
#ttep-save-profile:hover {
    background: var(--ttep-blue-dark);
    color: #fff;
    transform: translateY(-1px);
}

.ttep-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    gap: 6px;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: var(--ttep-text);
    font-weight: 700;
    cursor: pointer;
}

.ttep-scroll,
.ttep-table-wrap {
    overflow: auto;
    border: 1px solid var(--ttep-border);
    border-radius: var(--ttep-radius);
    background: var(--ttep-card);
    box-shadow: var(--ttep-shadow);
    -webkit-overflow-scrolling: touch;
}

.ttep-scroll::after {
    content: "";
    display: block;
    height: 1px;
}

.ttep-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: separate;
    border-spacing: 0;
}

.ttep-table th,
.ttep-table td {
    padding: 10px;
    border-right: 1px solid var(--ttep-border);
    border-bottom: 1px solid var(--ttep-border);
    text-align: center;
    vertical-align: middle;
}

.ttep-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
}

.ttep-person-head,
.ttep-person {
    position: sticky;
    left: 0;
    z-index: 6;
    min-width: var(--ttep-name-col-desktop);
    max-width: var(--ttep-name-col-desktop);
    background: #fff;
}

.ttep-person-head {
    text-align: left;
}

.ttep-person {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.ttep-person img,
.ttep-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
}

.ttep-person b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ttep-date-head {
    line-height: 1.15;
}

.ttep-date-head small {
    display: block;
    max-width: 88px;
    margin-top: 4px;
    color: var(--ttep-muted);
    font-size: 11px;
    line-height: 1.15;
}

.ttep-cell button {
    width: 58px;
    height: 46px;
    border: 0;
    border-radius: 10px;
    font-size: 22px;
    cursor: default;
}

.ttep-cell .dashicons {
    width: 22px;
    height: 22px;
    font-size: 22px;
    line-height: 22px;
}

.ttep-cell.office button { background: #eaf2ff; }
.ttep-cell.remote button { background: #eaf8ec; }
.ttep-cell.vacation button { background: #fff3df; }
.ttep-cell.sick button { background: #fee2e2; }
.ttep-cell.permit button { background: #f1e8ff; }
.ttep-cell.holiday button { background: #fce7f3; }
.ttep-cell.weekend button { background: #f3f4f6; }

.ttep-cell.office .dashicons { color: var(--ttep-blue); }
.ttep-cell.remote .dashicons { color: var(--ttep-green); }
.ttep-cell.vacation .dashicons { color: var(--ttep-orange); }
.ttep-cell.sick .dashicons { color: var(--ttep-red); }
.ttep-cell.permit .dashicons { color: var(--ttep-purple); }
.ttep-cell.weekend .dashicons { color: var(--ttep-gray); }

.ttep-cell.editable button {
    cursor: pointer;
}

.ttep-cell.editable button:hover,
.ttep-cell.editable button:focus {
    outline: 2px solid var(--ttep-blue);
    outline-offset: 2px;
}

.ttep-summary-row th,
.ttep-summary-row td {
    background: #fbfdff;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.ttep-panels,
.ttep-dashboard-grid,
.ttep-stat-grid,
.ttep-leave-layout {
    display: grid;
    gap: 16px;
}

.ttep-panels {
    grid-template-columns: 1fr 1fr;
    margin-top: 18px;
}

.ttep-panels-two {
    grid-template-columns: 1fr 1fr;
}

.ttep-panel,
.ttep-form-card,
.ttep-preview-card,
.ttep-profile-card,
.ttep-stat-card {
    border: 1px solid var(--ttep-border);
    border-radius: var(--ttep-radius);
    background: var(--ttep-card);
    box-shadow: var(--ttep-shadow);
}

.ttep-panel,
.ttep-form-card,
.ttep-preview-card,
.ttep-profile-card {
    padding: 20px;
}

.ttep-panel h2,
.ttep-preview-card h2 {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.2;
}

.ttep-log-list,
.ttep-clean-list,
.ttep-team-today {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ttep-log-list li,
.ttep-clean-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--ttep-border);
}

.ttep-log-list li:last-child,
.ttep-clean-list li:last-child {
    border-bottom: 0;
}

.ttep-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, .45);
}

.ttep-card {
    position: relative;
    width: min(430px, 100%);
    padding: 20px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.ttep-card h2 {
    margin: 0 0 14px;
    padding-right: 32px;
}

.ttep-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.ttep-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.ttep-status-grid button {
    min-height: 48px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    cursor: pointer;
}

.ttep-ok,
.ttep-error {
    padding: 10px 12px;
    margin-top: 12px;
    border-radius: 10px;
}

.ttep-ok {
    background: #dcfce7;
    color: #166534;
}

.ttep-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Dashboard */
.ttep-dashboard-hero {
    padding: 24px;
    border: 1px solid var(--ttep-border);
    border-radius: 22px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 62%);
    box-shadow: var(--ttep-shadow);
}

.ttep-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.ttep-stat-card {
    padding: 18px;
    text-align: center;
}

.ttep-stat-card span {
    display: block;
    margin-bottom: 8px;
    font-size: 28px;
}

.ttep-stat-card strong {
    display: block;
    font-size: 26px;
    line-height: 1;
}

.ttep-stat-card small {
    display: block;
    margin-top: 8px;
    color: var(--ttep-muted);
}

.ttep-dashboard-grid {
    grid-template-columns: 1.1fr 1fr 1fr;
}

.ttep-team-today li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ttep-border);
}

.ttep-team-today li:last-child {
    border-bottom: 0;
}

.ttep-team-today img,
.ttep-team-today .ttep-avatar-fallback {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
}

.ttep-team-today small {
    display: block;
    margin-top: 2px;
    color: var(--ttep-muted);
}

/* Profile */
.ttep-profile-page {
    max-width: 640px;
}

.ttep-profile-card-pro {
    padding: 30px;
    border-radius: 22px;
}

.ttep-profile-avatar {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.ttep-profile-avatar img {
    width: 128px;
    height: 128px;
    border: 4px solid #f3f4f6;
    border-radius: 50%;
    object-fit: cover;
}

.ttep-form-grid-single {
    display: grid;
    gap: 8px;
}

.ttep-form-grid-single label,
.ttep-form-card label {
    display: block;
    margin-top: 10px;
    color: var(--ttep-text);
    font-weight: 700;
}

.ttep-form-grid-single input,
.ttep-form-card input,
.ttep-form-card select,
.ttep-history-filters input,
.ttep-history-filters select {
    width: 100%;
}

.ttep-form-grid-single input:focus,
.ttep-form-card input:focus,
.ttep-form-card select:focus,
.ttep-history-filters input:focus,
.ttep-history-filters select:focus {
    outline: none;
    border-color: var(--ttep-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.ttep-upload-row input[type="file"] {
    width: 100%;
    padding: 11px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

/* Leave */
.ttep-leave-layout {
    grid-template-columns: minmax(0, 560px) minmax(280px, 1fr);
    align-items: start;
}

.ttep-form-card-large {
    max-width: 100%;
}

.ttep-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ttep-preview-card {
    position: sticky;
    top: 40px;
}

/* History */
.ttep-history-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 160px 160px auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

.ttep-history-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
}

.ttep-history-table th,
.ttep-history-table td {
    padding: 12px;
    border-bottom: 1px solid var(--ttep-border);
    text-align: left;
}

.ttep-history-table th {
    background: var(--ttep-soft);
    font-weight: 700;
}


.ttep-dashboard-title {
    width: 100%;
}

.ttep-dashboard-date-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.ttep-dashboard-date-row p {
    margin: 6px 0 0;
}

.ttep-calendar-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--ttep-blue);
    color: #fff !important;
    text-decoration: none;
    font-size: 22px;
    flex-shrink: 0;
}


/* iPad / tablet */
@media (max-width: 1024px) {
    .ttep-app,
    .ttep-page {
        max-width: 100%;
    }

    .ttep-dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ttep-dashboard-grid .ttep-panel:first-child {
        grid-column: 1 / -1;
    }

    .ttep-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ttep-table {
        min-width: 960px;
    }

    .ttep-person-head,
    .ttep-person {
        min-width: var(--ttep-name-col-tablet);
        max-width: var(--ttep-name-col-tablet);
    }

    .ttep-leave-layout {
        grid-template-columns: 1fr;
    }

    .ttep-preview-card {
        position: static;
    }

    .ttep-history-filters {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile */
@media (max-width: 760px) {
    .ttep-app,
    .ttep-page {
        padding: 0 2px;
    }

    .ttep-top,
    .ttep-page-head,
    .ttep-dashboard-hero {
        display: block;
    }

    .ttep-top h1,
    .ttep-page h1,
    .ttep-dashboard-hero h1 {
        font-size: 25px;
    }

    .ttep-controls {
        display: grid;
        grid-template-columns: 1fr 1fr auto;
        gap: 8px;
        margin-top: 12px;
    }

    .ttep-controls select,
    .ttep-controls button {
        width: 100%;
        min-height: 40px;
        padding: 8px 10px;
    }

    .ttep-table {
        min-width: 672px;
    }

    .ttep-table th,
    .ttep-table td {
        padding: 6px;
    }

    .ttep-table thead th {
        height: 56px;
        min-height: 56px;
        padding: 4px !important;
    }

    .ttep-date-head {
        font-size: 13px;
        line-height: .9;
    }

    .ttep-date-head b {
        display: block;
        margin-bottom: 2px;
    }

    .ttep-date-head small {
        display: none;
    }

    .ttep-person-head,
    .ttep-person {
        width: var(--ttep-name-col-mobile);
        min-width: var(--ttep-name-col-mobile);
        max-width: var(--ttep-name-col-mobile);
    }

    .ttep-person-head {
        padding: 4px !important;
        text-align: center !important;
        font-size: 13px;
    }

    .ttep-person {
        min-height: 58px;
        gap: 6px;
        padding: 6px 4px;
        overflow: hidden;
        font-size: 13px;
        line-height: 1.05;
    }

    .ttep-person img,
    .ttep-avatar-fallback {
        width: 28px;
        height: 28px;
        flex: 0 0 28px;
    }

    .ttep-person b {
        font-size: 13px;
    }

    .ttep-cell {
        height: var(--ttep-row-height-mobile);
    }

    .ttep-cell button {
        width: 42px;
        height: 34px;
        border-radius: 9px;
        font-size: 16px;
    }

    .ttep-cell .dashicons {
        width: 18px;
        height: 18px;
        font-size: 18px;
        line-height: 18px;
    }

    .ttep-summary-row th,
    .ttep-summary-row td {
        font-size: 12px;
    }

    .ttep-panels,
    .ttep-panels-two,
    .ttep-dashboard-grid,
    .ttep-stat-grid,
    .ttep-form-grid,
    .ttep-history-filters {
        grid-template-columns: 1fr;
    }

    .ttep-panel,
    .ttep-form-card,
    .ttep-preview-card,
    .ttep-profile-card {
        padding: 16px;
        border-radius: 14px;
    }

    .ttep-dashboard-hero {
        padding: 18px;
        border-radius: 18px;
    }

    .ttep-dashboard-hero .ttep-primary-button {
        width: 100%;
        margin-top: 14px;
    }

    .ttep-stat-card {
        padding: 16px;
    }

    .ttep-profile-card-pro {
        padding: 20px;
    }

    .ttep-profile-avatar img {
        width: 104px;
        height: 104px;
    }

    .ttep-status-grid {
        grid-template-columns: 1fr;
    }

    .ttep-history-table {
        min-width: 720px;
    }
}

@media (max-width: 390px) {
    :root {
        --ttep-name-col-mobile: 80px;
    }

    .ttep-table {
        min-width: 638px;
    }

    .ttep-cell button {
        width: 38px;
    }

    .ttep-person img,
    .ttep-avatar-fallback {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
    }
}

/* Version 5.1: notificaciones preparadas en modo administradora */
.ttep-notifications-admin .ttep-panel {
    max-width: 980px;
}

.ttep-notification-type {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.ttep-notification-list-admin li {
    line-height: 1.45;
}

/* Version 6.0: vista Hoy, resumen por persona y bloqueo/copia de meses */
.ttep-warning-box {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid #facc15;
    border-radius: 12px;
    background: #fef9c3;
    color: #854d0e;
}

.ttep-calendar-tools {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 14px;
}

.ttep-calendar-tools form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ttep-inline-date-form,
.ttep-summary-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ttep-inline-date-form input,
.ttep-summary-filters select {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: var(--ttep-text);
}

.ttep-today-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.ttep-summary-filters {
    margin-bottom: 16px;
}

.ttep-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ttep-summary-card {
    padding: 20px;
    border: 1px solid var(--ttep-border);
    border-radius: var(--ttep-radius);
    background: #fff;
    box-shadow: var(--ttep-shadow);
}

.ttep-summary-person {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ttep-summary-person img,
.ttep-summary-person .ttep-avatar-fallback {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 50%;
}

.ttep-summary-person h2 {
    margin: 0;
    font-size: 20px;
}

.ttep-summary-person p {
    margin: 2px 0 0;
}

.ttep-summary-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ttep-summary-metrics span {
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    text-align: center;
}

.ttep-summary-metrics b {
    display: block;
    font-size: 22px;
    line-height: 1;
}

.ttep-summary-metrics small {
    display: block;
    margin-top: 6px;
    color: var(--ttep-muted);
    font-size: 12px;
}

@media (max-width: 1024px) {
    .ttep-today-grid,
    .ttep-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .ttep-calendar-tools {
        justify-content: stretch;
    }

    .ttep-calendar-tools form,
    .ttep-calendar-tools button,
    .ttep-inline-date-form,
    .ttep-inline-date-form input,
    .ttep-inline-date-form button,
    .ttep-summary-filters,
    .ttep-summary-filters select,
    .ttep-summary-filters button {
        width: 100%;
    }

    .ttep-today-grid,
    .ttep-summary-grid,
    .ttep-summary-metrics {
        grid-template-columns: 1fr;
    }
}

/* Version 7.0: planning, balance, assistant, comments, search, exports, trash and versions */
.ttep-wide-page { max-width: 1280px; }
.ttep-page-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:18px; }
.ttep-inline-form { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.ttep-inline-form input,
.ttep-inline-form select,
.ttep-search-form input,
.ttep-form-card textarea { padding:10px 12px; border:1px solid #d1d5db; border-radius:10px; background:#fff; box-sizing:border-box; }
.ttep-search-form { display:flex; gap:10px; margin:0 0 18px; }
.ttep-search-form input { flex:1; min-width:220px; }
.ttep-grid-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.ttep-card-lite { background:#fff; border:1px solid var(--ttep-border); border-radius:16px; padding:18px; }
.ttep-card-lite h2 { margin:0 0 12px; font-size:20px; }
.ttep-bar { height:8px; background:#eef2ff; border-radius:999px; overflow:hidden; margin:6px 0 12px; }
.ttep-bar span { display:block; height:100%; background:var(--ttep-blue); border-radius:999px; }
.ttep-alert-list { list-style:none; padding:0; margin:0; }
.ttep-alert-list li { padding:10px 12px; margin-bottom:8px; border-radius:10px; }
.ttep-alert-list li.warn { background:#fff7ed; color:#9a3412; border:1px solid #fed7aa; }
.ttep-alert-list li.ok { background:#ecfdf5; color:#166534; border:1px solid #bbf7d0; }
.ttep-comment-list { list-style:none; padding:0; margin:0; }
.ttep-comment-list li { padding:12px; border:1px solid var(--ttep-border); border-radius:12px; margin-bottom:10px; background:#fff; }
.ttep-mt { margin-top:18px; }
/* Planificación semanal: columna de persona compacta y estable */
.ttep-week-table {
    width: 100%;
    min-width: 760px;
    table-layout: fixed;
}

.ttep-week-table .ttep-week-person-col {
    width: 180px;
}

.ttep-week-table .ttep-week-day-col {
    width: calc((100% - 180px) / 5);
}

.ttep-week-table .ttep-person-head,
.ttep-week-table .ttep-person {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
}

.ttep-week-table .ttep-person {
    box-sizing: border-box;
}

.ttep-week-table .ttep-cell {
    text-align: center;
}
@media print {
    #adminmenumain, #wpadminbar, .ttep-controls, .ttep-primary-button, .ttep-secondary-button, .notice, .update-nag { display:none!important; }
    .wrap, .ttep-page, .ttep-app { margin:0!important; max-width:none!important; }
    .ttep-scroll, .ttep-table-wrap { overflow:visible!important; border:0!important; }
    .ttep-table, .ttep-history-table { min-width:0!important; font-size:11px; }
}
@media (max-width: 980px) {
    .ttep-grid-cards { grid-template-columns:1fr 1fr; }
    .ttep-page-head { display:block; }
    .ttep-inline-form { margin-top:12px; }
}
@media (max-width: 760px) {
    .ttep-grid-cards { grid-template-columns:1fr; }
    .ttep-search-form { display:block; }
    .ttep-search-form input { width:100%; margin-bottom:10px; }
    .ttep-week-table {
        min-width: 620px;
    }

    .ttep-week-table .ttep-week-person-col {
        width: 92px;
    }

    .ttep-week-table .ttep-week-day-col {
        width: calc((100% - 92px) / 5);
    }

    .ttep-week-table .ttep-person-head,
    .ttep-week-table .ttep-person {
        width: 92px;
        min-width: 92px;
        max-width: 92px;
    }
}

/* Version 8.0: dashboard moderno, anual, auditoría, simulador, modo oscuro y PWA */
.ttep-kicker {
    display: inline-flex;
    margin-bottom: 6px;
    color: var(--ttep-blue);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ttep-v8-hero {
    align-items: flex-start;
    padding: 8px 0 4px;
}

.ttep-dashboard-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ttep-v8-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
}

.ttep-v8-sidebar {
    display: grid;
    gap: 14px;
    align-content: start;
}

.ttep-v8-stat-grid {
    margin-bottom: 18px;
}

.ttep-stat-card.is-office span,
.ttep-stat-card.is-office small { color: var(--ttep-blue); }
.ttep-stat-card.is-remote span,
.ttep-stat-card.is-remote small { color: var(--ttep-green); }
.ttep-stat-card.is-away span,
.ttep-stat-card.is-away small { color: var(--ttep-orange); }
.ttep-stat-card.is-ok span,
.ttep-stat-card.is-ok small { color: var(--ttep-green); }
.ttep-stat-card.is-warning span,
.ttep-stat-card.is-warning small { color: var(--ttep-red); }

.ttep-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.ttep-panel-head h2 { margin: 0; }

.ttep-team-chips {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.ttep-team-chip {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 18px 10px;
    border: 1px solid var(--ttep-border);
    border-radius: 16px;
    background: #fff;
}

.ttep-team-chip img,
.ttep-team-chip .ttep-avatar-fallback {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
}

.ttep-team-chip small { color: var(--ttep-muted); }
.ttep-team-chip.remote small { color: var(--ttep-green); }
.ttep-team-chip.office small { color: var(--ttep-blue); }
.ttep-team-chip.vacation small,
.ttep-team-chip.sick small,
.ttep-team-chip.permit small { color: var(--ttep-orange); }

.ttep-v8-cards {
    grid-template-columns: 1fr 1fr;
    margin-top:12px;
}

.ttep-mini-table {
    width: 100%;
    border-collapse: collapse;
}

.ttep-mini-table th,
.ttep-mini-table td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--ttep-border);
    text-align: left;
}

.ttep-mini-table th {
    color: var(--ttep-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.ttep-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ttep-quick-grid a {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 88px;
    padding: 12px;
    border: 1px solid var(--ttep-border);
    border-radius: 14px;
    background: #fff;
    color: var(--ttep-text);
    text-decoration: none;
    font-weight: 700;
}

.ttep-annual-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.ttep-annual-card {
    display: block;
    min-height: 120px;
    padding: 18px;
    border: 1px solid var(--ttep-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--ttep-shadow);
    text-decoration: none;
    color: var(--ttep-text);
}

.ttep-annual-card strong {
    display: block;
    font-size: 20px;
    margin-bottom: 4px;
}

.ttep-annual-card > span {
    color: var(--ttep-muted);
}

.ttep-annual-metrics {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.ttep-annual-metrics small {
    padding: 5px 8px;
    border-radius: 999px;
    background: #f3f4f6;
}

.ttep-simulation-result {
    margin-top: 18px;
}


@media (max-width: 1024px) {
    .ttep-v8-layout {
        grid-template-columns: 1fr;
    }
    .ttep-v8-sidebar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .ttep-annual-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .ttep-v8-hero,
    .ttep-page-head {
        display: block;
    }
    .ttep-dashboard-actions {
        margin-top: 12px;
    }
    .ttep-team-chips,
    .ttep-v8-cards,
    .ttep-v8-sidebar,
    .ttep-annual-grid {
        grid-template-columns: 1fr;
    }
    .ttep-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Version 8.1: pulido visual profesional */
:root {
    --ttep-bg: #f4f7fb;
    --ttep-card: #ffffff;
    --ttep-border: #e6ebf2;
    --ttep-shadow: 0 14px 36px rgba(15, 23, 42, .07);
    --ttep-shadow-soft: 0 8px 24px rgba(15, 23, 42, .05);
    --ttep-radius: 18px;
}

body.wp-admin.toplevel_page_ttep-dashboard,
body.wp-admin.teletrabajo_page_ttep-calendar,
body.wp-admin.teletrabajo_page_ttep-today,
body.wp-admin.teletrabajo_page_ttep-annual,
body.wp-admin.teletrabajo_page_ttep-summary,
body.wp-admin.teletrabajo_page_ttep-weekly,
body.wp-admin.teletrabajo_page_ttep-balance,
body.wp-admin.teletrabajo_page_ttep-assistant,
body.wp-admin.teletrabajo_page_ttep-search,
body.wp-admin.teletrabajo_page_ttep-leave,
body.wp-admin.teletrabajo_page_ttep-history,
body.wp-admin.teletrabajo_page_ttep-comments,
body.wp-admin.teletrabajo_page_ttep-export,
body.wp-admin.teletrabajo_page_ttep-trash,
body.wp-admin.teletrabajo_page_ttep-versions,
body.wp-admin.teletrabajo_page_ttep-audit,
body.wp-admin.teletrabajo_page_ttep-simulation,
body.wp-admin.teletrabajo_page_ttep-profile {
    background: var(--ttep-bg);
}

.ttep-app,
.ttep-page {
    width: min(1240px, calc(100vw - 56px));
    max-width: 1240px;
}

.wrap .ttep-page,
.wrap .ttep-app {
    margin-top: 8px;
}

.ttep-page-head,
.ttep-top,
.ttep-dashboard-hero {
    margin-bottom: 14px;
}

.ttep-page h1,
.ttep-top h1,
.ttep-dashboard-hero h1 {
    font-size: clamp(26px, 2.2vw, 34px);
    font-weight: 760;
    letter-spacing: -0.035em;
}

.ttep-dashboard-v8 {
    padding-bottom: 36px;
}

.ttep-dashboard-hero.ttep-v8-hero {
    position: relative;
    display: flex;
    align-items: center;
    padding: 18px 22px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 10% 0%, rgba(37, 99, 235, .11), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: var(--ttep-shadow);
    overflow: hidden;
}

.ttep-dashboard-hero.ttep-v8-hero::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -110px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(37, 99, 235, .07);
    pointer-events: none;
}

.ttep-kicker {
    margin-bottom: 8px;
    font-size: 12px;
    letter-spacing: .08em;
}

.ttep-dashboard-actions {
    position: relative;
    z-index: 1;
}

.ttep-v8-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
}

.ttep-panels,
.ttep-dashboard-grid,
.ttep-stat-grid,
.ttep-leave-layout,
.ttep-v8-sidebar,
.ttep-v8-cards,
.ttep-team-chips {
    gap: 14px;
}

.ttep-panel,
.ttep-form-card,
.ttep-preview-card,
.ttep-profile-card,
.ttep-stat-card,
.ttep-card-lite,
.ttep-summary-card,
.ttep-annual-card {
    border-color: var(--ttep-border);
    box-shadow: var(--ttep-shadow-soft);
}

.ttep-panel,
.ttep-form-card,
.ttep-preview-card,
.ttep-profile-card {
    padding: 18px;
}

.ttep-panel h2,
.ttep-preview-card h2,
.ttep-card-lite h2 {
    font-size: 19px;
    font-weight: 760;
    letter-spacing: -0.02em;
}

.ttep-v8-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
}

.ttep-stat-card {
    min-height: 118px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
}

.ttep-stat-card span {
    margin-bottom: 4px;
    font-size: 26px;
    line-height: 1;
}

.ttep-stat-card strong {
    font-size: 27px;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.ttep-stat-card small {
    margin-top: 7px;
    font-size: 13px;
}

.ttep-stat-card.is-office { background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%); }
.ttep-stat-card.is-remote { background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%); }
.ttep-stat-card.is-away { background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%); }
.ttep-stat-card.is-ok { background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%); }
.ttep-stat-card.is-warning { background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%); }

.ttep-v8-team-panel {
    padding: 18px 20px;
}

.ttep-team-chip {
    gap: 8px;
    padding: 14px 10px;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.ttep-team-chip img,
.ttep-team-chip .ttep-avatar-fallback {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
}

.ttep-team-chip b {
    font-size: 14px;
}

.ttep-team-chip small {
    font-size: 13px;
}

.ttep-v8-cards {
    grid-template-columns: 1fr 1fr;
}

.ttep-mini-table th,
.ttep-mini-table td {
    padding: 8px 8px;
}

.ttep-quick-grid {
    gap: 8px;
}

.ttep-quick-grid a {
    min-height: 78px;
    padding: 10px 8px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.ttep-quick-grid a:hover {
    border-color: #bfdbfe;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .08);
    transform: translateY(-2px);
}

.ttep-quick-grid a > span {
    font-size: 13px;
}

.ttep-v8-sidebar {
    gap: 14px;
}

.ttep-v8-sidebar .ttep-panel {
    padding: 18px;
}

.ttep-ok,
.ttep-error,
.ttep-warning-box {
    border-radius: 12px;
}

.ttep-clean-list li,
.ttep-log-list li {
    padding: 9px 0;
}

.ttep-primary-button,
.ttep-secondary-button,
#ttep-save-profile {
    border-radius: 12px;
}

.ttep-primary-button {
    box-shadow: 0 10px 20px rgba(37, 99, 235, .18);
}

.ttep-scroll,
.ttep-table-wrap {
    border-radius: 18px;
}

.ttep-table th,
.ttep-table td {
    padding: 9px;
}

.ttep-cell button {
    width: 54px;
    height: 42px;
    border-radius: 12px;
}

.ttep-profile-page {
    max-width: 620px;
}

.ttep-profile-card-pro {
    padding: 28px;
}

.ttep-profile-avatar img {
    width: 120px;
    height: 120px;
}

/* Tablet polish */
@media (max-width: 1024px) {
    .ttep-app,
    .ttep-page {
        width: calc(100vw - 36px);
    }

    .ttep-v8-layout {
        grid-template-columns: 1fr;
    }

    .ttep-v8-sidebar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ttep-v8-stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .ttep-stat-card {
        min-height: 108px;
    }

    .ttep-team-chips {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .ttep-v8-stat-grid,
    .ttep-team-chips,
    .ttep-v8-cards,
    .ttep-v8-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile polish */


@media (max-width: 760px) {
    .ttep-app,
    .ttep-page {
        width: calc(100vw - 20px);
        padding: 0;
    }

    .wrap .ttep-page,
    .wrap .ttep-app {
        margin-top: 2px;
    }

    .ttep-dashboard-hero.ttep-v8-hero,
    .ttep-page-head,
    .ttep-top {
        padding: 16px;
        border-radius: 20px;
    }

    .ttep-dashboard-hero.ttep-v8-hero {
        display: block;
    }

    .ttep-dashboard-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 14px;
    }

    .ttep-dashboard-actions .ttep-primary-button,
    .ttep-dashboard-actions .ttep-secondary-button {
        width: 100%;
    }

    .ttep-v8-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .ttep-stat-card {
        min-height: 96px;
        padding: 13px 10px;
    }

    .ttep-stat-card span {
        font-size: 22px;
    }

    .ttep-stat-card strong {
        font-size: 24px;
    }

    .ttep-panel,
    .ttep-form-card,
    .ttep-preview-card,
    .ttep-profile-card {
        padding: 15px;
        border-radius: 16px;
    }

    .ttep-panel-head {
        align-items: flex-start;
    }

    .ttep-team-chips,
    .ttep-v8-cards,
    .ttep-v8-sidebar,
    .ttep-quick-grid {
        grid-template-columns: 1fr;
    }

    .ttep-team-chip {
        grid-template-columns: 42px 1fr;
        justify-items: start;
        align-items: center;
        text-align: left;
        padding: 12px;
    }

    .ttep-team-chip img,
    .ttep-team-chip .ttep-avatar-fallback {
        grid-row: span 2;
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .ttep-team-chip small {
        margin-top: -6px;
    }

    .ttep-quick-grid a {
        min-height: auto;
        grid-template-columns: 28px 1fr;
        justify-items: start;
        padding: 13px;
        text-align: left;
    }

    .ttep-mini-table {
        font-size: 13px;
    }

    .ttep-mini-table th,
    .ttep-mini-table td {
        padding: 8px 6px;
    }

    .ttep-profile-card-pro {
        padding: 20px;
    }

    .ttep-profile-avatar img {
        width: 98px;
        height: 98px;
    }
}

@media (max-width: 390px) {
    .ttep-v8-stat-grid {
        grid-template-columns: 1fr;
    }
    
    
    
}


/* Version 8.2: boton Hoy inteligente y modo oscuro redisenado */
.ttep-is-today.ttep-date-head {
    box-shadow: inset 0 -3px 0 var(--ttep-blue);
}

.ttep-is-today.ttep-date-head b,
.ttep-is-today.ttep-day-summary {
    color: var(--ttep-blue);
}

.ttep-cell.ttep-is-today button {
    outline: 2px solid rgba(37, 99, 235, .32);
    outline-offset: 2px;
}

.ttep-today-pulse button,
.ttep-today-pulse.ttep-date-head,
.ttep-today-pulse.ttep-day-summary {
    animation: ttepTodayPulse 1.1s ease-out;
}

@keyframes ttepTodayPulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .45); }
    100% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
}

.ttep-day-detail > b {
    display: block;
    margin-bottom: 12px;
}

.ttep-day-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ttep-day-detail-grid div {
    padding: 12px;
    border: 1px solid var(--ttep-border);
    border-radius: 12px;
    background: var(--ttep-soft);
}

.ttep-day-detail-grid span,
.ttep-day-detail-grid small {
    display: block;
    color: var(--ttep-muted);
}

.ttep-day-detail-grid strong {
    display: block;
    margin: 5px 0;
    font-size: 24px;
    line-height: 1;
}

@media (max-width: 760px) {
    .ttep-day-detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

body.ttep-dark-mode {
    --ttep-bg: #0b1220;
    --ttep-card: #111827;
    --ttep-border: #263244;
    --ttep-text: #f8fafc;
    --ttep-muted: #a8b3c7;
    --ttep-soft: #172033;
    --ttep-shadow: 0 14px 36px rgba(0, 0, 0, .22);
    --ttep-shadow-soft: 0 8px 24px rgba(0, 0, 0, .18);
    background: var(--ttep-bg) !important;
    color: var(--ttep-text) !important;
}

body.ttep-dark-mode.wp-admin.toplevel_page_ttep-dashboard,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-calendar,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-today,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-annual,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-summary,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-weekly,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-balance,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-assistant,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-search,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-leave,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-history,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-comments,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-export,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-trash,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-versions,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-audit,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-simulation,
body.ttep-dark-mode.wp-admin.teletrabajo_page_ttep-profile {
    background: var(--ttep-bg) !important;
}

body.ttep-dark-mode #wpcontent,
body.ttep-dark-mode #wpbody-content,
body.ttep-dark-mode .wrap,
body.ttep-dark-mode .ttep-page,
body.ttep-dark-mode .ttep-app,
body.ttep-dark-mode .ttep-page h1,
body.ttep-dark-mode .ttep-top h1,
body.ttep-dark-mode .ttep-dashboard-hero h1,
body.ttep-dark-mode .ttep-panel h2,
body.ttep-dark-mode .ttep-preview-card h2,
body.ttep-dark-mode .ttep-card-lite h2,
body.ttep-dark-mode .ttep-clean-list,
body.ttep-dark-mode .ttep-log-list,
body.ttep-dark-mode label {
    color: var(--ttep-text) !important;
}

body.ttep-dark-mode .ttep-dashboard-hero.ttep-v8-hero,
body.ttep-dark-mode .ttep-panel,
body.ttep-dark-mode .ttep-form-card,
body.ttep-dark-mode .ttep-preview-card,
body.ttep-dark-mode .ttep-profile-card,
body.ttep-dark-mode .ttep-stat-card,
body.ttep-dark-mode .ttep-card-lite,
body.ttep-dark-mode .ttep-summary-card,
body.ttep-dark-mode .ttep-annual-card,
body.ttep-dark-mode .ttep-team-chip,
body.ttep-dark-mode .ttep-scroll,
body.ttep-dark-mode .ttep-table-wrap,
body.ttep-dark-mode .ttep-quick-grid a,
body.ttep-dark-mode .ttep-card {
    background: var(--ttep-card) !important;
    border-color: var(--ttep-border) !important;
    color: var(--ttep-text) !important;
    box-shadow: var(--ttep-shadow-soft);
}

body.ttep-dark-mode .ttep-dashboard-hero.ttep-v8-hero {
    background:
        radial-gradient(circle at 10% 0%, rgba(96, 165, 250, .18), transparent 28%),
        linear-gradient(135deg, #111827 0%, #0b1220 100%) !important;
}

body.ttep-dark-mode .ttep-table thead th,
body.ttep-dark-mode .ttep-person-head,
body.ttep-dark-mode .ttep-person,
body.ttep-dark-mode .ttep-summary-row th,
body.ttep-dark-mode .ttep-summary-row td,
body.ttep-dark-mode .ttep-history-table th,
body.ttep-dark-mode .ttep-mini-table th {
    background: #101827 !important;
    color: var(--ttep-text) !important;
}

body.ttep-dark-mode .ttep-table th,
body.ttep-dark-mode .ttep-table td,
body.ttep-dark-mode .ttep-mini-table th,
body.ttep-dark-mode .ttep-mini-table td,
body.ttep-dark-mode .ttep-history-table th,
body.ttep-dark-mode .ttep-history-table td,
body.ttep-dark-mode .ttep-log-list li,
body.ttep-dark-mode .ttep-clean-list li,
body.ttep-dark-mode .ttep-team-today li,
body.ttep-dark-mode .ttep-comment-list li {
    border-color: var(--ttep-border) !important;
}

body.ttep-dark-mode .ttep-muted,
body.ttep-dark-mode .ttep-help,
body.ttep-dark-mode .ttep-date-head small,
body.ttep-dark-mode .ttep-team-chip small,
body.ttep-dark-mode .ttep-stat-card small,
body.ttep-dark-mode .ttep-mini-table th {
    color: var(--ttep-muted) !important;
}

body.ttep-dark-mode input,
body.ttep-dark-mode select,
body.ttep-dark-mode textarea,
body.ttep-dark-mode .ttep-controls select,
body.ttep-dark-mode .ttep-controls button,
body.ttep-dark-mode .ttep-secondary-button,
body.ttep-dark-mode .ttep-status-grid button,
body.ttep-dark-mode .ttep-upload-row input[type="file"] {
    background: #0b1220 !important;
    border-color: #334155 !important;
    color: var(--ttep-text) !important;
}

body.ttep-dark-mode .ttep-cell.office button { background: #172a49; }
body.ttep-dark-mode .ttep-cell.remote button { background: #12311f; }
body.ttep-dark-mode .ttep-cell.vacation button { background: #3a2910; }
body.ttep-dark-mode .ttep-cell.sick button { background: #3b171d; }
body.ttep-dark-mode .ttep-cell.permit button { background: #2b2148; }
body.ttep-dark-mode .ttep-cell.holiday button { background: #451a35; }
body.ttep-dark-mode .ttep-cell.weekend button { background: #1f2937; }

body.ttep-dark-mode .ttep-stat-card.is-office,
body.ttep-dark-mode .ttep-stat-card.is-remote,
body.ttep-dark-mode .ttep-stat-card.is-away,
body.ttep-dark-mode .ttep-stat-card.is-ok,
body.ttep-dark-mode .ttep-stat-card.is-warning,
body.ttep-dark-mode .ttep-team-chip,
body.ttep-dark-mode .ttep-quick-grid a {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
}

body.ttep-dark-mode .ttep-day-detail-grid div,
body.ttep-dark-mode .ttep-summary-metrics span,
body.ttep-dark-mode .ttep-annual-metrics small,
body.ttep-dark-mode .ttep-comment-list li {
    background: var(--ttep-soft) !important;
    border-color: var(--ttep-border) !important;
    color: var(--ttep-text) !important;
}

body.ttep-dark-mode .ttep-ok {
    background: #12331f !important;
    color: #bbf7d0 !important;
}

body.ttep-dark-mode .ttep-error {
    background: #3b171d !important;
    color: #fecaca !important;
}

body.ttep-dark-mode .ttep-warning-box,
body.ttep-dark-mode .ttep-alert-list li.warn {
    background: #3a2910 !important;
    border-color: #854d0e !important;
    color: #fde68a !important;
}

body.ttep-dark-mode .ttep-alert-list li.ok {
    background: #12331f !important;
    border-color: #166534 !important;
    color: #bbf7d0 !important;
}

/* 1.0.3 LTS: modo aplicación para usuarios de equipo */
#wpadminbar #wp-admin-bar-ttep-app-title > .ab-item {
    font-weight: 700;
}
#wpadminbar #wp-admin-bar-ttep-app-title > .ab-item:before {
    color:#2563eb !important;
    content: "\f508";
    top: 2px;
}

/* Perfil: eliminar foto actual */
.ttep-remove-avatar {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: auto;
    max-width: max-content;
    margin: 18px 0 10px;
    padding: 10px 14px;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #f8fafc;
}

.ttep-remove-avatar input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

.ttep-remove-avatar label {
    margin: 0 !important;
    color: var(--ttep-text);
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

body.ttep-dark-mode .ttep-remove-avatar {
    background: var(--ttep-soft) !important;
    border-color: var(--ttep-border) !important;
}

body.ttep-dark-mode .ttep-remove-avatar label {
    color: var(--ttep-text) !important;
}


@media (max-width: 760px) {
    .ttep-v8-layout > main {
        display: flex;
        flex-direction: column;
    }

    .ttep-v8-team-panel {
        order: 1;
        margin-bottom: 20px;
    }

    .ttep-v8-stat-grid {
        order: 2;
    }

    .ttep-dashboard-grid {
        order: 3;
    }
}

@media (max-width: 760px) {

    .ttep-controls select,
    .ttep-controls button {
        min-height: 36px;
        padding: 0 12px;
        line-height: 36px;
        box-sizing: border-box;
    }

}

/* ==========================================================================
   WordPress application shell - solo usuarios de la app
   Requiere la clase body.ttep-app-shell desde admin_body_class.
   ========================================================================== */

body.ttep-app-shell #wpadminbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
}

body.ttep-app-shell #wpadminbar .ab-item,
body.ttep-app-shell #wpadminbar a {
    color: #2563eb !important;
}

body.ttep-app-shell #wpadminbar .ab-item:hover,
body.ttep-app-shell #wpadminbar a:hover {
    background: #f8fafc !important;
    color: #2563eb !important;
}

body.ttep-app-shell #adminmenu,
body.ttep-app-shell #adminmenuback,
body.ttep-app-shell #adminmenuwrap {
    background: #0d2b54 !important;
    border-right: 1px solid #111827;
}

body.ttep-app-shell #adminmenu a,
body.ttep-app-shell #adminmenu .wp-menu-name {
    color: #e5e7eb !important;
    font-weight: 500;
}

body.ttep-app-shell #adminmenu a:hover,
body.ttep-app-shell #adminmenu li.menu-top:hover > a {
    background: #4a73b5 !important;
    color: #ffffff !important;
}

body.ttep-app-shell #adminmenu .wp-menu-image:before {
    color: #cbd5e1 !important;
}

body.ttep-app-shell #adminmenu .current a,
body.ttep-app-shell #adminmenu .wp-has-current-submenu > a {
    background: #2563eb !important;
    color: #ffffff !important;
    font-weight: 600;
}

body.ttep-app-shell #adminmenu .current .wp-menu-image:before,
body.ttep-app-shell #adminmenu .wp-has-current-submenu .wp-menu-image:before {
    color: #ffffff !important;
}

body.ttep-app-shell #collapse-button {
    color: #e5e7eb !important;
}

body.ttep-app-shell #wpcontent {
    background: #f4f7fb !important;
}

/* Vista pública del dashboard */
.ttep-public-login {
    align-self: flex-start;
    text-decoration: none;
    white-space: nowrap;
}

.ttep-public-notice {
    margin: 0 0 20px;
}

@media (max-width: 700px) {
    .ttep-public-login {
        margin-top: 12px;
    }
}
