:root {
    --primary: #2d5a27;
    --secondary: #4a7c44;
    --accent: #8bc34a;
    --bg-dark: #0f1710;
    --text-light: #f1f1f1;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --sidebar-width: 320px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background: radial-gradient(circle at center, #1a2e1d 0%, #0a110a 100%);
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100%;
}

.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Sidebar Styling */
#sidebar {
    width: var(--sidebar-width);
    height: 100%;
    position: fixed;
    right: -320px;
    top: 0;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    overflow-y: auto;
}

#sidebar.active {
    transform: translateX(-320px);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 500;
}

#sidebar h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin: 35px 0 10px;
    font-weight: 600;
    opacity: 0.9;
}

#sidebar hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

/* Info Row & Grid */
.info-row {
    display: flex;
    gap: 10px;
}

.info-row .info-group {
    flex: 1;
}

.spouse-box {
    background: rgba(255, 105, 180, 0.05);
    border: 1px dashed rgba(255, 105, 180, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.spouse-box h3 {
    font-size: 0.9rem;
    color: #ff69b4;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.spouse-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.spouse-item:last-child {
    margin-bottom: 0;
}

.remove-spouse {
    position: absolute;
    top: 5px;
    right: 5px;
    color: #ff4d4d;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 5px;
}

.moving-info {
    background: rgba(61, 90, 254, 0.1);
    border: 1px solid #3d5afe;
    border-radius: 8px;
    padding: 10px;
    margin: 15px 0;
    text-align: center;
}

.moving-info p {
    font-size: 0.85rem;
    color: #a0b0ff;
    margin-bottom: 8px;
}

.node.moving-node rect {
    stroke: #ff9100;
    stroke-width: 4px;
    animation: pulse-orange 1.5s infinite;
}

@keyframes pulse-orange {
    0% {
        filter: drop-shadow(0 0 5px #ff9100);
    }

    50% {
        filter: drop-shadow(0 0 20px #ff9100);
    }

    100% {
        filter: drop-shadow(0 0 5px #ff9100);
    }
}

.address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px;
    color: white;
    outline: none;
    cursor: pointer;
}

/* Main Area */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 100%;
}

header {
    height: 70px;
    margin: 15px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    color: var(--accent);
}

.brand span {
    color: white;
    font-weight: 300;
}

.controls {
    display: flex;
    gap: 8px;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 0;
}

.modal-content {
    width: 100%;
    max-width: 900px;
    border-radius: 0;
    padding: 20px;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stats-scroll-container {
    max-height: calc(98vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}

.stats-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.stats-scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.stats-scroll-container::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.stats-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a5d6a7;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stats-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: 15px;
}

.stats-card.full-width {
    grid-column: span 2;
}

.stats-card h3 {
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-body {
    font-size: 1.1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Tree Container */
#tree-container {
    flex: 1;
    cursor: grab;
    overflow: hidden;
}

#tree-container:active {
    cursor: grabbing;
}

/* Ancestor Image Styling (SVG) */
.ancestor-img {
    filter: drop-shadow(0 0 10px rgba(139, 195, 74, 0.4));
    animation: fadeInGlow 2s ease-in-out;
    pointer-events: none;
}

@keyframes fadeInGlow {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Node Styling */
.node rect {
    fill: #1e3a22;
    stroke: var(--accent);
    stroke-width: 2px;
    transition: all 0.3s ease;
}

.node:hover rect {
    fill: #2a5230;
    filter: drop-shadow(0 0 15px var(--accent)) brightness(1.2);
    stroke-width: 3px;
}

/* Selected Node Highlight */
.node.selected-node rect {
    stroke: #fff;
    stroke-width: 3px;
    fill: #2a5230;
    filter: drop-shadow(0 0 12px var(--accent));
}

.node text {
    fill: #fff;
    font-size: 12px;
    pointer-events: none;
}

.link {
    fill: none;
    stroke: rgba(139, 195, 74, 0.3);
    stroke-width: 2px;
}

/* Selected Node Highlight */
g.node.selected-node rect {
    stroke: #8bc34a;
    stroke-width: 3px;
    filter: drop-shadow(0 0 10px rgba(139, 195, 74, 0.8));
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    header {
        padding: 0 10px;
        margin: 10px;
    }

    .brand span {
        display: none;
    }

    .controls .icon-btn {
        width: 34px;
        height: 34px;
        font-size: 0.8rem;
    }

    #sidebar {
        width: 100%;
        right: -100%;
    }

    #sidebar.active {
        transform: translateX(-100%);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-card.full-width {
        grid-column: span 1;
    }

    .address-grid {
        grid-template-columns: 1fr;
    }
}

/* Forms & Buttons */
.info-group {
    margin-bottom: 15px;
}

.info-group label {
    display: block;
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 5px;
}

.add-actions,
.reorder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 10px;
}

.reorder-actions .btn {
    width: auto;
    flex: 1;
    min-width: fit-content;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

input,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px;
    color: white;
    outline: none;
}

input:focus,
textarea:focus {
    border-color: var(--accent);
}

.btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-primary {
    background: #ff69b4;
    color: white;
}

.btn-secondary {
    background: #3d5afe;
    color: white;
}

.btn-tertiary {
    background: #ff9100;
    color: white;
}

.btn-success {
    background: #00c853;
    color: white;
    margin-top: 20px;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--glass-border);
    transform: scale(1.1);
}

.profile-img-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.upload-tip {
    text-align: center;
    margin-top: 10px;
    font-size: 0.7rem;
    color: #6a8c6f;
    line-height: 1.4;
    background: rgba(139, 195, 74, 0.1);
    padding: 8px;
    border-radius: 8px;
    border: 1px dashed rgba(139, 195, 74, 0.3);
}

#profile-img {
    width: 120px;
    height: 120px;
    min-width: 120px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    background: #2d2d2d;
    font-size: 0.8rem;
    color: #666;
}

.edit-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--accent);
    color: black;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

