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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f0b400 0%, #d38a00 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

#templateBuilderContainer,
#collaborationContainer {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 30px;
    width: 100%;
}

.site-header {
    color: #1a1a1a;
    margin-bottom: 30px;
}

.header-content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 16px 22px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

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

.brand-logo {
    width: 52px;
    height: 52px;
    display: block;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,0.25));
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
}

.auth-section {
    display: flex;
    gap: 8px;
}

.btn-auth {
    padding: 8px 14px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.2);
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
}

.btn-auth:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-auth.btn-primary {
    background: #1a1a1a;
    color: #f0b400;
    border-color: #1a1a1a;
}

.btn-auth.btn-primary:hover {
    background: #f0f0f0;
}

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

.search-container.is-hidden {
    display: none;
}

.header-content .search-wrapper {
    margin: 0;
    max-width: 520px;
}

.header-content .search-filters {
    display: none;
}

.header-content .search-input {
    padding: 10px 16px;
    font-size: 0.9rem;
}

.header-content .search-btn {
    padding: 10px 18px;
    font-size: 0.85rem;
    border-radius: 999px;
}

.template-builder-wrapper {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 30px;
    width: 100%;
}

.template-builder-wrapper.is-hidden {
    display: none;
}

.user-menu {
    position: relative;
}

.user-menu button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    min-width: 200px;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: #f0f0f0;
}

.dropdown-menu a:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-menu a:last-child {
    border-radius: 0 0 8px 8px;
}

.inline-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

