/* Modern CSS for VRPT Frontend - 2024 */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Modern Layout */
#main {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    min-height: 100vh;
    display: table;
    width: 100%;
    border-collapse: collapse;
}

#header {
    background: white !important;
    color: #2c3e50;
    padding: 0.5rem 2rem !important;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
    height: auto !important;
    background-image: none !important;
    vertical-align: middle !important;
    display: flex;
    align-items: center;
}

#header::before {
    content: '';
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 36px;
    justify-content: space-between;
    width: 100%;
}

.header-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-image {
    height: 36px;
    width: auto;
    transition: opacity 0.3s ease;
    display: block;
    max-width: none;
    object-fit: contain;
}

.header-logo-image:hover {
    opacity: 1;
}

.header-title {
    flex-grow: 1;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    color: #2c3e50;
}

.header-fetitle {
    flex-shrink: 0;
    font-size: 1.2rem;
    font-weight: 500;
    text-align: right;
    color: #000000;
    margin-left: auto;
}

#content {
    padding: 2rem;
    background: #f8f9fa;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.3rem; }

p {
    margin-bottom: 1rem;
    color: #555;
}

/* Links */
a {
    color: #3498db;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 4px;
    padding: 2px 4px;
}

a:hover {
    color: #2980b9;
    background-color: rgba(52, 152, 219, 0.1);
    text-decoration: none;
}

/* Modern Buttons */
input[type="submit"], 
input[type="button"], 
button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 100px;
}

input[type="submit"]:hover, 
input[type="button"]:hover, 
button:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

input[type="submit"]:active, 
input[type="button"]:active, 
button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Specific button styles for different actions */
input[type="submit"][name="save"] {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

input[type="submit"][name="save"]:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
}

input[type="submit"][name="commit"] {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

input[type="submit"][name="commit"]:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
}

input[type="submit"][name="cancel"] {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

input[type="submit"][name="cancel"]:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7b7d 100%);
}

/* Button spacing in forms */
.controls input[type="submit"] {
    margin-right: 0.5rem;
}

.controls input[type="submit"]:last-child {
    margin-right: 0;
}

/* Form Elements */
input[type="text"], 
input[type="password"], 
input[type="email"], 
input[type="number"],
textarea, 
select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

input[type="text"]:focus, 
input[type="password"]:focus, 
input[type="email"]:focus, 
input[type="number"]:focus,
textarea:focus, 
select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #3498db;
}

input[type="file"] {
    background: white;
    border: 2px dashed #e1e8ed;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

/* Modern Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

table.list {
    border: none;
}

table.list tr.header {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: white;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

table.list tr.header td {
    padding: 1rem;
    border: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table.list tr.even {
    background: #f8f9fa;
}

table.list tr.odd {
    background: white;
}

/* Hover effects only for data rows, not header */
table.list tr:not(.header):hover {
    background: rgba(52, 152, 219, 0.05);
    transform: scale(1.001);
    transition: all 0.2s ease;
}

/* Subtle hover effect for header row */
table.list tr.header:hover {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    transition: background 0.2s ease;
}

table.list tr td {
    padding: 1rem;
    border-bottom: 1px solid #e1e8ed;
    vertical-align: middle;
}

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

DIV.section {
	position: relative;
	margin: 1.0em 0px 10px 0px;
	padding: 1.2em 5px 5px 5px;
	border: 1px solid black;
}
	DIV.section H1 {
		display: inline;
		top: -0.7em;
		margin: 0px 0px 0px 0px;
		padding: 0px 2px 0px 0px;
		background: white;
		font-weight: bold;
		font-size: 10pt;
	}
	DIV.section H2 {
		position: relative;
		display: block;
		top: 0;
		margin: 5px 0px 3px 0px;
		padding: 0px 2px 0px 2px;
		background: white;
		font-weight: bold;
		font-size: 10pt;
		border-bottom: 1px solid black;
	}
	DIV.section P {
		margin: 0px 0px 5px 0px;
	}
	DIV.section SPAN.controls {
		font-size: 8pt;
	}
	DIV.section DIV.controls {
		clear: both;
		font-size: 8pt;
		margin: 0px 0px 5px 0px;
		text-align: right;
	}
	DIV.section DIV.controlsleft {
		clear: both;
		font-size: 8pt;
		margin: 0px 0px 5px 0px;
		text-align: left;
	}
	DIV.section > TEXTAREA {
		width: 100%;
		margin: 0px 0px 5px 0px;
	}
    
/* Modern Sections */
.section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e1e8ed;
    position: relative;
}

