/* Dashboard Specific Styles */

.dashboard-body {
    background-color: var(--bg-dark);
    overflow: hidden; /* Prevent body scroll, let main content scroll */
    height: 100vh;
}

.dashboard-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-main);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

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

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.sidebar-nav a i {
    width: 20px;
    margin-right: 15px;
    font-size: 1.1rem;
    text-align: center;
}

.sidebar-nav a:hover, .sidebar-nav li.active a {
    color: var(--text-light);
    background: rgba(55, 163, 84, 0.1);
    border-right: 3px solid var(--primary-green);
}

.sidebar-nav li.active a i {
    color: var(--primary-green);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--bg-card), var(--border-subtle));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
}

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

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-plan {
    font-size: 0.8rem;
    color: var(--accent-gold);
}

.logout-btn {
    color: var(--text-muted);
    transition: color 0.3s;
}

.logout-btn:hover {
    color: #e74c3c;
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-header {
    height: 70px;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0;
    background: rgba(36, 41, 48, 0.8);
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 15px;
    width: 300px;
    border: 1px solid transparent;
    transition: border-color 0.3s;
}

.search-bar:focus-within {
    border-color: var(--primary-green);
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 10px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-light);
    width: 100%;
    outline: none;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.icon-btn:hover {
    color: var(--text-light);
}

.notification-dot {
    position: absolute;
    top: 0;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--primary-green-glow);
}

.dashboard-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.welcome-section {
    margin-bottom: 30px;
}

.welcome-section h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.welcome-section p {
    color: var(--text-muted);
}

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

.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.stat-details h3 {
    font-size: 1.8rem;
    margin-bottom: 2px;
}

.stat-details p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-head h3 {
    font-size: 1.2rem;
}

.view-all {
    font-size: 0.9rem;
    color: var(--primary-green);
}

.view-all:hover {
    text-decoration: underline;
}

.quick-actions, .recent-documents {
    padding: 25px;
}

/* Templates List */
.templates-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.template-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.template-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-green);
    transform: translateX(5px);
}

.template-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-main);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-gold);
    margin-right: 15px;
}

.template-info {
    flex: 1;
}

.template-info h4 {
    font-size: 1rem;
    margin-bottom: 3px;
}

.template-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.btn-create {
    background: rgba(55, 163, 84, 0.1);
    color: var(--primary-green);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* Table */
.table-container {
    overflow-x: auto;
}

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

.documents-table th, .documents-table td {
    padding: 15px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.documents-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.documents-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-success {
    background: rgba(55, 163, 84, 0.1);
    color: var(--primary-green);
}

.status-warning {
    background: rgba(216, 178, 72, 0.1);
    color: var(--accent-gold);
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    margin-right: 10px;
    transition: color 0.3s;
}

.action-btn:hover {
    color: var(--text-light);
}

.mobile-toggle {
    display: none;
    margin-right: 15px;
}

/* Responsive Dashboard */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        transition: left 0.3s ease;
        height: 100vh;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    .sidebar.open {
        left: 0;
    }
    
    .mobile-toggle {
        display: block;
    }

    .dashboard-header {
        padding: 0 15px;
    }

    .search-bar {
        width: auto;
        flex: 1;
        margin-right: 15px;
    }

    .btn-text {
        display: none;
    }

    .new-doc-btn {
        padding: 10px 15px;
        border-radius: 50%;
    }

    .dashboard-content {
        padding: 15px;
    }

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

    .quick-actions, .recent-documents {
        padding: 15px;
    }
    
    .documents-table th:nth-child(2),
    .documents-table td:nth-child(2),
    .documents-table th:nth-child(3),
    .documents-table td:nth-child(3) {
        display: none; /* Hide non-essential columns on very small screens */
    }
}
