/* Professional Dashboard Theme for Secure Area */
@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700');

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    /* Do not override global site background here to avoid grey background bleed */
}

/* Dashboard Container */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Cancel out #wrapper2 20px horizontal padding in secure layout so content aligns flush */
#wrapper2 .dashboard-wrapper {
    margin-left: -20px;
    margin-right: -20px;
}

/* On mobile, reduce negative margins and add proper padding to main content */
@media (max-width: 768px) {
    #wrapper2 .dashboard-wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Ensure wrapper2 itself doesn't overflow */
    #wrapper2 {
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box !important;
    }
    
    /* Remove negative margins completely on small mobile */
    .dashboard-wrapper {
        margin: 0 !important;
    }
}

/* Left Sidebar */
.dashboard-sidebar {
    width: 280px;
    background: white;
    position: relative;
    min-height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e9ecef;
}

/* Sidebar header removed - duplicates main site header */

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0px 0;
    flex: 1;
}

.sidebar-nav h4 {
    padding: 0 20px;
    margin: 20px 0 12px 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #777;
    font-weight: 700;
}

.sidebar-nav h4:first-child {
    margin-top: 0;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: #f8f9fa;
    color: #00498f;
    border-left-color: #00498f;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}


.sidebar-nav a.active {
    background: #f8f9fa;
    color: #00498f;
    font-weight: 600;
    border-left-color: #00498f;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.sidebar-nav a.highlight {
    color: #cc0000;
    font-weight: 600;
}

.sidebar-nav a.highlight:hover {
    color: white;
    background: #cc0000;
    border-left-color: #cc0000;
}


/* Sidebar Stats */
.sidebar-stats {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
    margin-top: auto;
}

.stat-badge {
    display: inline-block;
    background: #00498f;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,73,143,0.2);
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    padding: 40px;
    background: #f8f9fa;
    min-height: 100vh;
    max-width: 100%;
    box-sizing: border-box;
}


.content-header {
    margin-bottom: 30px;
}

.content-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
    color: #00498f;
}

.content-header p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.card h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

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

.stat-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #00498f;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e9ecef;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #eee;
}

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

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

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

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #00498f;
    box-shadow: 0 0 0 3px rgba(0, 73, 143, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: #00498f;
    color: white;
}

.btn-primary:hover {
    background: #003a70;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 73, 143, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

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

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

.btn-outline {
    background: transparent;
    border: 2px solid #00498f;
    color: #00498f;
}

.btn-outline:hover {
    background: #00498f;
    color: white;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Mobile Responsive */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #00498f;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }
    
    .dashboard-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
    }
    
    .dashboard-sidebar.active {
        transform: translateX(0);
    }
    
    .dashboard-wrapper {
        flex-direction: column;
    }
    
    .dashboard-main {
        padding: 20px 15px;
        padding-top: 70px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-header h1 {
        font-size: 24px;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #00498f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #6c757d; }
.text-danger { color: #dc3545; }
.text-success { color: #28a745; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-3 { margin-top: 30px; }
.mb-3 { margin-bottom: 30px; }
.p-0 { padding: 0; }
.p-3 { padding: 30px; }

/* Upgrade Page - Scoped Styles */
.upgrade {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 12px;
}

.upgrade-title {
    text-align: center;
    font-size: 28px;
    margin: 0 0 6px;
}

.upgrade-subtitle {
    text-align: center;
    color: #666;
    margin: 0 0 8px;
}

.upgrade .pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 22px 0;
}

@media (max-width: 900px) {
    .upgrade .pricing-grid { grid-template-columns: 1fr; }
}

.upgrade .plan {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden; /* ensure inner elements respect rounded corners */
}

.upgrade .plan.highlight {
    border-color: #3b82f6;
    box-shadow: 0 10px 24px rgba(59,130,246,0.20);
}

.upgrade .plan h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

.upgrade .price {
    font-size: 30px;
    font-weight: 700;
    margin: 6px 0 10px;
}

.upgrade .bill { color: #6b7280; font-size: 14px; }

.upgrade .pill {
    position: absolute;
    top: 12px; right: 12px;
    background: #3b82f6; color: #fff;
    padding: 4px 10px; border-radius: 999px; font-size: 12px;
}

.upgrade .features { list-style: none; padding: 0; margin: 12px 0 14px; }
.upgrade .features li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed #eee; }
.upgrade .features li:last-child { border-bottom: none; }
.upgrade .tick { width: 18px; height: 18px; }
.upgrade .cta { margin-top: 8px; }
.upgrade .cta .pricebutton { margin: 0; }

/* Upgrade CTA buttons */
.upgrade .btn {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
}
.upgrade .btn-full {
    width: 100%;
    display: block;
    box-sizing: border-box; /* avoid overflow when padding is applied */
}
.upgrade .btn-primary {
    background: #3b82f6;
    color: #fff;
}
.upgrade .btn-primary:hover {
    background: #2563eb;
}

.upgrade .compare {
    margin-top: 26px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.upgrade .compare table { width: 100%; border-collapse: collapse; }
.upgrade .compare th, .upgrade .compare td { padding: 14px 12px; text-align: center; }
.upgrade .compare th { background: #f8fafc; font-size: 14px; }
.upgrade .compare td.left { text-align: left; }
.upgrade .compare tr:nth-child(even) td { background: #fcfcfc; }

.upgrade .subtle { text-align: center; color: #6b7280; margin-top: 12px; }

/* Testimonials grid */
.upgrade-testimonials {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

@media (max-width: 800px) {
    .upgrade-testimonials { grid-template-columns: 1fr; }
}

.upgrade-testimonials .titem {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px 14px;
}

.upgrade-testimonials .tmeta { display: flex; align-items: center; gap: 8px; color: #555; font-weight: 600; margin-bottom: 6px; }
.upgrade-testimonials .ttext { color: #333; }
