/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00a884;
    --secondary-color: #005c4b;
    --success-color: #00a884;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-bg: #111b21;
    --sidebar-bg: #202c33;
    --topbar-bg: #202c33;
    --card-bg: #ffffff;
    --text-primary: #111b21;
    --text-secondary: #667781;
    --border-color: #e9edef;
    --hover-bg: #f0f2f5;
    --chat-bg: #efeae2;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    color: var(--text-primary);
    line-height: 1.4;
    font-size: 14px;
}

/* Login Page Styles */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-container {
    width: 100%;
    max-width: 380px;
    padding: 16px;
}

.login-box {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 6px;
    font-weight: 600;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 13px;
}

.login-form {
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 13px;
}

.alert-error {
    background-color: #fee;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.login-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Dashboard Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 200px;
    background-color: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.2s;
    z-index: 1000;
}

.sidebar-header {
    padding: 12px;
    background-color: var(--topbar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h2 {
    font-size: 16px;
    color: white;
    font-weight: 600;
}

.sidebar-nav ul {
    list-style: none;
    padding: 4px 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 1px 6px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 6px;
    font-size: 13px;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-nav li.active a {
    background-color: var(--primary-color);
    color: white;
}

.sidebar-nav .icon {
    margin-right: 10px;
    font-size: 18px;
}

/* Main Content */
.main-content {
    margin-left: 200px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    background-color: white;
    padding: 8px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 4px;
}

.page-title {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-item {
    display: flex;
    align-items: center;
}

.notification {
    position: relative;
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notification:hover {
    background-color: var(--hover-bg);
}

.notification .badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 20px;
    transition: background-color 0.2s;
}

.user-info:hover {
    background-color: var(--hover-bg);
}

.user-avatar {
    font-size: 20px;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 4px;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    min-width: 140px;
    margin-top: 8px;
    border: 1px solid var(--border-color);
}

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s;
    font-size: 14px;
}

.user-dropdown a:hover {
    background-color: var(--hover-bg);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 12px;
}

.dashboard-welcome {
    margin-bottom: 16px;
}

.dashboard-welcome h2 {
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 20px;
    font-weight: 600;
}

.dashboard-welcome p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card {
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    font-size: 28px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--hover-bg);
    border-radius: 8px;
}

.stat-details h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-weight: 600;
}

.stat-details p {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Dashboard Section */
.dashboard-section {
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}

.dashboard-section h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: var(--hover-bg);
}

.data-table th,
.data-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.data-table th {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.data-table tbody tr:hover {
    background-color: var(--hover-bg);
}

/* Footer */
.footer {
    background-color: white;
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left p {
    color: var(--text-secondary);
    font-size: 12px;
}

.footer-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.footer-right a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
}

.footer-right a:hover {
    color: var(--primary-color);
}

.separator {
    color: var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
