/* LegalDoc Professional SaaS Theme - Matching overview.png */
/* Google Fonts loaded via non-blocking <link> in HTML <head> for fast parallel parsing */

:root {
    --ld-navy-dark: #0a1322;
    --ld-navy-sidebar: #0d1a2d;
    --ld-navy-sidebar-hover: #16263f;
    --ld-navy-sidebar-active: #192d4b;
    --ld-navy-card: #0e1e36;
    --ld-primary: #12284c;
    --ld-primary-hover: #1c3866;
    --ld-gold: #c99839;
    --ld-gold-light: #e5b869;
    --ld-gold-badge-bg: #fdf5e6;
    --ld-gold-badge-border: #f2d184;
    --ld-gold-badge-text: #8c6008;
    --ld-bg-main: #f4f6fa;
    --ld-card-border: #e2e8f0;
    --ld-text-main: #1e293b;
    --ld-text-muted: #64748b;
    --ld-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --ld-font-devanagari: 'Noto Sans Devanagari', 'Plus Jakarta Sans', sans-serif;
}

body {
    font-family: var(--ld-font-family);
    background-color: var(--ld-bg-main);
    color: var(--ld-text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout Structure */
.app-container {
    display: flex;
    min-height: calc(100vh - 56px);
}

/* Sidebar */
.app-sidebar {
    width: 250px;
    background-color: var(--ld-navy-sidebar);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    border-right: 1px solid #1e293b;
    position: relative;
    background-image: radial-gradient(circle at bottom center, rgba(30, 58, 102, 0.25) 0%, transparent 70%);
}

.sidebar-header {
    padding: 24px 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #ffffff;
    gap: 12px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ld-gold-light);
    font-size: 28px;
}

.brand-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #ffffff;
    margin: 0;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 11px;
    color: #94a3b8;
    margin: 3px 0 0 0;
    letter-spacing: -0.1px;
}

/* Navigation items */
.sidebar-nav {
    list-style: none;
    padding: 16px 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-nav li {
    margin: 4px 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
    gap: 12px;
}

.sidebar-nav a i {
    font-size: 17px;
    color: #94a3b8;
    transition: color 0.15s ease;
}

.sidebar-nav a:hover {
    color: #ffffff;
    background-color: var(--ld-navy-sidebar-hover);
}

.sidebar-nav a:hover i {
    color: var(--ld-gold-light);
}

.sidebar-nav li.active a {
    color: #ffffff;
    background-color: var(--ld-navy-sidebar-active);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--ld-gold-light);
}

.sidebar-nav li.active a i {
    color: var(--ld-gold-light);
}

.sidebar-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-watermark {
    opacity: 0.15;
    margin-bottom: 8px;
}

