:root {
    --primary-red: #e31e24;
    --dark-red: #b31015;
    --light-bg: #e31e24;
    --white: #ffffff;
    --text-dark: #333333;
    --text-muted: #777777;
    --border-color: #e0e0e0;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --card-radius: 20px;
}

/* Authentication Pages Styles */
.auth-page {
    background: linear-gradient(135deg, #e31e24 0%, #b31015 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Changed from center to prevent top clipping */
    padding: 60px 20px;
    /* Added padding for space around the card */
    position: relative;
    overflow-y: auto;
    /* Ensure vertical scrolling is possible */
}

.auth-page::before,
.auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.auth-page::before {
    top: -100px;
    left: -100px;
}

.auth-page::after {
    bottom: -100px;
    right: -100px;
}

.auth-card {
    background: var(--white);
    width: 100%;
    max-width: 450px;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    z-index: 2;
    overflow: hidden;
}

.auth-header {
    background: var(--primary-red);
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    color: white;
    position: relative;
}

.auth-header::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid var(--primary-red);
}

.auth-logo {
    background: white;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-red);
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.auth-logo i {
    font-size: 1.5rem;
}

.auth-logo span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-body {
    padding: 1.5rem 2.5rem 0.5rem;
}

.auth-body h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-body p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #444444;
    /* Neutral dark grey icon color */
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 45px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    font-size: 1rem;
    transition: 0.3s;
}

.form-group input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.1);
}

.forgot-link {
    display: block;
    text-align: right;
    color: var(--primary-red);
    text-decoration: none;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.btn-auth {
    width: 100%;
    padding: 1rem;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(227, 30, 36, 0.3);
}

.btn-auth:hover {
    background: var(--dark-red);
    transform: translateY(-2px);
}

.auth-separator {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--border-color);
    z-index: 1;
}

.auth-separator span {
    background: white;
    padding: 0 15px;
    color: var(--text-muted);
    font-size: 0.8rem;
    position: relative;
    z-index: 2;
}

.auth-footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-dark);
}

/* Header Styles */
.header {
    background-color: var(--primary-red);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--white);
}

.logo {
    font-weight: bold;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-circle {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--white);
    color: var(--white);
    padding: 0.5rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
}

.btn-logout:hover {
    background: var(--white);
    color: var(--primary-red);
}

/* Dashboard Layout */
.container {
    padding: 2rem 5%;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.dash-title h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.dash-title p {
    color: var(--text-muted);
}

.btn-primary {
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--dark-red);
    box-shadow: var(--shadow);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.blue-icon {
    background: #e3f2fd;
    color: #2196f3;
}

.green-icon {
    background: #e8f5e9;
    color: #4caf50;
}

.red-icon {
    background: #ffebee;
    color: #f44336;
}

.stat-info h2 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Search Bar */
.search-container {
    background: var(--white);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
}

.search-select {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--white);
}

/* Table Card */
.table-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    background: #fafafa;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.qr-thumb {
    width: 40px;
    height: 40px;
    background: #eee;
    border-radius: 4px;
}

.action-btns {
    display: flex;
    gap: 5px;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-edit {
    background: #fff9c4;
    color: #fbc02d;
}

.btn-qr {
    background: #e1f5fe;
    color: #03a9f4;
}

.btn-share {
    background: #e8f5e9;
    color: #4caf50;
}

.btn-disable {
    background: #ffebee;
    color: #f44336;
}

.btn-delete {
    background: #f5f5f5;
    color: #616161;
}

/* Logout Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.logout-modal {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.logout-modal h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    font-weight: 600;
}

.logout-modal p {
    color: #777;
    margin-bottom: 2.5rem;
    line-height: 1.5;
    padding: 0 10%;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-cancel {
    background: #f1f3f5;
    color: #495057;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
}

.btn-cancel:hover {
    background: #e9ecef;
}

.btn-confirm-logout {
    background: #f02831;
    color: white;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
}

.btn-confirm-logout:hover {
    background: #d91c24;
}

/* Dashboard Arranging */
.main-link-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    gap: 2rem;
}

.link-info {
    flex: 2;
    text-align: left;
}

.link-info h3 {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.4rem;
    font-weight: 700;
}

.link-info p {
    color: #888;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.link-display {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.link-display input {
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 1rem;
    border-radius: 12px;
    flex: 1;
    min-width: 250px;
    color: #444;
    font-size: 0.9rem;
    font-family: monospace;
}

.link-qr {
    flex: 1;
    text-align: center;
    padding-left: 2rem;
    border-left: 2px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.link-qr img {
    width: 150px;
    height: 150px;
    display: block;
    border: 1px solid #eee;
    padding: 10px;
    background: white;
    border-radius: 12px;
}

.download-link {
    font-size: 0.85rem;
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 700;
}

.status-badge {
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.inactive {
    background: #f5f5f5;
    color: #757575;
}

/* Dashboard Body Red Background */
body.dashboard-bg {
    background: var(--primary-red);
}

.dashboard-bg .dash-title h1,
.dashboard-bg .dash-title p {
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header {
        padding: 1rem 15px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .user-nav {
        width: 100%;
        justify-content: center;
        gap: 10px;
    }

    .container {
        padding: 1.5rem 15px;
    }

    .dash-header {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        text-align: center;
    }

    .main-link-card {
        flex-direction: column;
        padding: 1.5rem;
        text-align: center;
    }

    .link-info {
        text-align: center;
    }

    .link-info h3 {
        font-size: 1.2rem;
    }

    .link-display {
        justify-content: center;
    }

    .link-display input {
        min-width: 100%;
    }

    .link-qr {
        border-left: none;
        border-top: 2px solid #f0f0f0;
        padding-left: 0;
        padding-top: 1.5rem;
        width: 100%;
    }

    .day-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Make table scrollable on small screens */
    .table-card {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }

    .auth-card {
        max-width: 100%;
    }

    .auth-body {
        padding: 1.5rem;
    }

    .btn-row {
        flex-direction: column;
    }

    .success-card {
        padding: 2rem 1.5rem;
        margin: 2rem 10px;
    }

    .booking-card {
        padding: 1.5rem;
        margin: 1rem 0;
    }

    .form-container {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .link-display .btn-sm {
        width: 100%;
        justify-content: center;
    }

    .action-btns {
        flex-wrap: wrap;
        justify-content: center;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-cancel,
    .btn-confirm-logout {
        width: 100%;
    }
}