@media (max-width: 768px) {
    .header-content {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .header-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .brand-logo {
        width: 44px;
        height: 44px;
    }
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

@media (max-width: 1024px) {
    .main-content {
        gap: 20px;
    }
}

.form-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.form-section h2 {
    margin-bottom: 25px;
    color: #f0b400;
    font-size: 1.5rem;
}

.form-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-step {
    border: 1px solid #f0b400;
    border-radius: 12px;
    background: #fffdf6;
    overflow: hidden;
}

.form-step summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 18px;
    font-weight: 600;
    color: #3d2b00;
    background: linear-gradient(135deg, #fff4cf, #ffe7a3);
    position: relative;
}

.form-step summary::-webkit-details-marker {
    display: none;
}

.form-step summary::after {
    content: '▾';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    color: #c28500;
}

.form-step[open] summary::after {
    transform: translateY(-50%) rotate(180deg);
}

.step-body {
    padding: 18px;
    background: #fffef9;
}

.step-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.step-divider {
    margin: 12px 0 6px;
    color: #777;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px 20px;
    align-items: start;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.form-actions .btn-primary {
    width: auto;
}

.saved-company-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.saved-company-controls .btn {
    margin-left: 0;
    white-space: nowrap;
}

.field-hint {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 0.85rem;
}

.party-fields {
    border: 1px dashed #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    background: #fdf8e9;
}

.party-fields h3 {
    margin: 0 0 12px;
    color: #d38a00;
    font-size: 1.05rem;
}

.party-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 20px;
}

.is-hidden {
    display: none;
}

@media (max-width: 640px) {
    .saved-company-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions {
        justify-content: stretch;
    }

    .form-actions .btn-primary {
        width: 100%;
    }

    .documents-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #f0b400;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #f0b400;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #d38a00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 180, 0, 0.35);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-success {
    background: #4caf50;
    color: white;
    margin-left: 10px;
}

.btn-success:hover {
    background: #45a049;
}

.preview-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.preview-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h2 {
    color: #f0b400;
    font-size: 1.5rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons button {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.preview-content {
    padding: 40px;
    flex: 1;
    overflow-y: auto;
    max-height: none;
}

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #999;
}

.placeholder svg {
    margin-bottom: 20px;
}

.document {
    line-height: 1.8;
    color: #333;
}

.document h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #f0b400;
}

.document h2 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #444;
}

.document h3 {
    font-size: 1.2rem;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #555;
}

.document p {
    margin-bottom: 15px;
}

.document ul, .document ol {
    margin-left: 30px;
    margin-bottom: 15px;
}

.document li {
    margin-bottom: 8px;
}

.document .effective-date {
    color: #666;
    font-style: italic;
    margin-bottom: 30px;
}

.document .contact-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.document-footer {
    margin-top: 30px;
    padding-top: 12px;
    border-top: 1px solid #e5e5e5;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-large {
    max-width: 800px;
}

.template-editor-modal .modal-content {
    max-width: 1100px;
    margin: 5% auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #000;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-switch a {
    color: #f0b400;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Documents List */
.documents-page {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-top: 20px;
}

.documents-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.documents-page-header h2 {
    color: #f0b400;
    margin: 0 0 6px;
}

.documents-page-header p {
    margin: 0;
    color: #666;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.document-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.document-card:hover {
    border-color: #f0b400;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.document-card h4 {
    color: #f0b400;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.document-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 5px 0;
}

.document-card .document-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    font-size: 0.85rem;
    color: #999;
}

.document-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.document-actions button {
    flex: 1;
    padding: 8px;
    font-size: 0.85rem;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state svg {
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 10px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #f0b400;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

.share-link-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.share-link-container input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.share-link-container button {
    white-space: nowrap;
}

/* Success message */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===========================================
   ADMIN DASHBOARD STYLES
   =========================================== */

.admin-container {
    min-height: 100vh;
    background: #f8f9fa;
}

.admin-header {
    background: linear-gradient(135deg, #f0b400 0%, #d38a00 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-logo h1 {
    margin: 0;
    font-size: 1.5rem;
}

.admin-logo p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-user-info span {
    font-weight: 500;
}

/* Admin Navigation */
.admin-nav {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-nav ul {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    list-style: none;
    display: flex;
}

.admin-nav li {
    position: relative;
}

.admin-nav a {
    display: block;
    padding: 15px 20px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.admin-nav a:hover {
    color: #f0b400;
    background: #f8f9fa;
}

.admin-nav a.active {
    color: #f0b400;
    border-bottom-color: #f0b400;
    background: rgba(102, 126, 234, 0.05);
}

.admin-nav i {
    margin-right: 8px;
    width: 16px;
}

/* Admin Main Content */
.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.admin-section h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 600;
}

.template-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 15px 0;
}

.template-editor-toolbar .toolbar-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.template-variable-select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    background: white;
}

.template-editor-content {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    min-height: 420px;
    padding: 16px;
    background: #ffffff;
    overflow: auto;
}

.template-editor-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

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

.stat-icon:nth-child(1) { background: linear-gradient(135deg, #f0b400, #d38a00); }
.stat-icon:nth-child(2) { background: linear-gradient(135deg, #f6d55c, #f0b400); }
.stat-icon:nth-child(3) { background: linear-gradient(135deg, #ffd66b, #d38a00); }
.stat-icon:nth-child(4) { background: linear-gradient(135deg, #f0b400, #b47a00); }

.stat-content h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.stat-content p {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

/* Small stat cards for tracking overview */
.stat-card.small {
    padding: 15px;
}

.stat-card.small .stat-content h4 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.stat-card.small .stat-content p {
    margin: 3px 0 0 0;
    color: #666;
    font-size: 0.85rem;
}

/* Badge for counts */
.badge {
    display: inline-block;
    padding: 4px 8px;
    background: #f0b400;
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Subsection styling */
.subsection {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.subsection h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
}

.subsection h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #555;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Empty state */
.data-table td.empty {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 30px;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chart-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Data Tables */
.data-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

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

.data-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table .empty {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

.data-table .loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.suspended {
    background: #f8d7da;
    color: #721c24;
}

/* Actions */
.actions {
    display: flex;
    gap: 5px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.pagination-controls {
    display: flex;
    gap: 5px;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

/* Analytics Cards */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.analytics-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.analytics-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.stat-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-detail:last-child {
    border-bottom: none;
}

.stat-detail span {
    color: #666;
}

.stat-detail strong {
    color: #333;
    font-weight: 600;
}

/* System Logs */
.logs-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.logs-list {
    max-height: 600px;
    overflow-y: auto;
}

.log-entry {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.log-entry:hover {
    background: #f8f9fa;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.log-action {
    font-weight: 600;
    color: #f0b400;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.log-time {
    color: #999;
    font-size: 0.8rem;
}

.log-details {
    font-size: 0.9rem;
    color: #666;
}

.log-detail {
    margin-bottom: 5px;
    line-height: 1.4;
}

.log-admin, .log-ip {
    font-size: 0.8rem;
    color: #999;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.settings-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.settings-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

/* User Details Modal */
.user-details {
    max-width: none;
}

.user-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.info-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-card p {
    margin: 8px 0;
    line-height: 1.5;
}

.document-item, .email-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
}

.document-item strong, .email-item strong {
    color: #333;
}

.document-item small, .email-item small {
    color: #999;
    font-size: 0.8rem;
}

.user-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Admin Messages */
.admin-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1001;
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
}

.admin-message.error {
    background: #f44336;
}

.admin-message.warning {
    background: #ff9800;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .admin-main {
        padding: 20px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .section-actions {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .admin-header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    #templateBuilderContainer,
    #collaborationContainer {
        padding: 0 20px;
        margin: 20px auto;
    }

    .admin-nav ul {
        flex-wrap: wrap;
        padding: 0 15px;
    }

    .admin-nav a {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .data-table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
    }

    .user-info-grid {
        grid-template-columns: 1fr;
    }

    .user-actions {
        justify-content: center;
    }

    .pagination {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .admin-main {
        padding: 15px;
    }

    .stat-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== MODAL FIXES ===== */

/* Fix modal positioning and scrolling */
.modal {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto !important;
    z-index: 10000;
    padding: 20px;
    display: none;
}

.modal-content {
    position: relative;
    max-height: none !important;
    margin: 0 auto;
    max-width: 800px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-content.modal-large {
    max-width: 1200px;
}

/* User details modal specific fixes */
.user-details {
    padding: 20px;
}

.user-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.info-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.info-card h4 {
    color: #f0b400;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.info-card p,
.document-item,
.email-item {
    margin-bottom: 8px;
    color: #333;
}

.user-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* ===== THEME TOGGLE BUTTON ===== */

/* Theme Toggle Button - Light Mode */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    color: #333;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 9999;
}

.theme-toggle:hover {
    background: #f8f9fa;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}
