/* ==========================================================================
   Bidz365 Tools - Modern Light Theme Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-foreground: #ffffff;
    
    --secondary: #f1f5f9;
    --secondary-hover: #e2e8f0;
    --secondary-foreground: #334155;
    
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

img, svg {
    display: inline-block;
    vertical-align: middle;
}

/* Container */
.container {
    width: 100%;
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Document & Spacing Utilities */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; }
.mx-4 { margin-left: 1rem; margin-right: 1rem; }
.mx-6 { margin-left: 1.5rem; margin-right: 1.5rem; }
.mx-8 { margin-left: 2rem; margin-right: 2rem; }

.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-3 { margin-top: 0.75rem; margin-bottom: 0.75rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }

.font-bold, .font-semibold { font-weight: 700 !important; }
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-justify { text-align: justify !important; }
.underline { text-decoration: underline !important; }
.italic { font-style: italic !important; }
.w-full { width: 100% !important; }

/* Header */
header.site-header {
    padding: 1rem 0;
    background-color: transparent;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
}

.brand-text-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-text-logo:hover img {
    opacity: 0.85;
}

.brand-logo img, .brand-logo svg {
    height: 44px;
    width: auto;
    display: block;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
    box-shadow: var(--shadow-sm);
}

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

.btn-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--secondary);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background-color: var(--secondary);
    color: var(--text-main);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-round {
    border-radius: var(--radius-full);
}

/* Typography Utilities */
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }

/* Hero Section */
.hero-section {
    max-width: 860px;
    margin: 2rem auto 1.5rem;
    padding: 0 1rem;
    text-align: center;
}

.hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1.125rem;
    }
}

/* Search Bar */
.search-wrapper {
    position: relative;
    max-width: 100%;
    margin: 1.5rem auto 2rem;
}

.search-input-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1.25rem 0.875rem 3rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    font-size: 0.95rem;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

@media (min-width: 640px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tool-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.tool-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.5rem;
}

.tool-card-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.tool-card-action {
    display: flex;
    justify-content: flex-start;
}

/* How It Works Section */
.how-it-works-section {
    margin: 4rem auto;
    padding: 0 1rem;
}

.section-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 3rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.section-desc {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.step-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    background-color: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.step-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.step-content p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Need Help CTA */
.cta-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem 1.5rem;
    text-align: center;
    max-width: 860px;
    margin: 0 auto 4rem;
    box-shadow: var(--shadow-lg);
}

.cta-box h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.cta-box p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Footer */
footer.site-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: auto;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
    }
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.footer-nav a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Floating Bulk Button */
.floating-bulk-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 40;
    box-shadow: var(--shadow-xl);
}

/* Tool Generator View */
.tool-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: #475569;
    transition: background 0.15s ease;
}

.icon-btn:hover {
    background-color: #e2e8f0;
}

.form-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.form-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .form-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}

.form-control {
    width: 100%;
    height: 40px;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    font-size: 0.875rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s ease;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.25rem;
    appearance: none;
}

/* Generator Preview Box */
.preview-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.preview-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.margin-slider-control {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.margin-slider-control label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.margin-slider-control input[type="range"] {
    accent-color: var(--primary);
    cursor: pointer;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    font-family: 'Times New Roman', Times, serif;
    font-size: 14pt;
    line-height: 1.6;
    color: #000000;
    min-height: 650px;
    outline: none;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.02);
}

.preview-container:focus {
    border-color: var(--primary);
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

.modal-content {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.close-modal-btn:hover {
    background-color: var(--secondary);
    color: var(--text-main);
}

/* Checkbox Grid in Bulk Modal */
.cert-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem;
    max-height: 180px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #f8fafc;
}

@media (min-width: 640px) {
    .cert-checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cert-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
}

.cert-checkbox-item:hover {
    background-color: #e2e8f0;
}

/* Generated Bulk Documents List */
.bulk-generated-list {
    list-style: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 1.25rem;
    overflow: hidden;
}

.bulk-generated-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.bulk-generated-item:last-child {
    border-bottom: none;
}

.bulk-generated-item:hover {
    background-color: #f1f5f9;
}

/* Step-by-Step Instructions Area */
.instructions-area {
    margin: 3rem 0;
    padding: 0 0.5rem;
}

.instructions-area h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.instructions-area p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.instructions-area ol {
    margin-left: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.instructions-area ol li {
    margin-bottom: 1.25rem;
}

.instructions-area ol li h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.instructions-area ul {
    margin-left: 1.25rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   User Account Navigation & Dropdown Menu
   ========================================================================== */
.user-menu-wrapper {
    position: relative;
    display: inline-block;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
}

.avatar-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 700;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.user-avatar-btn:hover .avatar-circle {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
    overflow: hidden;
    animation: dropdownFadeIn 0.15s ease;
}

.user-dropdown-menu.active {
    display: block;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.925rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    background-color: #fafbfc;
}

.user-dropdown-list {
    list-style: none;
    padding: 0.35rem 0;
    margin: 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s;
}

.user-dropdown-item:hover {
    background-color: var(--secondary);
    color: var(--primary);
}

.user-dropdown-item svg {
    color: var(--text-muted);
    transition: color 0.15s;
}

.user-dropdown-item:hover svg {
    color: var(--primary);
}

.user-dropdown-item.text-danger:hover {
    color: #dc2626;
    background-color: #fef2f2;
}
.user-dropdown-item.text-danger:hover svg {
    color: #dc2626;
}

.user-dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.25rem 0;
}

/* ==========================================================================
   User Topbar & Dashboard Layout
   ========================================================================== */
.user-page-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-avatar-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
}

.user-topbar-info {
    display: flex;
    flex-direction: column;
}

.user-topbar-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    line-height: 1.2;
}

