:root {
    --primary-blue: #1a237e;
    --secondary-blue: #283593;
    --accent-blue: #3949ab;
    --primary-red: #b71c1c;
    --secondary-red: #c62828;
    --light-bg: #f5f5f5;
    --white: #ffffff;
    --text-dark: #212121;
    --text-light: #757575;
    --sidebar-width: 250px;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--primary-blue);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.sidebar-nav ul {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--white);
    text-decoration: none;
    transition: background 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav .icon {
    display: none;
}

.sidebar-nav .logout-link {
    color: #ffcdd2;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .logout-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #ffcdd2;
    text-decoration: none;
    transition: background 0.3s;
}

.sidebar-footer .logout-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    background: var(--light-bg);
}

.admin-topbar {
    background: var(--white);
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-topbar h1 {
    margin: 0;
    font-size: 1.75rem;
    color: var(--primary-blue);
}

.admin-user {
    color: var(--text-light);
}

.admin-content {
    padding: 2rem;
}

/* Dashboard Stats */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    display: none;
}

.stat-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-number {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-blue);
}

/* Tables */
.recent-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recent-section h2 {
    margin: 0 0 1.5rem 0;
    color: var(--primary-blue);
}

.table-container {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--text-dark);
}

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

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-read {
    background: #fff3e0;
    color: #f57c00;
}

.status-replied {
    background: #e8f5e9;
    color: #388e3c;
}

/* Forms */
.form-container {
    max-width: 600px;
}

.form-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-card h2 {
    margin: 0 0 1.5rem 0;
    color: var(--primary-blue);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--secondary-blue);
}

/* Action Buttons */
.status-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.btn-view,
.btn-delete {
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin: 0 0.25rem;
}

.btn-view {
    background: var(--accent-blue);
    color: var(--white);
}

.btn-delete {
    background: var(--primary-red);
    color: var(--white);
}

.message-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: var(--white);
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
}

.close:hover {
    color: var(--text-dark);
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h2 {
    margin: 0;
    color: var(--primary-blue);
}

/* Login Page */
.login-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--light-bg);
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
}

.login-box h1 {
    color: var(--primary-blue);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
}

.btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: var(--secondary-blue);
}

.error {
    background: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    text-align: center;
}

/* Landing Pages Styles */
.page-header {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.page-header h2 {
    margin: 0;
    color: var(--primary-blue);
    font-size: 1.5rem;
}

.page-header p {
    margin: 0.5rem 0 0 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

.table-container {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-start;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    white-space: nowrap;
    text-align: center;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--secondary-blue);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #616161;
    color: var(--white);
}

.btn-secondary:hover {
    background: #424242;
    transform: translateY(-1px);
}

.btn-view {
    background: var(--accent-blue);
    color: var(--white);
}

.btn-view:hover {
    background: var(--primary-blue);
    transform: translateY(-1px);
}

.stats-summary {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-box {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-box h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-box .stat-number {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-blue);
}

/* Data Table Enhancements */
.data-table td {
    vertical-align: middle;
}

.data-table td:last-child {
    min-width: 280px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 200px;
    }
    
    .admin-main {
        margin-left: 200px;
    }
    
    .page-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .data-table td:last-child {
        min-width: auto;
    }
}

@media (max-width: 576px) {
    .admin-sidebar {
        width: 60px;
    }
    
    .admin-main {
        margin-left: 60px;
    }
    
    .sidebar-header h2,
    .sidebar-nav span,
    .sidebar-footer span {
        display: none;
    }
    
    .admin-topbar {
        padding: 1rem;
    }
    
    .admin-topbar h1 {
        font-size: 1.25rem;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1rem;
    }
    
    .page-header h2 {
        font-size: 1.25rem;
    }
    
    .table-container {
        padding: 1rem;
    }
}
