:root {
    --primary: #3dc3c0;
    --primary-hover: #31a8a5;
    --text-dark: #2d3748;
    --text-muted: #a0aec0;
    --bg-main: #f8fafc;
    --border-light: #edf2f7;
    --red-alert: #fc8181;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--primary);
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

.dashboard-wrapper {
    background-color: #ffffff;
    margin: 40px 0 0 40px;
    height: calc(100vh - 40px);
    width: calc(100vw - 40px);
    border-top-left-radius: 30px;
    box-shadow: -10px -10px 40px rgba(0,0,0,0.1);
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 40px 30px;
    overflow-y: auto;
}

.logo {
    margin-bottom: 50px;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.logo h1 span {
    color: var(--primary);
}

.nav-menu {
    margin-bottom: 40px;
}

.nav-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: block;
}

.nav-item {
    display: block;
    padding: 10px 15px;
    color: var(--primary);
    background-color: #f0fdfa;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 5px;
}

/* Form in Sidebar */
.sidebar-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
    display: block;
    margin-bottom: 8px;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-dark);
    transition: border-color 0.2s;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

.file-drop-area {
    border: 1px dashed #cbd5e0;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    background: #ffffff;
}

.file-drop-area:hover {
    border-color: var(--primary);
    background: #f0fdfa;
}

.file-msg {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.file-input {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    background: var(--bg-main);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.checkbox-label span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

.primary-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.loader {
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* Main Content Area */
.dashboard-main {
    flex-grow: 1;
    background-color: var(--bg-main);
    padding: 40px 50px;
    overflow-y: auto;
}

.top-header {
    margin-bottom: 40px;
}

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.breadcrumbs .active {
    font-weight: 600;
    color: var(--text-dark);
}

.top-header h2 {
    font-size: 2rem;
    color: var(--text-dark);
    font-weight: 700;
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 200px;
}

.stat-card.highlight {
    background: var(--primary);
    color: white;
    border: none;
}

.stat-card.highlight .stat-icon {
    font-size: 2rem;
}

.stat-card.highlight h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.stat-card.highlight p {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* History Cards */
#history-section {
    margin-top: 20px;
}

#history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.history-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.history-card:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 15px rgba(61, 195, 192, 0.15);
    transform: translateY(-2px);
}

.history-title {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.3;
}

.history-date {
    font-size: 0.8rem;
    color: var(--red-alert);
    font-weight: 600;
    display: flex;
    justify-content: flex-end;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.visible {
    opacity: 1;
}

.modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 900px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-light);
}

.header-titles h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.page-counter {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
}

.close-btn:hover {
    color: var(--text-dark);
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination-controls {
    display: flex;
    gap: 10px;
}
.secondary-btn {
    padding: 10px 20px;
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.secondary-btn:hover:not(:disabled) {
    background-color: var(--primary);
    color: white;
}
.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #cbd5e0;
    color: #cbd5e0;
}

.pulse-anim { animation: pulse 2s infinite; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(61, 195, 192, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(61, 195, 192, 0); }
    100% { box-shadow: 0 0 0 0 rgba(61, 195, 192, 0); }
}

/* Preview Stage */
.preview-stage {
    padding: 30px;
    display: flex;
    justify-content: center;
    background-color: var(--bg-main);
    overflow: hidden; 
}

.preview-area {
    width: 297mm;
    height: 210mm;
    transform: scale(0.65);
    transform-origin: center top;
    margin-bottom: -74mm;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.preview-area.portrait-mode {
    width: 210mm;
    height: 297mm;
    margin-bottom: -104mm; /* Adjusted negative margin */
}

.mock-page {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding-right: 10mm;
    padding-bottom: 10mm;
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
    font-family: 'Montserrat', sans-serif;
}

.mock-guest-card {
    width: 75mm;
    height: 110mm;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    padding: 20px;
    text-align: center;
}

.mock-card-title-name {
    font-family: 'Pacifico', cursive;
    font-size: 2.3rem;
    color: #1a202c;
    margin-bottom: 15px;
    margin-top: 0;
    line-height: 1;
}

.mock-divider { height: 2px; background: rgba(0,0,0,0.1); margin-bottom: 15px; }
.mock-menu-container { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.mock-label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: #4a5568; font-weight: 700; }
.mock-value { font-size: 1.5rem; font-weight: 700; color: #1a202c; line-height: 1.1; }

@media (max-width: 768px) {
    .preview-area { transform: scale(0.35); margin-bottom: -136mm; }
    .dashboard-wrapper { flex-direction: column; margin: 0; width: 100vw; height: 100vh; border-radius: 0; }
    .sidebar { width: 100%; padding: 20px; border-right: none; border-bottom: 1px solid var(--border-light); }
}