.section h1 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;

    display: inline-block;
}

.section h2 {
    color: #34495e;
    font-size: 1.2rem;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecf0f1;
}

/* Notice Boxes */
.notice {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border: 1px solid #c3e6cb;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    margin-bottom: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.notice h1 {
    color: #155724;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.notice p {
    color: #155724;
    margin-bottom: 0.5rem;
}

.notice cite {
    display: block;
    margin-top: 0.5rem;
    font-style: italic;
    opacity: 0.8;
}

/* Login Specific Styles */
.login {
    max-width: 400px;
    margin: 2rem auto;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.login td.title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #3498db;
}

.login td.label {
    width: 120px;
    padding: 0.75rem 1rem 0.75rem 0;
    font-weight: 600;
    color: #2c3e50;
}

.login td.input {
    padding: 0.75rem 0;
}

.login td.error {
    color: #e74c3c;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
    margin: 0.5rem 0;
}

.login td.controls {
    padding: 1.5rem 0 0 0;
    text-align: center;
    border-top: 2px solid #ecf0f1;
    margin-top: 1rem;
}

/* Status Indicators */
.status-ready {
    color: #27ae60;
    font-weight: 600;
    background: rgba(39, 174, 96, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.status-error {
    color: #e74c3c;
    font-weight: 600;
    background: rgba(231, 76, 60, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.status-pending {
    color: #f39c12;
    font-weight: 600;
    background: rgba(243, 156, 18, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.status-expired {
    color: #95a5a6;
    font-weight: 600;
    background: rgba(149, 165, 166, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 0.9rem;
        background: #f8f9fa;
    }
    
    #main {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        width: 100%;
        max-width: none;
        box-shadow: none;
    }
    
    #header {
        padding: 0.5rem 1rem !important;
        font-size: 1.2rem;
        height: auto !important;
        min-height: 60px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        min-height: 50px;
    }
    
    .header-logo {
        order: 1;
    }
    
    .header-logo-image {
        height: 32px;
    }
    
    .header-fetitle {
        order: 2;
        font-size: 1rem;
        margin-left: 0;
        text-align: center;
    }
    
    #content {
        padding: 1rem;
        overflow-x: hidden;
    }
    
    .section {
        padding: 1rem;
        margin: 1rem 0;
        overflow-x: hidden;
    }
    
    .section h1 {
        font-size: 1.4rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Table mobile handling */
    table.list {
        font-size: 0.8rem;
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    table.list thead,
    table.list tbody,
    table.list tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    table.list tr.header {
        position: sticky;
        top: 0;
        z-index: 2;
    }
    
    table.list tr.header td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
        white-space: normal;
        word-break: break-word;
        hyphens: auto;
    }
    
    table.list tr td {
        padding: 0.5rem 0.25rem;
        white-space: normal;
        word-break: break-word;
        hyphens: auto;
        vertical-align: top;
    }
    
    /* Specific column widths for mobile */
    table.list tr td:nth-child(1) { width: 20%; } /* Hostname */
    table.list tr td:nth-child(2) { width: 15%; } /* Date */
    table.list tr td:nth-child(3) { width: 25%; } /* Description */
    table.list tr td:nth-child(4) { width: 20%; } /* Status */
    table.list tr td:nth-child(5) { width: 10%; } /* Last Online */
    table.list tr td:nth-child(6) { width: 10%; } /* Expires */
    
    /* Form mobile handling */
    .form td.label {
        width: 100%;
        display: block;
        padding: 0.5rem 0;
    }
    
    .form td.input {
        width: 100%;
        display: block;
        padding: 0 0 1rem 0;
    }
    
    .login {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    /* Notice mobile handling */
    .notice {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .notice h1 {
        font-size: 1.3rem;
    }
    
    /* Page footer mobile handling */
    #pagefooter {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    #page-footer {
        width: 100%;
    }
    
    #page-footer td {
        padding: 0.5rem;
    }
    
    #page-footer td.left {
        text-align: left;
    }
    
    #page-footer td.right {
        text-align: right;
    }
    
    /* Content footer mobile handling */
    #contentfooter {
        padding: 0.75rem;
    }
    
    #content-footer {
        width: 100%;
    }
    
    #content-footer td {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    #content-footer td.left,
    #content-footer td.middle,
    #content-footer td.right {
        text-align: center;
    }
    
    /* Ensure links don't break layout */
    table.list tr td a {
        word-break: break-all;
        display: inline-block;
        max-width: 100%;
    }
    
    /* Status text handling */
    table.list tr td:nth-child(4) {
        white-space: normal;
        word-break: break-word;
    }
    
    /* Description column can wrap */
    table.list tr td:nth-child(3) {
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    #header {
        font-size: 1rem;
        padding: 0.5rem !important;
        min-height: 50px;
    }
    
    .header-content {
        min-height: 40px;
    }
    
    .header-logo-image {
        height: 28px;
    }
    
    .header-fetitle {
        font-size: 0.9rem;
    }
    
    #content {
        padding: 0.75rem;
    }
    
    .section {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }
    
    .section h1 {
        font-size: 1.2rem;
    }
    
    /* Even smaller table text */
    table.list {
        font-size: 0.7rem;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    table.list thead,
    table.list tbody,
    table.list tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    table.list tr.header td {
        font-size: 0.65rem;
        padding: 0.4rem 0.2rem;
        white-space: normal;
        word-break: break-word;
    }
    
    table.list tr td {
        padding: 0.4rem 0.2rem;
        white-space: normal;
        word-break: break-word;
    }
    
    /* Adjust column widths for very small screens */
    table.list tr td:nth-child(1) { width: 22%; } /* Hostname */
    table.list tr td:nth-child(2) { width: 13%; } /* Date */
    table.list tr td:nth-child(3) { width: 27%; } /* Description */
    table.list tr td:nth-child(4) { width: 22%; } /* Status */
    table.list tr td:nth-child(5) { width: 8%; }  /* Last Online */
    table.list tr td:nth-child(6) { width: 8%; }  /* Expires */
    
    input[type="submit"], 
    input[type="button"], 
    button {
        width: 100%;
        margin: 0.25rem 0;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .notice {
        padding: 0.75rem;
    }
    
    .notice h1 {
        font-size: 1.1rem;
    }
    
    #pagefooter {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    #header {
        padding: 0.4rem !important;
        min-height: 45px;
    }
    
    .header-logo-image {
        height: 24px;
    }
    
    .header-fetitle {
        font-size: 0.8rem;
    }
    
    #content {
        padding: 0.5rem;
    }
    
    .section {
        padding: 0.5rem;
        margin: 0.5rem 0;
    }
    
    table.list {
        font-size: 0.65rem;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    table.list thead,
    table.list tbody,
    table.list tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    table.list tr.header td {
        font-size: 0.6rem;
        padding: 0.3rem 0.15rem;
        white-space: normal;
        word-break: break-word;
    }
    
    table.list tr td {
        padding: 0.3rem 0.15rem;
        white-space: normal;
        word-break: break-word;
    }
    
    /* Stack columns for very small screens */
    table.list {
        table-layout: auto;
    }
    
    table.list tr td:nth-child(1) { width: auto; }
    table.list tr td:nth-child(2) { width: auto; }
    table.list tr td:nth-child(3) { width: auto; }
    table.list tr td:nth-child(4) { width: auto; }
    table.list tr td:nth-child(5) { width: auto; }
    table.list tr td:nth-child(6) { width: auto; }
    
    /* Content footer extra small screen handling */
    #contentfooter {
        padding: 0.5rem;
    }
    
    #content-footer td {
        padding: 0.3rem;
        font-size: 0.75rem;
    }
    
    #pagefooter {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.hidden { display: none; }
