body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f7f7f9;
    color: #222;
}

header {
    background: #1f2937;
    color: white;
    padding: 16px 24px;
}

header h1 {
    margin: 0;
    font-size: 22px;
}

nav {
    margin-top: 10px;
}

nav a {
    color: white;
    text-decoration: none;
    margin-right: 16px;
    font-size: 14px;
}

main {
    padding: 24px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.ok {
    background: #dcfce7;
    color: #166534;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1400px;
}

.table-wrap {
    overflow-x: auto;
}

th, td {
    border: 1px solid #e5e7eb;
    padding: 8px;
    font-size: 13px;
    vertical-align: top;
}

th {
    background: #f3f4f6;
    text-align: left;
}

form.inline {
    display: inline;
}

input[type="text"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

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

.grid .full {
    grid-column: 1 / -1;
}

button,
.btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 13px;
}

button.secondary,
.btn.secondary {
    background: #6b7280;
}

button.green {
    background: #059669;
}

button.orange {
    background: #d97706;
}

.small-input {
    width: 110px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    background: white;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-box .label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.stat-box .value {
    font-size: 22px;
    font-weight: bold;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.badge-yes {
    background: #dcfce7;
    color: #166534;
}

.badge-no {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warn {
    background: #fef3c7;
    color: #92400e;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.filters-panel {
    position: relative;
}

.filters-panel > summary {
    list-style: none;
    cursor: pointer;
    background: #475569;
    color: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

.filters-panel > summary::-webkit-details-marker {
    display: none;
}

.filters-panel[open] > summary {
    background: #334155;
}

.filters-panel .filters-grid {
    margin-top: 10px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
}

.filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.row-highlight-ready {
    background: #f0fdf4;
}

.row-highlight-published {
    background: #eff6ff;
}
.tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.tab-link {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.tab-link.active {
    background: #2563eb;
    color: white;
}

.page-title {
    margin: 0 0 14px 0;
    font-size: 24px;
}

.page-subtitle {
    margin: 0 0 18px 0;
    color: #6b7280;
    font-size: 14px;
}

button.danger,
.btn.danger {
    background: #dc2626;
    color: white;
}

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

.calendar-toolbar h3 {
    margin: 0;
    text-transform: capitalize;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(90px, 1fr));
    gap: 8px;
}

.calendar-weekday {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 8px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.calendar-day {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-height: 120px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-day.empty {
    background: transparent;
    border: none;
}

.calendar-day-number {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
}

.calendar-event {
    width: 100%;
    text-align: left;
    background: #dbeafe;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 6px;
    font-size: 12px;
}

.calendar-event:hover {
    background: #bfdbfe;
}

.calendar-event-default {
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #bfdbfe;
}

.calendar-event-default:hover {
    background: #bfdbfe;
}

.calendar-event-sh {
    background: #ccfbf1;
    color: #115e59;
    border-color: #99f6e4;
}

.calendar-event-sh:hover {
    background: #99f6e4;
}

.calendar-event-ie {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.calendar-event-ie:hover {
    background: #bfdbfe;
}

.calendar-event-cies {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde68a;
}

.calendar-event-cies:hover {
    background: #fde68a;
}

.calendar-event-status-delayed {
    border-width: 2px;
    border-color: #f59e0b;
    box-shadow: inset 0 0 0 9999px rgba(255, 237, 213, 0.35);
}

.calendar-event-status-delayed:hover {
    box-shadow: inset 0 0 0 9999px rgba(254, 215, 170, 0.45);
}

.calendar-event-status-published {
    border-width: 2px;
    border-color: #16a34a;
    box-shadow: inset 0 0 0 9999px rgba(220, 252, 231, 0.28);
    font-weight: 700;
}

.calendar-event-status-published:hover {
    box-shadow: inset 0 0 0 9999px rgba(187, 247, 208, 0.38);
}

.calendar-no-date-list {
    margin: 0;
    padding-left: 18px;
}

.auth-page-bg {
    min-height: 100vh;
    background: linear-gradient(140deg, #e7eefc 0%, #f6f8ff 48%, #e9f7f3 100%);
}

.detail-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 12px;
}

.detail-grid .full {
    grid-column: 1 / -1;
}

.detail-grid p {
    margin: 4px 0 0;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
}

.auth-card {
    width: 100%;
    max-width: 720px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 18px;
    box-shadow: 0 24px 55px rgba(17, 24, 39, 0.16);
    overflow: hidden;
}

.auth-card-compact {
    max-width: 560px;
}

.auth-card-top {
    background: linear-gradient(135deg, #1d4ed8, #4f46e5);
    color: #ffffff;
    padding: 26px 26px 20px;
}

.auth-eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.9;
}

.auth-card-top h1 {
    margin: 0 0 10px;
    font-size: 29px;
}

.auth-card-top p {
    margin: 0;
    line-height: 1.5;
}

.auth-card-body {
    padding: 24px;
}

.auth-form .field {
    margin-bottom: 14px;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.auth-actions {
    margin-top: 18px;
    margin-bottom: 0;
}

.btn-primary-lg {
    font-size: 14px;
    font-weight: 700;
    padding: 10px 16px;
}

.auth-logout {
    margin-top: 12px;
}

.password-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-field input {
    flex: 1;
}

.password-toggle {
    flex-shrink: 0;
    background: #e5e7eb;
    color: #1f2937;
    border: 1px solid #cbd5e1;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.password-toggle:hover {
    background: #d1d5db;
}

.field-help {
    margin: 6px 0 0;
    font-size: 12px;
    color: #475569;
}

.spellcheck-toolbar {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.brand-logos {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 6px 10px;
}

.brand-logo img {
    max-height: 34px;
    width: auto;
    object-fit: contain;
    display: block;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 9px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
}

@media (max-width: 900px) {
    .calendar-grid {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }

    .auth-card-top h1 {
        font-size: 24px;
    }

    .brand-logo img {
        max-height: 28px;
    }
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.main-nav .nav-left > a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 6px;
}

.main-nav .nav-left > a:hover {
    background: rgba(255, 255, 255, 0.13);
}

.table-wrap {
    overflow: auto;
    max-height: 72vh;
}

th {
    position: sticky;
    top: 0;
    z-index: 5;
}

tbody tr:hover {
    background: #f8fafc;
}

.row-actions {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-view {
    background: #0f766e;
}

.btn-pauta {
    background: #b45309;
}

.actions-menu {
    position: relative;
}

.actions-menu > summary {
    list-style: none;
    cursor: pointer;
    background: #475569;
    color: #fff;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
}

.actions-menu > summary::-webkit-details-marker {
    display: none;
}

.actions-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    width: 230px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
    padding: 8px;
    z-index: 40;
}

.actions-menu-list form,
.actions-menu-list button,
.actions-menu-list .btn-linklike {
    width: 100%;
}

.actions-menu-list button,
.actions-menu-list .btn-linklike {
    text-align: left;
    border-radius: 8px;
    margin-bottom: 6px;
    background: #f3f4f6;
    color: #111827;
    padding: 8px 9px;
    border: none;
    cursor: pointer;
}

.actions-menu-list button:hover,
.actions-menu-list .btn-linklike:hover {
    background: #e5e7eb;
}

.actions-menu-list .danger-lite {
    background: #fee2e2;
    color: #991b1b;
}

.badge {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-neutral {
    background: #e5e7eb;
    color: #374151;
}

.badge-origin {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.badge-origin-sh {
    background: #ccfbf1;
    color: #115e59;
}

.badge-origin-ie {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-origin-cies {
    background: #fef9c3;
    color: #854d0e;
}

.badge-origin-default {
    background: #e5e7eb;
    color: #374151;
}

/* Table action polish: compact controls and softer visual hierarchy */
.table-wrap td .badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.table-wrap td form.inline {
    display: block;
    margin-top: 6px;
}

.table-wrap td form.inline button {
    width: auto;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: normal;
}

.table-wrap td form.inline button:hover {
    background: #f1f5f9;
}

.table-wrap td form.inline[action*='pedir-imagen'] button,
.table-wrap td form.inline[action*='pedir-video'] button,
.table-wrap td form.inline[action*='toggle-grabado'] button,
.table-wrap td form.inline[action*='toggle-listo'] button,
.table-wrap td form.inline[action*='toggle-publicado'] button,
.table-wrap td form.inline[action*='status'] button,
.table-wrap td form.inline[action*='hecha'] button,
.table-wrap td form.inline[action*='marcar-grabado'] button,
.table-wrap td form.inline[action*='subido-si'] button,
.table-wrap td form.inline[action*='subido-editado'] button,
.table-wrap td form.inline[action*='recibido-arturo'] button {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.table-wrap td form.inline[action*='pedir-imagen'] button:hover,
.table-wrap td form.inline[action*='pedir-video'] button:hover,
.table-wrap td form.inline[action*='toggle-grabado'] button:hover,
.table-wrap td form.inline[action*='toggle-listo'] button:hover,
.table-wrap td form.inline[action*='toggle-publicado'] button:hover,
.table-wrap td form.inline[action*='status'] button:hover,
.table-wrap td form.inline[action*='hecha'] button:hover,
.table-wrap td form.inline[action*='marcar-grabado'] button:hover,
.table-wrap td form.inline[action*='subido-si'] button:hover,
.table-wrap td form.inline[action*='subido-editado'] button:hover,
.table-wrap td form.inline[action*='recibido-arturo'] button:hover {
    background: #dbeafe;
}

.table-wrap td .btn-pauta {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.table-wrap td .btn-view {
    background: #e6fffa;
    color: #0f766e;
    border: 1px solid #99f6e4;
}

.table-wrap td .row-actions .btn,
.table-wrap td .row-actions > form button {
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #cbd5e1;
}

.table-wrap td .row-actions .btn.secondary {
    background: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
}

.table-wrap td .row-actions .btn-view {
    background: #ecfeff;
    color: #0f766e;
    border-color: #99f6e4;
}

.table-wrap td .row-actions .danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.table-wrap td .actions-menu > summary {
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 12px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.table-wrap td .actions-menu[open] > summary {
    background: #e2e8f0;
}

.table-wrap td .small-input {
    width: 100%;
    max-width: 120px;
    margin-bottom: 6px;
    font-size: 12px;
    padding: 5px 7px;
}

.badge-yes {
    background: #dcfce7;
    color: #166534;
}

.badge-no {
    background: #fee2e2;
    color: #9f1239;
}

.badge-warn {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #e0f2fe;
    color: #0c4a6e;
}

.badge-neutral {
    background: #e5e7eb;
    color: #374151;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #374151;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot-sh { background: #99f6e4; border: 1px solid #5eead4; }
.dot-ie { background: #bfdbfe; border: 1px solid #93c5fd; }
.dot-cies { background: #fde68a; border: 1px solid #facc15; }
.dot-delayed { background: #fed7aa; border: 2px solid #f97316; }
.dot-published { background: #dcfce7; border: 2px solid #16a34a; }

.empty-state {
    padding: 22px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
}

.empty-state h4 {
    margin: 0 0 8px;
}

.toast-host {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    min-width: 240px;
    max-width: 360px;
    border-radius: 10px;
    padding: 10px 12px;
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
    opacity: 0;
    transform: translateY(-6px);
    transition: all 0.25s ease;
    font-size: 13px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.ok { background: #15803d; }
.toast.warn { background: #b45309; }
.toast.error { background: #b91c1c; }

.confirm-modal {
    border: none;
    border-radius: 14px;
    padding: 0;
    width: min(440px, 90vw);
}

.confirm-modal::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.confirm-modal-body {
    padding: 18px;
}

.confirm-modal-body h3 {
    margin-top: 0;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.detail-title {
    margin: 0;
}

@media (max-width: 900px) {
    .main-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-right {
        justify-content: space-between;
    }
    .toast-host {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    .filters-grid {
        grid-template-columns: repeat(1, minmax(180px, 1fr));
    }
}
