:root {
    --primary: #00a884;
    --primary-hover: #008f72;
    --bg-body: #f0f2f5;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --text-main: #111b21;
    --text-muted: #667781;
    --accent: #2196f3;
    --danger: #ef4444;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    margin: 0;
}

.contenedor-max {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.card {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid #efefef;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow-wrap: break-word;
    /* Prevents long strings from breaking grid */
    word-wrap: break-word;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-box h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-p {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 168, 132, 0.2);
}

.btn-p:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 168, 132, 0.3);
}

.btn-s {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.btn-s:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.tabla-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid #f0f0f0;
    color: var(--text-muted);
}

td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.icon-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin: 0 2px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.icon-btn.ver {
    background: #e3f2fd;
    color: #1976d2;
}

.icon-btn.editar {
    background: #e0f2f1;
    color: #00796b;
}

.icon-btn.eliminar {
    background: #fff0f0;
    color: #c62828;
}

.icon-btn:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

.panel-info {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #0d47a1;
}

/* Builder styles */
.campo-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
}

.campo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
}

/* Fix for Summernote stretching the layout */
.note-editor.note-frame {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    max-width: 100%;
    overflow: hidden;
}

.note-toolbar {
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}

.automation-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.switch-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Toast Notifications */
.notification-toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #334155;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
}

.notification-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-toast .material-icons-outlined,
.notification-toast .fas {
    color: #10b981;
}

.notification-toast.error .fas,
.notification-toast.error .material-icons-outlined {
    color: #ef4444;
}

/* Premium Uploader & Portada */
.lindo-uploader {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8fafc;
    position: relative;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.lindo-uploader:hover {
    border-color: var(--primary);
    background: #f0fdfa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.lindo-uploader i {
    font-size: 38px;
    color: var(--primary);
    opacity: 0.7;
    transition: transform 0.3s;
}

.lindo-uploader:hover i {
    transform: scale(1.1);
}

.lindo-uploader span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.4;
}

.lindo-uploader input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.img-preview-container {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 15px;
    border: 1px solid #efefef;
    display: none;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.preview-portada {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portada-publica {
    width: 100%;
    max-height: 350px;
    min-height: 200px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
    display: block;
}

.card-with-portada {
    padding: 0 !important;
}

.content-padding {
    padding: 30px;
}