.visible { display: block; }

/* Loading States */
.loading {
    opacity: 0.8;
    position: relative;
}

.loading::after {
    content: '';
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        color: #e1e8ed;
    }
    
    #main {
        background: #2c3e50;
        color: #e1e8ed;
    }
    
    #content {
        background: #34495e;
    }
    
    .section {
        background: #2c3e50 !important;
        border-color: #4a5568;
    }
    
    /* Dark mode for pill sections */
    .section-bordered {
        background: #2c3e50 !important;
        border-color: #4a5568;
    }
    
    .section-title-pill {
        background: #2c3e50 !important;
        border-color: #4a5568 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    
    .section-title-pill h1 {
        color: #e1e8ed;
    }
    
    .section-content {
        color: #e1e8ed;
    }
    
    /* Form table styling for dark mode */
    table.entryform {
        color: #e1e8ed !important;
    }
    
    table.entryform td.entrylabel {
        color: #e1e8ed !important;
        font-weight: 600;
    }
    
    table.entryform td.input {
        color: #e1e8ed !important;
    }
    
    table.entryform td.controls {
        color: #e1e8ed !important;
    }
    
    /* Override default.css specific selectors */
    TABLE.entryform TD.entrylabel {
        color: #e1e8ed !important;
    }
    
    TABLE.entryform TD.input {
        color: #e1e8ed !important;
    }
    
    TABLE.entryform TD.controls {
        color: #e1e8ed !important;
    }
    
    /* Override form table styles */
    TABLE.form TD.entrylabel {
        color: #e1e8ed !important;
    }
    
    TABLE.form TD.input {
        color: #e1e8ed !important;
    }
    
    TABLE.form TD.controls {
        color: #e1e8ed !important;
    }
    
    /* Most specific selectors to override everything */
    body TABLE.entryform TD.entrylabel {
        color: #e1e8ed !important;
    }
    
    body TABLE.entryform TD.input {
        color: #e1e8ed !important;
    }
    
    body TABLE.entryform TD.controls {
        color: #e1e8ed !important;
    }
    
    body TABLE.form TD.entrylabel {
        color: #e1e8ed !important;
    }
    
    body TABLE.form TD.input {
        color: #e1e8ed !important;
    }
    
    body TABLE.form TD.controls {
        color: #e1e8ed !important;
    }
    

    
    /* Form elements in dark mode */
    input[type="text"], 
    input[type="password"], 
    input[type="email"], 
    input[type="number"],
    textarea, 
    select {
        background: #34495e;
        border-color: #4a5568;
        color: #e1e8ed;
    }
    
    input[type="text"]:focus, 
    input[type="password"]:focus, 
    input[type="email"]:focus, 
    input[type="number"]:focus,
    textarea:focus, 
    select:focus {
        border-color: #3498db;
        box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    }
    
    /* Checkbox styling for dark mode */
    input[type="checkbox"] {
        background: #34495e;
        border-color: #4a5568;
    }
    
    /* Select dropdown styling */
    select option {
        background: #34495e;
        color: #e1e8ed;
    }
    
    /* Headings in dark mode */
    h1, h2, h3, h4, h5, h6 {
        color: #e1e8ed;
    }
    
    /* Links in dark mode */
    a {
        color: #3498db;
    }
    
    a:hover {
        color: #2980b9;
        background-color: rgba(52, 152, 219, 0.2);
    }
    
    /* Notice and error styling for dark mode */
    .notice {
        background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
        color: #e1e8ed;
    }
    
    .notice h1 {
        color: #e1e8ed;
    }
    
    .notice p {
        color: rgba(225, 232, 237, 0.9);
    }
    
    .error {
        background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
        color: #e1e8ed;
    }
    
    .success {
        background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
        color: #e1e8ed;
    }
    
    /* Section title card in dark mode */
    .section-title-card {
        background: #2c3e50;
        border-color: #4a5568;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    
    .section-title-card h1 {
        color: #e1e8ed;
    }
    
    table.list tr.even {
        background: #34495e;
    }
    
    table.list tr.odd {
        background: #2c3e50;
    }
    
    /* Page footer in dark mode */
    #contentfooter {
        background: #2c3e50;
        border-color: #4a5568;
        color: #e1e8ed;
    }
    
    #pagefooter {
        background: #1a1a2e;
        color: #e1e8ed;
    }
    
    /* Header styling for dark mode */
    #header {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
        color: white !important;
        border-bottom: none !important;
    }
    
    .header-title {
        color: white !important;
    }
    
    .header-fetitle {
        color: white !important;
    }
    
    /* Page footer styling for dark mode */
    #pagefooter {
        background: #2c3e50 !important;
        color: white !important;
        border-top: 1px solid #4a5568 !important;
    }
    
    #page-footer a {
        color: #3498db !important;
    }
    
    #page-footer a:hover {
        color: #2980b9 !important;
    }
    
    /* Table page-footer styling for dark mode */
    table#page-footer {
        background: #2c3e50 !important;
    }
    
    table#page-footer td {
        background: #2c3e50 !important;
        color: white !important;
    }
    
    /* Table background for dark mode */
    table {
        background: #2c3e50 !important;
    }
    
    /* DIV.section H1 styling for dark mode */
    DIV.section H1 {
        background: #2c3e50 !important;
        color: #e1e8ed !important;
    }
    
    DIV.section H2 {
        background: #2c3e50 !important;
        color: #e1e8ed !important;
        border-bottom-color: #4a5568 !important;
    }
}


