:root {
    --bg-color-main: #e0f2fe;
    /* Sky 100 */
    --bg-color-surface: #bae6fd;
    /* Sky 200 */
    --text-primary: #082f49;
    /* Sky 900 */
    --text-secondary: #0369a1;
    /* Sky 700 */
    --accent-primary: #0284c7;
    /* Sky 600 */
    --accent-hover: #075985;
    /* Sky 800 */
    --border-color: #7dd3fc;
    /* Sky 300 */
    --font-main: 'Inter', sans-serif;
    --transition: all 0.2s ease-in-out;
    --error-color: #ef4444;
}

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

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #e0f2fe, #ccfbf1);
    /* Light sky to light mint */
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Gradients */
.gradient-text {
    background: linear-gradient(90deg, #0284c7, #0d9488);
    /* Deep sky to Teal */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Beautiful Landing Page */
.landing-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color-main);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    overflow: hidden;
}

.landing-container.active {
    opacity: 1;
    pointer-events: all;
}

.landing-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.8), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.landing-content {
    flex: 1;
    padding: 2rem;
    max-width: 550px;
    z-index: 1;
    animation: slideRight 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.landing-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.landing-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.landing-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.feature-item {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent-hover);
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.05);
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.2rem;
}

.landing-btn {
    font-size: 1.05rem;
    padding: 14px 30px;
    border-radius: 50px;
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.3);
}

.landing-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(2, 132, 199, 0.4);
}

.landing-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    animation: fadeInScale 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.landing-hero-img {
    max-width: 100%;
    max-height: 65vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(8, 47, 73, 0.15);
    position: relative;
    z-index: 2;
    transition: transform 0.5s;
}

.landing-hero-img:hover {
    transform: scale(1.02) translateY(-10px);
}

.glow-effect {
    position: absolute;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(50px);
    z-index: 1;
    animation: pulse 4s infinite alternate;
}

@keyframes slideRight {
    0% { opacity: 0; transform: translateX(-50px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.15; }
    100% { transform: scale(1.2); opacity: 0.25; }
}

@media (max-width: 992px) {
    .landing-container {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .landing-content {
        padding: 1.5rem;
        text-align: center;
        max-width: 100%;
    }
    
    .landing-features {
        justify-content: center;
    }
    
    .landing-title {
        font-size: 2.2rem;
    }
    
    .landing-image-container {
        padding: 0.5rem;
    }
    
    .landing-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 47, 73, 0.2);
    /* Navy dim */
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-color-surface);
    padding: 2.5rem;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 15px 35px rgba(2, 132, 199, 0.1);
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-content h1,
.modal-content h2 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
    font-weight: 700;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Inputs & Forms */
.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

input[type="password"],
input[type="email"],
input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background: #f0f9ff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-main);
    transition: var(--transition);
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
    background: #f0f9ff;
}

.error-msg {
    color: var(--error-color) !important;
    font-size: 0.85rem !important;
    margin-top: 1rem !important;
    margin-bottom: 0 !important;
    opacity: 0;
    transition: opacity 0.3s;
}

.error-msg.visible {
    opacity: 1;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    font-family: var(--font-main);
}

.primary-btn {
    background: linear-gradient(90deg, #0ea5e9, #14b8a6);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.2);
}

.modal-content .primary-btn {
    width: 100%;
}

td .btn {
    width: auto !important;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.3);
}

.outline-btn {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.outline-btn:hover {
    background: var(--bg-color-surface);
    border-color: var(--accent-hover);
}

.text-btn {
    background: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1rem;
    font-weight: 500;
}

.text-btn:hover {
    color: var(--accent-primary);
}

/* Layout */
#app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    animation: fadeIn 0.5s ease;
}

.app-main {
    flex: 1;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Header Navbar - Edge to Edge */
.app-header {
    background: rgba(224, 242, 254, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 70px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    width: 250px;
}

nav {
    display: flex;
    gap: 1rem;
    flex: 1;
    justify-content: center;
}

.nav-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(2, 132, 199, 0.1);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(2, 132, 199, 0.15);
    font-weight: 600;
}

.header-actions {
    width: 250px;
    display: flex;
    justify-content: flex-end;
}

/* Pages */
.page {
    display: none;
    animation: slideUp 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-header .actions .btn {
    width: auto;
    padding: 8px 16px;
}

/* Filters */
.filters {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.filter-select {
    width: auto;
    min-width: 220px;
    cursor: pointer;
    background: rgba(224, 242, 254, 0.9);
}

/* Tables */
.table-container {
    background: rgba(224, 242, 254, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: capitalize;
    background: rgba(186, 230, 253, 0.5);
}

td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(2, 132, 199, 0.05);
}

/* Admin Specific */
.admin-only {
    display: none;
}

.admin-col {
    width: 120px;
    text-align: center;
}

.action-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.edit-btn,
.del-btn {
    background: rgba(186, 230, 253, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

.edit-btn:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.del-btn:hover {
    background: var(--error-color);
    border-color: var(--error-color);
    color: #fff;
}

/* Editor Modal Adjustments */
.editor-glass {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
}

.editor-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 1.5rem;
}

.editor-form .input-group {
    flex: 1 1 calc(50% - 15px);
    margin-bottom: 0;
}

.editor-form .input-group.full-width {
    flex: 1 1 100%;
}

.editor-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-actions {
    width: 100%;
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
}

/* Footer - Edge to Edge */
.app-footer {
    background: rgba(224, 242, 254, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }

    .logo,
    .header-actions {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    nav {
        flex-wrap: wrap;
        width: 100%;
    }

    .filters {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }
}