.user-topbar-email {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.btn-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
}
.btn-back-link:hover {
    color: var(--primary);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.925rem;
    font-weight: 500;
    transition: all 0.15s;
}

.sidebar-nav-item:hover {
    background-color: var(--secondary);
    color: var(--text-main);
}

.sidebar-nav-item.active {
    background-color: #dbeafe;
    color: var(--primary);
    font-weight: 600;
}

.dashboard-content {
    min-width: 0;
}

.dashboard-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.card-inner-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.25rem;
}

.form-label-caps {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #475569;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.form-hint-text {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.btn-text-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.btn-text-action:hover {
    text-decoration: underline;
}

.btn-danger {
    background-color: #ef4444;
    color: #ffffff;
    border: 1px solid #ef4444;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s;
}
.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
}

.text-danger {
    color: #dc2626 !important;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}
.badge-light {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid var(--border-color);
}
.badge-primary {
    background-color: #dbeafe;
    color: var(--primary);
}

/* ==========================================================================
   Authentication Pages
   ========================================================================== */
.auth-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.25rem;
    box-shadow: var(--shadow-md);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}
.auth-alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.auth-alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ==========================================================================
   Company Autofill & Banner Helpers
   ========================================================================== */
.company-autofill-banner {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.guest-autofill-tip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background-color: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    color: #1e40af;
    margin-bottom: 1.25rem;
}

.save-toast-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    color: #166534;
    margin-bottom: 1rem;
    animation: fadeIn 0.2s ease;
}

/* ==========================================================================
   Data Table & Toolbar
   ========================================================================== */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.bulk-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #1e40af;
    font-weight: 500;
}

.dashboard-empty-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3.5rem 1.5rem;
    text-align: center;
}

.data-table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table th {
    background-color: #fafbfc;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    white-space: nowrap;
    user-select: none;
}

.data-table th.sortable {
    cursor: pointer;
}
.data-table th.sortable:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.sort-icon {
    margin-left: 0.35rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

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

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

.table-pagination-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background-color: #fafbfc;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.pagination-btn:hover:not(.disabled) {
    background-color: var(--secondary);
    border-color: #cbd5e1;
}

.pagination-btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 0.4rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Custom Modals (Company, Delete, History Viewer)
   ========================================================================== */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 1rem;
}

.custom-modal.active {
    display: flex;
}

.custom-modal-dialog {
    background-color: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalFadeUp 0.2s ease-out;
}

@keyframes modalFadeUp {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.custom-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.custom-modal-body {
    padding: 1.5rem;
}

.custom-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: #fafbfc;
}

/* Print Specific */
@media print {
    *, *::before, *::after {
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    html, body {
        font-family: "Times New Roman", Times, serif !important;
        font-size: 13pt !important;
        line-height: 1.5 !important;
        color: #000000 !important;
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* Hide all website chrome and non-document elements */
    header,
    footer,
    nav,
    .site-header,
    .site-footer,
    .tool-page-header,
    .tool-intro-header,
    .form-card,
    .preview-toolbar,
    .preview-header-text,
    .floating-bulk-btn,
    .modal-overlay,
    .instructions-area,
    .cta-box,
    .hero-section,
    .search-wrapper,
    .tools-grid,
    .how-it-works-section,
    #noResultsMsg,
    .btn,
    button,
    input,
    select {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .container, main {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }

    .preview-card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        display: block !important;
    }

    /* Specifically display ONLY the document letter with proper margins */
    #previewDocumentContainer,
    #bulkDocumentContainer,
    .preview-container {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
        background: transparent !important;
        font-family: "Times New Roman", Times, serif !important;
        font-size: 13pt !important;
        line-height: 1.5 !important;
        color: #000000 !important;
        padding-left: 10mm !important;
        padding-right: 10mm !important;
        padding-bottom: 10mm !important;
    }

    .mx-8 {
        margin-left: 1rem !important;
        margin-right: 1rem !important;
    }

    .my-4 {
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }

    .mt-2 {
        margin-top: 0.5rem !important;
    }

    .ml-1 {
        margin-left: 0.25rem !important;
    }

    .py-10 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .font-bold {
        font-weight: 700 !important;
    }

    .text-center {
        text-align: center !important;
    }

    .text-right {
        text-align: right !important;
    }

    .text-left {
        text-align: left !important;
    }

    .text-justify {
        text-align: justify !important;
    }
}