/* Page footer and legacy layout handling */
#contentfooter {
    padding: 1rem;

}

#content-footer {
    width: 100%;
    border-collapse: collapse;
}

#content-footer td {
    padding: 0.5rem;
    vertical-align: top;
}

#content-footer td.left {
    text-align: left;
}

#content-footer td.middle {
    text-align: center;
}

#content-footer td.right {
    text-align: right;
}

#pagefooter {
    background: white;
    color: #2c3e50;
    padding: 1rem;
    font-size: 0.9rem;
    border-top: 1px solid #e9ecef;
}

#page-footer {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

#page-footer td {
    padding: 0.5rem;
    vertical-align: middle;
}

#page-footer td.left {
    text-align: left;
}

#page-footer td.right {
    text-align: right;
}

#page-footer a {
    color: #3498db;
    text-decoration: none;
}

#page-footer a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Table layout structure handling */
#main > tr {
    display: table-row;
}

#main > tr > td {
    display: table-cell;
    vertical-align: top;
}

#main > tr > td[colspan="2"] {
    display: table-cell;
}

/* Ensure proper table behavior */
table {
    border-collapse: collapse;
    width: 100%;
} 

.section-title-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 18px 28px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e0e0e0;
    width: 100%;
    display: block;
  }
  .section-title-card h1 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: #222;
  }
  