/* Upload Progress Overlay */
.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 50%;
}

.upload-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(139, 195, 74, 0.2);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.upload-text {
    color: white;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.upload-progress-bar {
    width: 80%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a5d6a7);
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 1.5s infinite;
}

@keyframes progressPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Success Toast Notification */
.success-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #00c853, #69f0ae);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 200, 83, 0.4);
    z-index: 10001;
    font-weight: 500;
    animation: slideInRight 0.4s ease-out;
}

.success-toast i {
    font-size: 1.3rem;
}

.success-toast.hiding {
    animation: slideOutRight 0.4s ease-in forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.hidden {
    display: none;
}

/* D3 Elements */
.expand-circle {
    fill: var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
}

.expand-circle:hover {
    filter: drop-shadow(0 0 10px var(--accent));
    fill: #fff;
}

.expand-text {
    fill: black;
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

/* Admin Manage Modal - Higher z-index to appear above table */
#admin-manage-modal {
    z-index: 15000;
}

.modal-content {
    width: 100%;
    max-width: 1200px;
    height: auto;
    max-height: 90vh;
    /* Adjusted per request */
    padding: 15px;
    /* Reduced from 30px */
    position: relative;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    /* Reduced further */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    /* Compact vertically */
    flex-shrink: 0;
    height: 50px;
    /* Force compact height to ensure horizontal balance */
}

.modal-header h2 {
    margin: 0 !important;
    font-size: 1.3rem;
    /* Slightly smaller to fit better */
    color: var(--accent);
    white-space: nowrap;
    /* Prevent wrapping */
}

.modal-body {
    margin-bottom: 0px;
    /* Removed completely */
    flex: 1;
    overflow: hidden;
    position: relative;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 0px;
    /* Removed padding top */
}


.hidden {
    display: none !important;
}

/* Generational Admin Table Styling */
.generation-table-container {
    overflow: auto;
    height: 100%;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

#admin-gen-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#admin-gen-table th {
    position: sticky;
    top: 0;
    background: #1a2e1d;
    /* Match body bg / dark theme */
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

#admin-gen-table {
    table-layout: fixed;
}

.gen-cell {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 8px;
    position: relative;
    min-height: 60px;
    transition: all 0.2s ease;
}

.gen-cell:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 195, 74, 0.2);
}

.gen-cell-name {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 8px;
    word-wrap: break-word;
    cursor: pointer;
    transition: color 0.2s;
}

.gen-cell-name:hover {
    color: var(--accent);
}

