* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Layout */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Login Screen */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
}

.login-container h2 {
    text-align: center;
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-weight: normal;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

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

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-block {
    width: 100%;
    margin-bottom: 20px;
}

/* Header */
.app-header {
    background: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    font-size: 20px;
}

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

/* Navigation */
.app-nav {
    background: white;
    padding: 0 30px;
    border-bottom: 2px solid #ecf0f1;
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #7f8c8d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav-btn:hover {
    color: #2c3e50;
}

.nav-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

/* Mailbox */
.mailbox-container {
    display: flex;
    height: calc(100vh - 140px);
}

.mailbox-sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid #ecf0f1;
    padding: 20px;
}

.folder-list {
    margin-top: 10px;
}

.folder-item {
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: background-color 0.3s;
}

.folder-item:hover {
    background-color: #ecf0f1;
}

.folder-item.active {
    background-color: #3498db;
    color: white;
}

.mailbox-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.email-list-container {
    flex: 1;
    background: white;
    overflow-y: auto;
}

.email-list-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.email-list {
    padding: 0;
}

.email-item {
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: background-color 0.3s;
}

.email-item:hover {
    background-color: #f8f9fa;
}

.email-item.unread {
    background-color: #e8f4f8;
    font-weight: 600;
}

.email-item-subject {
    font-weight: 500;
    margin-bottom: 5px;
}

.email-item-from {
    color: #7f8c8d;
    font-size: 13px;
    margin-bottom: 5px;
}

.email-item-preview {
    color: #95a5a6;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-detail-container {
    flex: 1;
    background: white;
    overflow-y: auto;
}

.email-detail-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.email-actions {
    display: flex;
    gap: 10px;
}

.email-detail-content {
    padding: 20px;
}

.email-detail-content h2 {
    margin-bottom: 20px;
}

.email-meta {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.email-meta div {
    margin-bottom: 8px;
}

.email-meta div:last-child {
    margin-bottom: 0;
}

.email-body {
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Admin Panel */
.admin-container {
    padding: 30px;
    background: white;
    min-height: calc(100vh - 140px);
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #ecf0f1;
}

.admin-tab-btn {
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #7f8c8d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.admin-tab-btn:hover {
    color: #2c3e50;
}

.admin-tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.admin-tab {
    display: none;
}

.admin-tab.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

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

.data-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ecf0f1;
}

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

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

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #2ecc71;
    color: white;
}

.badge-warning {
    background-color: #f39c12;
    color: white;
}

.badge-danger {
    background-color: #e74c3c;
    color: white;
}

.badge-info {
    background-color: #3498db;
    color: white;
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #95a5a6;
}

.close-modal:hover {
    color: #2c3e50;
}

.modal-content form {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Utilities */
.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
}

.success-message {
    color: #2ecc71;
    font-size: 14px;
    margin-top: 10px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons button {
    padding: 5px 10px;
    font-size: 12px;
}