.section-bordered {
    border: 1.5px solid #d0d0d0;
    border-radius: 14px;
    padding: 2px 2px 2px 2px;
    padding-top: 10px;
    background: #fff;
    position: relative;
  }
  .section-bordered:not(:last-of-type) {
    margin-bottom: 20px;
  }
  /* Handle case when both .section and .section-bordered are used together */
  .section.section-bordered {
    padding: 2px 2px 2px 2px;
    padding-top: 10px;
  }
  /* Content wrapper for section-bordered */
  .section-content {
    margin-top: 1.5rem;
    width: 100%;
  }
  .section-title-pill {
    position: absolute;
    top: 0;
    left: 22px;
    transform: translateY(-50%);
    background: #fff;
    border-radius: 999px;
    padding: 0 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1.5px solid #d0d0d0;
    display: inline-block;
    z-index: 2;
    height: 1.7em;
    line-height: 1.7em;
    min-width: max-content;
    white-space: nowrap;
    text-align: center;
  }
  .section-title-pill h1 {
    margin: 0;
    font-size: 1.05em;
    font-weight: 600;
    color: #222;
    line-height: 1.7em;
    display: block;
    width: 100%;
    white-space: nowrap;
    text-align: center;
  }

/* Dark mode styling is handled in @media (prefers-color-scheme: dark) section */

body.dark-mode TABLE.entryform TD.controls {
    color: #e1e8ed !important;
}

.notice cite {
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
}

/* Error Notice Styles */
.error-notice {
    background-color: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.error-notice h1 {
    color: #c62828;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: bold;
}

.error-notice ul {
    margin: 0;
    padding-left: 20px;
}

.error-notice li {
    margin: 5px 0;
}