/* Main Stylesheet for Office Daily Mail Management System */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-menu li.active a {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-left: 3px solid white;
}

.sidebar-menu li a i {
    margin-right: 10px;
    font-size: 18px;
}

.sidebar-menu .menu-header {
    padding: 15px 20px 5px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Topbar Styles */
.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-toggle {
    font-size: 24px;
    color: #6b7280;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1f2937;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
}

.user-role-badge {
    font-size: 11px;
    color: #6b7280;
    font-weight: 400;
    margin-top: 2px;
}

/* Content Area */
.content {
    padding: 25px;
    flex: 1;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 15px 20px;
    font-weight: 600;
}

.stat-card {
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card .card-body {
    padding: 20px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin: 10px 0;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 500;
}

.stat-icon {
    font-size: 40px;
    opacity: 0.3;
}

/* Tables */
.table {
    background: white;
}

.table thead th {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    color: #6b7280;
}

.table-hover tbody tr:hover {
    background: #f9fafb;
}

/* Badges */
.badge {
    padding: 5px 10px;
    font-weight: 500;
    font-size: 11px;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 8px 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Notifications Dropdown */
.notifications-dropdown {
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f9fafb;
}

.notification-item.unread {
    background: #eff6ff;
}

/* Pagination */
.pagination {
    margin: 20px 0;
}

.page-link {
    color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    .sidebar.show {
        margin-left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .user-info-wrapper {
        display: none;
    }
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.bg-primary-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* Sticky Footer */
.footer-sticky {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    padding: 8px 0;
    background: white !important;
    border-top: 1px solid #e5e7eb;
    z-index: 998;
    font-size: 14px;
}

.footer-sticky small {
    color: #6b7280;
}

/* Adjust main content to account for sticky footer */
.main-content {
    padding-bottom: 40px;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-sticky {
        left: 0;
    }
}