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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Auth Screen */
.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 4px;
    font-size: 1.5rem;
    color: #1a1a2e;
}

.auth-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

/* Header */
header {
    background: #1a1a2e;
    color: #fff;
    padding: 16px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.header-content h1 {
    font-size: 1.3rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    font-weight: 500;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #4361ee;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #3a56d4;
}

.btn-secondary {
    background: #e2e8f0;
    color: #333;
}

.btn-secondary:hover:not(:disabled) {
    background: #cbd5e1;
}

.btn-danger {
    background: #e63946;
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #c1121f;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.btn-close:hover {
    color: #333;
}

/* Table */
main {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 24px;
}

.table-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

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

thead th {
    background: #f8f9fa;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    border-bottom: 2px solid #e2e8f0;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}

tbody tr:hover {
    background: #f8faff;
}

tbody tr:last-child td {
    border-bottom: none;
}

.loading {
    text-align: center;
    color: #888;
    padding: 32px !important;
    font-style: italic;
}

.empty-state {
    text-align: center;
    color: #888;
    padding: 32px !important;
}

.client-name {
    font-weight: 600;
    color: #1a1a2e;
}

.domain-link {
    color: #4361ee;
    text-decoration: none;
}

.domain-link:hover {
    text-decoration: underline;
}

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

.badge-yes {
    background: #d4edda;
    color: #155724;
}

.badge-no {
    background: #f8d7da;
    color: #721c24;
}

.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.action-btns .btn {
    font-size: 0.8rem;
    padding: 5px 10px;
}

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

.modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header h2 {
    font-size: 1.2rem;
    color: #1a1a2e;
}

.modal form {
    padding: 20px 24px 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #444;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.form-group input[type="file"] {
    width: 100%;
    padding: 8px 0;
    font-size: 0.9rem;
}

.error-msg {
    background: #fff5f5;
    color: #c1121f;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    border: 1px solid #f5c6cb;
}

.error-msg.hidden {
    display: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-container {
        border-radius: 0;
        margin: 0 -24px;
    }

    thead th,
    tbody td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .action-btns {
        flex-direction: column;
    }
}