.sidebar-company {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #64748b;
    text-transform: uppercase;
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.app-header {
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.header-search {
    position: relative;
    width: 320px;
}

.header-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    font-size: 13.5px;
    color: #334155;
    outline: none;
    transition: all 0.2s;
}

.header-search input:focus {
    background-color: #ffffff;
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(18, 40, 76, 0.08);
}

.header-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Premium Badge */
.plan-badge-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background-color: var(--ld-gold-badge-bg);
    border: 1px solid var(--ld-gold-badge-border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--ld-gold-badge-text);
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.plan-badge-pill:hover {
    transform: translateY(-1px);
    color: var(--ld-gold-badge-text);
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #1e293b;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.user-avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* Page Content Container */
.page-content {
    padding: 24px 28px;
    flex-grow: 1;
}

/* Hero Section */
.dashboard-hero {
    background: linear-gradient(135deg, #0a1322 0%, #112240 100%);
    background-color: #0d1a2d;
    border-radius: 8px;
    padding: 38px 36px;
    color: #ffffff;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(10, 19, 34, 0.08);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::after {
    content: "⚖";
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 160px;
    color: rgba(255, 255, 255, 0.03);
    pointer-events: none;
    font-family: serif;
}

.hero-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #ffffff;
}

.hero-title .gold-accent {
    color: var(--ld-gold-light);
}

.hero-subtitle {
    font-size: 14px;
    color: #cbd5e1;
    margin: 0;
}

/* 4 Metric Cards in a row */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--ld-card-border);
    border-radius: 8px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.metric-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.icon-blue { background-color: #eff6ff; color: #2563eb; }
.icon-amber { background-color: #fffbeb; color: #d97706; }
.icon-gold { background-color: #fefce8; color: #ca8a04; }
.icon-navy { background-color: #f1f5f9; color: #1e293b; }

.metric-details {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 2px;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

/* 3 Quick Action Buttons */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.action-btn-primary {
    background-color: var(--ld-primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(18, 40, 76, 0.15);
}

.action-btn-primary:hover {
    background-color: var(--ld-primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

.action-btn-secondary {
    background-color: #ffffff;
    color: #1e293b;
    border: 1px solid var(--ld-card-border);
    border-radius: 8px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.action-btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-1px);
}

/* Split Main Content Area */
.dashboard-content-split {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 20px;
}

/* White Cards */
.ld-card {
    background: #ffffff;
    border: 1px solid var(--ld-card-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.ld-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--ld-card-border);
}

.ld-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ld-card-link {
    font-size: 12.5px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.ld-card-link:hover {
    text-decoration: underline;
}

/* Data Tables */
.ld-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ld-table th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    padding: 12px 18px;
    text-align: left;
    border-bottom: 1px solid var(--ld-card-border);
    font-size: 12px;
}

.ld-table td {
    padding: 13px 18px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

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

.ld-table tr:hover td {
    background-color: #f8fafc;
}

/* Table action buttons */
.btn-table-action {
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.btn-table-action:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Right Premium Promotion Card */
.promo-premium-card {
    background: linear-gradient(145deg, #0e1e36 0%, #0a1424 100%);
    border-radius: 8px;
    padding: 28px 22px;
    color: #ffffff;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 14px rgba(10, 19, 34, 0.12);
    border: 1px solid rgba(201, 152, 57, 0.2);
}

.promo-scales-icon {
    font-size: 42px;
    color: var(--ld-gold-light);
    margin-bottom: 14px;
}

.promo-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ld-gold-light);
    margin: 0 0 8px 0;
}

.promo-text {
    font-size: 12.5px;
    color: #cbd5e1;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

.btn-gold {
    background-color: var(--ld-gold-light);
    color: #0a1322;
    font-weight: 700;
    font-size: 13.5px;
    padding: 10px 22px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: none;
}

.btn-gold:hover {
    background-color: #eed08d;
    color: #0a1322;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(229, 184, 105, 0.3);
}

/* Footer */
.app-footer {
    background-color: var(--ld-navy-dark);
    color: #94a3b8;
    font-size: 12px;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    margin-left: 18px;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: #ffffff;
}

/* Prevent horizontal scrolling on mobile */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Sidebar Backdrop on Mobile */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(10, 19, 34, 0.7);
    backdrop-filter: blur(2px);
    z-index: 1045;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-in-out;
}

.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-content-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    /* Container keeps sidebar offcanvas */
    .app-container {
        flex-direction: row;
        min-height: 100vh;
    }

    /* Offcanvas Slide-in Sidebar */
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: none;
    }

    .app-sidebar.show-mobile {
        transform: translateX(0);
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.5);
    }

    /* Main Area takes full width */
    .app-main {
        width: 100%;
        min-width: 0;
    }

    /* Mobile Header */
    .app-header {
        height: 58px;
        padding: 0 14px;
    }

    .header-actions {
        gap: 8px;
    }

    .header-search {
        display: none !important;
    }

    .plan-badge-pill {
        padding: 4px 10px;
        font-size: 11.5px;
        gap: 5px;
    }

    /* App Content Padding */
    .app-content {
        padding: 16px 12px;
    }

    /* Dashboard Hero */
    .dashboard-hero {
        padding: 22px 16px;
        border-radius: 8px;
        margin-bottom: 16px;
    }

    .hero-title {
        font-size: 20px;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 12.5px;
    }

    /* Metric Grid: 2 columns on small screens */
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .metric-card {
        padding: 12px;
        gap: 10px;
    }

    .metric-icon-wrapper {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .metric-label {
        font-size: 10.5px;
    }

    .metric-value {
        font-size: 17px;
    }

    /* Quick Action Buttons */
    .quick-actions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 20px;
    }

    .action-btn-primary, .action-btn-secondary {
        padding: 12px 14px;
        font-size: 13.5px;
    }

    /* Split section */
    .dashboard-content-split {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Floating WhatsApp Button on Mobile */
    .floating-whatsapp-btn {
        bottom: 16px;
        right: 16px;
        padding: 8px 12px;
        font-size: 12px;
        box-shadow: 0 3px 12px rgba(37, 211, 102, 0.4);
    }

    /* Tables & Cards */
    .ld-card {
        padding: 16px 14px;
        border-radius: 8px;
    }

    .ld-card-header {
        padding: 12px 14px;
    }

    .ld-table th, .ld-table td {
        padding: 10px 12px;
        font-size: 12.5px;
        white-space: nowrap;
    }

    /* Paper Sheet in Preview */
    .paper-sheet {
        padding: 20px 14px !important;
        font-size: 13.5px !important;
    }

    /* Form Inputs on Mobile (prevent iOS auto-zoom on focus by enforcing >= 16px) */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Footer on Mobile */
    .app-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 16px 14px;
    }

    .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .footer-links a {
        margin: 0;
    }
}

@media (max-width: 480px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }
}

/* Floating WhatsApp Button for Support & Feature Requests */
.floating-whatsapp-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #25D366;
    color: #ffffff !important;
    border-radius: 50px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    z-index: 1080;
    text-decoration: none !important;
    box-shadow: 0 4px 18px rgba(37, 211, 102, 0.45);
    transition: all 0.25s ease-in-out;
}

.floating-whatsapp-btn:hover {
    background-color: #1ebe5d;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.6);
    color: #ffffff !important;
}

.floating-whatsapp-btn i {
    font-size: 1.25rem;
}

