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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

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

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

/* Main Panel Styles */
.main-panel {
    min-height: 100vh;
    background: #f5f5f5;
}

.header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
}

.logout-btn:hover {
    background: #c0392b;
}

.container {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

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

.nav-link {
    display: block;
    padding: 15px 25px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background: #667eea;
    color: white;
}

/* Content Area */
.content {
    flex: 1;
    padding: 30px;
}

.tab-content {
    display: none;
}

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

.tab-content h2 {
    margin-bottom: 30px;
    color: #333;
}

/* Form Styles */
.ads-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group.full-width {
    grid-column: 1 / -1;
}

.input-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-group input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.submit-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #5a67d8;
}

/* Image Preview */
.image-preview {
    margin-top: 15px;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 5px;
}

/* Accounts Grid */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.account-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.account-card:hover {
    transform: translateY(-5px);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.account-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-passive {
    background: #f8d7da;
    color: #721c24;
}

.account-info {
    margin-bottom: 20px;
}

.account-info p {
    margin-bottom: 8px;
    color: #666;
}

.account-info strong {
    color: #333;
}

.account-image {
    text-align: center;
    margin-bottom: 20px;
}

.account-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #f0f0f0;
}

.account-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.account-actions.trash-actions {
    grid-template-columns: 1fr 1fr;
}

.account-actions:not(.trash-actions) {
    grid-template-columns: 1fr;
    gap: 8px;
}

.btn-activate,
.btn-deactivate,
.btn-trash,
.btn-edit,
.btn-main {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-activate {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

.btn-activate:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40,167,69,0.4);
}

.btn-deactivate {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    color: white;
    box-shadow: 0 4px 12px rgba(220,53,69,0.3);
}

.btn-deactivate:hover {
    background: linear-gradient(135deg, #c82333, #d91a72);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220,53,69,0.4);
}

.btn-trash {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    box-shadow: 0 4px 12px rgba(108,117,125,0.3);
    grid-column: 1 / -1;
    margin-top: 8px;
}

.btn-trash:hover {
    background: linear-gradient(135deg, #5a6268, #343a40);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108,117,125,0.4);
}

.btn-edit {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.btn-edit:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.4);
}

.btn-main {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: white;
    box-shadow: 0 4px 12px rgba(255,193,7,0.3);
}

.btn-main:hover {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,193,7,0.4);
}

.status-main {
    background: linear-gradient(135deg, #ffc107, #ff9800);
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 30px rgba(102,126,234,0.3);
}

.header-content h2 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
}

.header-content p {
    font-size: 16px;
    opacity: 0.9;
}

.header-stats .quick-stat {
    text-align: center;
    background: rgba(255,255,255,0.15);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.quick-number {
    display: block;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.quick-label {
    font-size: 14px;
    opacity: 0.8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.stat-card.primary {
    border-left: 5px solid #28a745;
}

.stat-card.warning {
    border-left: 5px solid #ffc107;
}

.stat-card.danger {
    border-left: 5px solid #dc3545;
}

.stat-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f8f9fa;
    color: #666;
    font-weight: bold;
}

.stat-card.primary .stat-icon {
    background: #d4edda;
    color: #28a745;
}

.stat-card.warning .stat-icon {
    background: #fff3cd;
    color: #ffc107;
}

.stat-card.danger .stat-icon {
    background: #f8d7da;
    color: #dc3545;
}

.stat-content h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-content .stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.stat-content p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.view-all {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
}

.view-all:hover {
    color: #5a67d8;
}

.activity-list {
    display: grid;
    gap: 15px;
}

.recent-item {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 10px;
    border-left: 4px solid #28a745;
    transition: background 0.3s;
}

.recent-item:hover {
    background: #e9ecef;
}

.recent-item h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
}

.recent-item p {
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.action-buttons {
    display: grid;
    gap: 15px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.action-btn.secondary {
    background: #28a745;
    color: white;
}

.action-btn.secondary:hover {
    background: #218838;
    transform: translateY(-2px);
}

.action-btn.tertiary {
    background: #6c757d;
    color: white;
}

.action-btn.tertiary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.action-btn.info {
    background: #17a2b8;
    color: white;
}

.action-btn.info:hover {
    background: #138496;
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 16px;
}

.btn-text {
    flex: 1;
    text-align: left;
}

/* Image Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
}

.modal-content img {
    width: 100%;
    height: auto;
    max-width: 800px;
    max-height: 600px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Edit Modal Styles */
.edit-modal {
    background-color: rgba(0, 0, 0, 0.7);
}

.edit-form {
    background: white;
    border-radius: 15px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.edit-form form {
    padding: 30px;
}

.edit-form .form-group {
    margin-bottom: 20px;
}

.edit-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.edit-form .form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.edit-form .form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.current-image {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
}

.current-image img {
    border-radius: 5px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-save {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.account-image img {
    cursor: pointer;
    transition: all 0.3s ease;
}

.account-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Copy functionality */
.copy-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: background 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: #138496;
}

.copy-btn.copied {
    background: #28a745;
}

.account-info .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.account-info .info-row span {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* Move to trash button */
.btn-trash {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.btn-trash:hover {
    background: #5a6268;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .nav-menu {
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }

    .nav-menu li {
        margin-right: 10px;
        margin-bottom: 0;
        white-space: nowrap;
    }

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

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

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

    .dashboard-sections {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
}

/* E-mails Tab Styles */
.emails-list {
    margin-top: 20px;
    overflow-x: auto;
}

.emails-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e0e0e0;
}

.emails-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.emails-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-right: 1px solid rgba(255,255,255,0.2);
    border-bottom: 2px solid #5568d3;
}

.emails-table th:last-child {
    border-right: none;
}

.emails-table th:nth-child(1) {
    width: 35%;
}

.emails-table th:nth-child(2) {
    width: 30%;
}

.emails-table th:nth-child(3) {
    width: 20%;
}

.emails-table th:nth-child(4) {
    width: 15%;
    text-align: center;
}

.emails-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

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

.emails-table tbody tr:last-child {
    border-bottom: none;
}

.emails-table td {
    padding: 12px 15px;
    vertical-align: middle;
    border-right: 1px solid #e0e0e0;
}

.emails-table td:last-child {
    border-right: none;
    text-align: center;
}

.table-cell-content {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.email-value {
    font-family: 'Courier New', monospace;
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 13px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid #e0e0e0;
}

.copy-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 40px;
}

.copy-btn:hover {
    background: #45a049;
}

.delete-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    white-space: nowrap;
    min-width: 60px;
}

.delete-btn:hover {
    background: #da190b;
}

@media (max-width: 768px) {
    .emails-table {
        font-size: 12px;
    }

    .emails-table th,
    .emails-table td {
        padding: 10px 8px;
    }

    .emails-table th:nth-child(1),
    .emails-table th:nth-child(2) {
        width: 35%;
    }

    .emails-table th:nth-child(3) {
        width: 20%;
    }

    .emails-table th:nth-child(4) {
        width: 10%;
    }

    .table-cell-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .email-value {
        width: 100%;
        font-size: 11px;
    }
}