
/* Dynamic Styles Generated from Settings */
:root {
    --primary-pastel: #FFB3D9;
    --secondary-pastel: #B3D9FF;
    --tertiary-pastel: #D9FFB3;
    --accent-pastel: #FFE5B3;
    --light-pastel: #F0E5FF;
    --warm-pastel: #FFD9B3;
    
    --primary-gradient-start: #FFE5F2;
    --primary-gradient-end: #E5F0FF;
    --header-gradient-start: #FFB3D9;
    --header-gradient-end: #B3D9FF;
    
    --text-dark: #4A4A4A;
    --text-light: #FFFFFF;
    --border-light: #E8D5F2;
    --success: #A8E6CF;
    --warning: #FFD6A5;
    --error: #FF9D9D;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

html {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    background-repeat: no-repeat;
    background-size: cover;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    width: 100%;
}

/* Header & Navigation */
header {
    background: linear-gradient(135deg, var(--header-gradient-start) 0%, var(--header-gradient-end) 100%);
    padding: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.logo-section img {
    width: 160px;
    height: 44px;
    border-radius: 10px;
    border: 3px solid white;
    background: white;
    object-fit: contain;
    flex-shrink: 0;
}

.creche-title {
    font-size: 28px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    word-break: break-word;
}

.header-nav {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-nav a,
.header-nav span {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.header-nav a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.header-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    border: 2px solid white;
    background: white;
    object-fit: cover;
    flex-shrink: 0;
}

/* Page loading overlay */
.page-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.page-loading-overlay.is-visible {
    display: flex;
}

.page-loading-spinner {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 6px solid rgba(0, 0, 0, 0.08);
    border-top-color: var(--primary-pastel);
    animation: page-loading-spin 0.9s linear infinite;
}

@keyframes page-loading-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Sidebar Navigation */
.sidebar {
    background: linear-gradient(180deg, var(--light-pastel) 0%, rgba(208, 227, 255, 0.5) 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.sidebar h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 16px;
}

.sidebar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar ul li a {
    display: block;
    padding: 12px 15px;
    background: white;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-size: 14px;
}

.sidebar ul li a:hover {
    background: var(--primary-pastel);
    color: white;
    border-left-color: white;
    transform: translateX(5px);
}

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    border: 2px solid var(--border-light);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-dark);
}

.card-subtitle {
    font-size: 14px;
    color: #888;
    margin-top: 5px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-pastel) 0%, rgba(255, 179, 217, 0.5) 100%);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card.blue {
    background: linear-gradient(135deg, var(--secondary-pastel) 0%, rgba(179, 217, 255, 0.5) 100%);
}

.stat-card.green {
    background: linear-gradient(135deg, var(--tertiary-pastel) 0%, rgba(217, 255, 179, 0.5) 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, var(--accent-pastel) 0%, rgba(255, 229, 179, 0.5) 100%);
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: var(--text-dark);
}

.stat-label {
    font-size: 14px;
    color: var(--text-dark);
    margin-top: 8px;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.btn-xs {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 999px;
}

.reset-color.btn-xs {
    padding: 2px 8px;
}

.file-upload {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex-wrap: wrap;
}

.file-upload .btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 10px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.file-upload label.btn {
    margin-bottom: 0;
}

.file-upload-input {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.file-upload-filename {
    font-size: 12px;
    color: var(--text-dark);
    font-family: monospace;
    background: #f5f5f5;
    padding: 6px 10px;
    border-radius: 10px;
    border: 2px solid var(--border-light);
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

.wysiwyg-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.wysiwyg-toolbar .btn.is-active {
    background: var(--primary-pastel);
    border-color: var(--primary-pastel);
    color: white;
}

.terms-swal-popup .swal2-html-container {
    text-align: left;
}

/* Terms page/popup styling */
.terms-content {
    line-height: 1.7;
}

.terms-content p {
    margin: 0 0 12px;
}

.terms-content h2 {
    margin: 18px 0 10px;
    padding-left: 10px;
    border-left: 4px solid var(--primary-pastel);
}

.terms-content h3 {
    margin: 14px 0 8px;
    padding-left: 10px;
    border-left: 4px solid var(--secondary-pastel);
}

.terms-content a {
    color: var(--primary-pastel);
    font-weight: 600;
    text-decoration: none;
}

.terms-content a:hover {
    text-decoration: underline;
}

/* Password show/hide toggle */
.password-field {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.password-field input[type="password"],
.password-field input[type="text"] {
    flex: 1;
}

.password-toggle {
    padding: 0 12px;
    min-height: 44px;
    border-radius: 10px;
    border: 2px solid var(--border-light);
    background: #f5f5f5;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.password-toggle:hover {
    border-color: var(--primary-pastel);
}

.wysiwyg-editor {
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 15px;
    min-height: 220px;
    background: white;
    color: var(--text-dark);
}

.wysiwyg-editor:focus {
    outline: none;
    border-color: var(--primary-pastel);
    box-shadow: 0 0 0 3px rgba(255, 179, 217, 0.12);
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
input[type="color"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

/* Square color previews (used in setup/settings) */
input[type="color"].color-picker {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-pastel);
    box-shadow: 0 0 0 3px rgba(255, 179, 217, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-pastel) 0%, #FF8FB8 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 179, 217, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-pastel) 0%, #94BFFF 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(179, 217, 255, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--tertiary-pastel) 0%, #95E1AD 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(217, 255, 179, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-pastel) 0%, #FFD580 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 229, 179, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error) 0%, #FF7B7B 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 157, 157, 0.4);
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: linear-gradient(135deg, var(--primary-pastel) 0%, var(--secondary-pastel) 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-light);
}

tbody tr {
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: rgba(255, 179, 217, 0.1);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 15px;
}

.modal-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dark);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid;
    font-size: 14px;
}

.alert-success {
    background: rgba(168, 230, 207, 0.2);
    color: #2d6a4f;
    border-left-color: var(--success);
}

.alert-error {
    background: rgba(255, 157, 157, 0.2);
    color: #8B0000;
    border-left-color: var(--error);
}

.alert-warning {
    background: rgba(255, 214, 165, 0.2);
    color: #8B6F47;
    border-left-color: var(--warning);
}

.alert-info {
    background: rgba(179, 217, 255, 0.2);
    color: #003d99;
    border-left-color: var(--secondary-pastel);
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 50%, var(--primary-gradient-end) 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    max-width: 200px;
    width: 100%;
    height: auto;
    border-radius: 15px;
    border: 4px solid var(--primary-pastel);
    margin-bottom: 15px;
    background: white;
    object-fit: contain;
}

.login-title {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.login-subtitle {
    color: #888;
    font-size: 14px;
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Badge */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary-pastel);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-error {
    background: var(--error);
    color: white;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tertiary-pastel) 0%, var(--secondary-pastel) 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--header-gradient-start) 0%, var(--header-gradient-end) 100%);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

footer a {
    color: white;
    text-decoration: underline;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.cursor-pointer {
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .two-column {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        justify-content: center;
        flex-direction: column;
    }
    
    .logo-section {
        justify-content: center;
    }
    
    .creche-title {
        font-size: 20px;
    }
    
    .header-nav {
        justify-content: center;
        gap: 8px;
    }
    
    .header-nav a,
    .header-nav span {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .container {
        padding: 15px;
    }
    
    .modal-content {
        max-width: 95%;
        padding: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .card {
        padding: 15px;
    }
    
    th, td {
        padding: 10px;
        font-size: 13px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .logo-section img {
        height: 40px;
        max-width: 120px;
    }
    
    .creche-title {
        font-size: 16px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-block,
    .btn-group .btn {
        width: 100%;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 25px;
    }
    
    .login-logo {
        max-width: 150px;
    }
    
    .modal-content {
        padding: 15px;
    }
}