.cell-actions {
    display: none;
    gap: 5px;
    margin-top: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.cell-actions.active {
    display: flex;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remove old quick-actions styles if desired, or keep as fallback */
.quick-actions {
    display: none;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.gen-cell:hover .quick-actions {
    display: flex;
}

.quick-actions .icon-btn {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-add {
    background: rgba(0, 200, 83, 0.2);
    border-color: #00c853;
}

.quick-add:hover {
    background: rgba(0, 200, 83, 0.4);
}

.quick-edit {
    background: rgba(61, 90, 254, 0.2);
    border-color: #3d5afe;
}

.quick-edit:hover {
    background: rgba(61, 90, 254, 0.4);
}

.quick-delete:hover {
    background: rgba(255, 77, 77, 0.4);
}

@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
    }

    #admin-gen-table th {
        min-width: 150px;
        font-size: 0.85rem;
    }

    .gen-cell {
        padding: 8px;
        min-height: 50px;
    }

    .gen-cell-name {
        font-size: 0.8rem;
    }

    .quick-actions {
        display: flex;
        /* Always show on mobile */
    }

    .quick-actions .icon-btn {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

}

/* --- NOVASTACK LOGIN DESIGN PORT (Green Theme) --- */

/* Modal Update for Login */
#login-modal .login-container {
    width: 1100px;
    max-width: 95%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
    z-index: 10;
    min-height: 600px;
    text-align: left;
}

@media (max-width: 1024px) {
    #login-modal .login-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
}

/* Animated Backgrounds */
.modal-bg-blobs {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: blobPulse 10s infinite;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: rgba(45, 90, 39, 0.4);
    /* Dark Green Blob */
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: rgba(139, 195, 74, 0.3);
    /* Light Green Blob */
    animation-delay: 2s;
}

@keyframes blobPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

/* Left Section */
.login-brand-side {
    padding: 3rem;
    background: radial-gradient(circle at center, #1a2e1d 0%, #050a05 100%);
    /* Match body bg */
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 1024px) {
    .login-brand-side {
        display: none;
    }
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 2;
}

.brand-icon-box {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f1f1f1;
}

.brand-content {
    z-index: 2;
}

.brand-content h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.brand-content h1 span {
    color: #8bc34a;
    /* Accent color */
}

.brand-content p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 28rem;
    line-height: 1.6;
}

.quote-box {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    z-index: 2;
    margin-top: 2rem;
}

.quote-text {
    font-style: italic;
    color: #e0e7ff;
    margin-bottom: 0.5rem;
}

.quote-author {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8bc34a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Right Section */
.login-form-side {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
}

.form-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1a2e1d;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: #555;
    margin-bottom: 2rem;
}

.modern-form-group {
    margin-bottom: 1.5rem;
}

.modern-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.modern-input-wrapper {
    position: relative;
}

.modern-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    color: #111827;
    background: #f9fafb;
    transition: all 0.2s;
    outline: none;
}

.modern-input:focus {
    border-color: #2d5a27;
    box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.1);
    background: white;
}

.input-icon-left,
.input-icon-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.input-icon-left {
    left: 1rem;
}

.input-icon-right {
    right: 1rem;
    cursor: pointer;
    pointer-events: auto;
}

.input-icon-right:hover {
    color: #2d5a27;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.chk-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4b5563;
    cursor: pointer;
}

.chk-input {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    accent-color: #2d5a27;
}

.forgot-link {
    color: #2d5a27;
    font-weight: 600;
    text-decoration: none;
}

.forgot-link:hover {
    color: #1a2e1d;
}

.btn-nova-login {
    width: 100%;
    padding: 0.875rem;
    background: #2d5a27;
    /* Primary Green */
    color: white;
    font-weight: 600;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(45, 90, 39, 0.2);
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-nova-login:hover {
    background: #1a2e1d;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(45, 90, 39, 0.3);
}

.divider-text {
    position: relative;
    text-align: center;
    margin: 2rem 0;
}

.divider-text::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e5e7eb;
}

