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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: #14141f;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-box h1 {
    font-size: 28px;
    color: #ffffff;
    margin-bottom: 4px;
}

.login-box .subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 32px;
}

.login-box h2 {
    font-size: 16px;
    color: #aaa;
    margin-bottom: 16px;
}

.login-box input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #1a1a2a;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
}

.login-box input:focus {
    border-color: #5a5aff;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #5a5aff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 4px;
}

.login-box button:hover {
    background: #4a4ae0;
}

.divider {
    color: #555;
    margin: 24px 0;
    font-size: 13px;
}

#message {
    margin-top: 16px;
    font-size: 14px;
    color: #ff5555;
}

/* NAV & TABS */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: #14141f;
    border-bottom: 1px solid #2a2a3a;
    flex-wrap: wrap;
    gap: 8px;
}

.top-nav h1 {
    font-size: 20px;
    color: #fff;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    font-size: 14px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid #2a2a3a;
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.tab-btn:hover {
    border-color: #5a5aff;
    color: #ccc;
}

.tab-btn.active {
    background: #5a5aff;
    border-color: #5a5aff;
    color: #fff;
}

.btn-logout {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.btn-logout:hover {
    border-color: #ff5555;
    color: #ff5555;
}

/* DASHBOARD */
.dashboard-content {
    padding: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

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

.dashboard-header h2 {
    font-size: 22px;
    color: #fff;
}

.btn-primary {
    padding: 10px 20px;
    background: #5a5aff;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background: #4a4ae0;
}

.btn-primary:disabled {
    background: #3a3a5a;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 10px 20px;
    background: transparent;
    color: #aaa;
    border: 1px solid #444;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-danger {
    border-color: #ff5555;
    color: #ff5555;
}

.btn-danger:hover {
    background: rgba(255, 85, 85, 0.1);
}

/* SITE CARDS */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.site-card {
    background: #14141f;
    border: 1px solid #2a2a3a;
    border-radius: 10px;
    padding: 20px;
}

.site-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-archive {
    background: transparent;
    border: none;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-archive:hover {
    color: #ff5555;
    background: rgba(255, 85, 85, 0.1);
}

.site-card h3 {
    color: #fff;
    margin: 8px 0 4px;
    font-size: 18px;
}

.site-card p {
    color: #777;
    font-size: 13px;
    margin-bottom: 4px;
}

.site-domain {
    color: #5a5aff !important;
    font-weight: 600;
    margin-bottom: 8px !important;
}

.site-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-draft { background: #333; color: #aaa; }
.status-generating { background: #3a2a00; color: #ffaa00; }
.status-preview { background: #002a3a; color: #00aaff; }
.status-deployed { background: #003a00; color: #44ff44; }
.status-archived { background: #2a0000; color: #ff5555; }

.site-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn-small {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.btn-generate { background: #5a5aff; color: #fff; }
.btn-preview { background: #00aaff; color: #fff; }
.btn-deploy { background: #44ff44; color: #000; }
.btn-live { background: #333; color: #44ff44; }
.btn-domain { background: #2a2a3a; color: #c9a94e; }
.btn-domain:hover { background: #3a3a4a; }
.btn-edit { background: #2a2a3a; color: #00aaff; }
.btn-edit:hover { background: #3a3a4a; }

.empty, .loading, .error {
    color: #666;
    font-size: 14px;
    text-align: center;
    padding: 40px;
}

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

.modal-content {
    background: #14141f;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content h2 {
    color: #fff;
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    color: #666;
    cursor: pointer;
}

.modal-close:hover {
    color: #fff;
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #1e1e2e;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    color: #ccc;
    font-size: 15px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.form-hint {
    color: #666;
    font-size: 12px;
    margin-bottom: 12px;
}

.modal-content label {
    display: block;
    color: #aaa;
    font-size: 13px;
    margin-bottom: 4px;
    margin-top: 12px;
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 10px 14px;
    background: #1a1a2a;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    border-color: #5a5aff;
}

.modal-content input[type="file"] {
    color: #aaa;
    font-size: 13px;
    margin-top: 4px;
}

/* COLORS */
.color-row {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.color-field {
    flex: 1;
}

.color-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-wrap input[type="color"] {
    width: 40px;
    height: 36px;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    padding: 2px;
}

.color-input-wrap input[type="text"] {
    flex: 1;
}

/* MEDIA */
.media-slot {
    margin-bottom: 16px;
    padding: 12px;
    background: #111119;
    border: 1px solid #1e1e2e;
    border-radius: 8px;
}

.media-slot label {
    margin-top: 0 !important;
    font-weight: 600;
}

.media-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.media-controls select {
    width: 120px;
    flex-shrink: 0;
}

.upload-status {
    font-size: 12px;
    color: #44ff44;
    white-space: nowrap;
}

.gallery-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.gallery-preview img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #2a2a3a;
}

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

#create-message,
#edit-message {
    margin-top: 12px;
    font-size: 14px;
}

/* MULTI PAGE */
.page-entry {
    background: #111119;
    border: 1px solid #1e1e2e;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.page-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.page-entry-header strong {
    color: #ccc;
    font-size: 14px;
}

.page-entry-header input.page-title {
    flex: 1;
    margin-right: 10px;
}

.btn-remove-page {
    background: transparent;
    border: none;
    color: #ff5555;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
}

.page-entry textarea.page-content {
    width: 100%;
    padding: 8px 12px;
    background: #1a1a2a;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.page-media-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #1e1e2e;
}

.page-media-section .media-slot {
    margin-bottom: 8px;
    padding: 8px;
}

.page-media-section .media-slot label {
    font-size: 12px;
}

.add-page-row {
    margin-bottom: 12px;
}

.multipage-presets {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.multipage-presets label {
    margin: 0 !important;
    font-size: 13px;
}

.btn-preset {
    padding: 6px 12px;
    background: #1a1a2a;
    border: 1px solid #2a2a3a;
    color: #aaa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.btn-preset:hover {
    border-color: #5a5aff;
    color: #fff;
}

/* DOMAIN */
.dns-record {
    background: #111119;
    border: 1px solid #1e1e2e;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.dns-record h4 {
    color: #ccc;
    font-size: 14px;
    margin-bottom: 12px;
}

.dns-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dns-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dns-label {
    color: #888;
    font-size: 13px;
    min-width: 100px;
}

.dns-value {
    color: #5a5aff;
    font-family: monospace;
    font-size: 14px;
    background: #1a1a2a;
    padding: 4px 10px;
    border-radius: 4px;
    user-select: all;
}

.btn-copy {
    padding: 4px 10px;
    background: #2a2a3a;
    color: #aaa;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-copy:hover {
    background: #3a3a4a;
    color: #fff;
}

.dns-help {
    background: #111119;
    border: 1px solid #1e1e2e;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.dns-help h4 {
    color: #ccc;
    font-size: 14px;
    margin-bottom: 10px;
}

.dns-help p {
    color: #888;
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.5;
}

.dns-help strong {
    color: #aaa;
}

.domain-success {
    color: #44ff44;
    font-size: 15px;
    margin-bottom: 12px;
}

.domain-url {
    color: #5a5aff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

#domain-message,
#dns-message {
    margin-top: 12px;
    font-size: 14px;
}

/* INVITE CODES */
.invites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.invite-card {
    background: #14141f;
    border: 1px solid #2a2a3a;
    border-radius: 10px;
    padding: 16px;
}

.invite-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.invite-code-text {
    font-family: monospace;
    font-size: 16px;
    color: #5a5aff;
    background: #1a1a2a;
    padding: 4px 10px;
    border-radius: 4px;
    user-select: all;
}

.invite-card p {
    color: #888;
    font-size: 13px;
    margin-bottom: 2px;
}

.invite-date {
    color: #555 !important;
    font-size: 12px !important;
}

#invite-message {
    margin-top: 12px;
    font-size: 14px;
}

/* BULK */
.bulk-container {
    max-width: 700px;
}

.bulk-result-item {
    color: #44ff44;
    font-size: 13px;
    padding: 4px 0;
}

.bulk-result-error {
    color: #ff5555;
    font-size: 13px;
    padding: 4px 0;
}

#bulk-message {
    margin-top: 12px;
    font-size: 14px;
}

#bulk-results {
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
}

/* EDIT MEDIA */
.edit-media-item {
    background: #111119;
    border: 1px solid #1e1e2e;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.edit-media-item strong {
    color: #ccc;
    font-size: 13px;
    text-transform: capitalize;
    display: block;
    margin-bottom: 8px;
}

.edit-media-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.edit-media-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #2a2a3a;
}

.edit-media-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-small-file {
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.edit-gallery-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.edit-gallery-thumb {
    position: relative;
    display: inline-block;
}

.edit-gallery-thumb img,
.edit-gallery-thumb video {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #2a2a3a;
}

.btn-remove-media {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff5555;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-remove-media:hover {
    background: #cc3333;
}