.divider-span {
    position: relative;
    background: #fff;
    padding: 0 1rem;
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Mobile Brand Header */
.mobile-brand-header {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
    .mobile-brand-header {
        display: flex;
    }
}

.mobile-brand-icon {
    width: 2rem;
    height: 2rem;
    background: #2d5a27;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Quick Add Dropdown Menu */
.quick-add-dropdown {
    position: relative;
    display: inline-block;
}

.quick-add-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(20, 20, 20, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 4px;
    min-width: 160px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.quick-add-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.quick-add-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: white;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.quick-add-option:hover {
    background: rgba(139, 195, 74, 0.2);
    color: var(--accent);
}

.quick-add-option i {
    width: 16px;
    text-align: center;
}

/* Admin Table Horizontal Scroll */
.generation-table-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    padding: 0 20px;
}

.generation-table-container::-webkit-scrollbar {
    height: 8px;
}

.generation-table-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.generation-table-container::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.generation-table-container::-webkit-scrollbar-thumb:hover {
    background: #a5d6a7;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {

    /* Admin Modal Full Screen on Mobile */
    #admin-dashboard-modal .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Admin Header Responsive - Toggle Layouts */
    /* Admin Header Responsive - Toggle Layouts */
    #admin-dashboard-modal .modal-header {
        position: sticky !important;
        top: 0 !important;
        background: #1a1a1a !important;
        /* Solid background prevents see-through */
        z-index: 1000 !important;
        /* Higher z-index to stay on top */
        padding: 15px 15px 10px 15px !important;
        /* More top padding */
        margin-bottom: 0 !important;
        border-bottom: 1px solid rgba(139, 195, 74, 0.3) !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
        /* Shadow for separation */
    }

    /* Hide desktop, show mobile */
    .admin-header-desktop {
        display: none !important;
    }

    .admin-header-mobile {
        display: block !important;
    }

    #admin-dashboard-modal .modal-header h2 {
        font-size: 1rem !important;
        margin: 0 !important;
    }

    /* Search Input Responsive - Hide desktop search */
    #admin-table-search {
        display: none !important;
    }

    #admin-table-search-mobile {
        display: block !important;
    }

    /* Modal Body - Remove padding but add top margin for sticky header */
    #admin-dashboard-modal .modal-body {
        max-height: calc(100vh - 120px) !important;
        /* Adjusted for larger header */
        padding: 0 !important;
        padding-top: 10px !important;
        /* Space between header and content */
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    /* Table Container - Negative margins removed, full width */
    .generation-table-container {
        margin: 0 !important;
        margin-top: 10px !important;
        /* Ensure table starts below search bar */
        padding: 0 10px !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
    }

    /* Table - Allow natural width */
    #admin-gen-table {
        width: auto !important;
        min-width: 100% !important;
        table-layout: auto !important;
    }

    /* Table Cells - Prevent compression */
    #admin-gen-table td,
    #admin-gen-table th {
        padding: 6px 8px !important;
        font-size: 0.75rem !important;
        min-width: 120px !important;
        max-width: none !important;
        white-space: nowrap !important;
    }

    /* Action Buttons Smaller */
    .cell-actions {
        display: flex !important;
        gap: 4px !important;
        flex-wrap: nowrap !important;
    }

    .cell-actions .icon-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        font-size: 0.7rem !important;
        flex-shrink: 0 !important;
    }

    /* Dropdown Menu Adjust */
    .quick-add-menu {
        min-width: 120px !important;
        font-size: 0.7rem !important;
    }

    .quick-add-option {
        padding: 5px 8px !important;
        font-size: 0.7rem !important;
    }

    /* Modal Body Adjust */
    #admin-dashboard-modal .modal-body {
        max-height: calc(100vh - 90px) !important;
        padding: 5px 0 !important;
    }

    /* Header Buttons Smaller */
    #admin-dashboard-modal .modal-header button {
        font-size: 0.7rem !important;
        padding: 4px 8px !important;
    }

    #admin-dashboard-modal .modal-header .icon-btn {
        width: 30px !important;
        height: 30px !important;
    }

    /* Scrollbar for mobile */
    .generation-table-container::-webkit-scrollbar {
        height: 8px !important;
    }

    .generation-table-container::-webkit-scrollbar-thumb {
        background: var(--accent) !important;
    }

    /* Other Modals - Make responsive */
    .modal-content {
        max-width: 95% !important;
    }

    /* Stats Modal */
    #stats-modal .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        height: 100vh !important;
        border-radius: 0 !important;
        padding: 10px !important;
    }

    /* Login Modal */
    #login-modal .modal-content {
        max-width: 90% !important;
        width: 90% !important;
    }

    /* Admin Manage Modal */
    #admin-manage-modal .modal-content {
        max-width: 95% !important;
        width: 95% !important;
    }

    /* Sidebar on Mobile */
    #sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }
}