/* Sites In Minutes — Customer Dashboard
   Dark theme: navy #0f1b2d, accent orange #ff6b35 */

:root {
    --bg-darkest: #080f1a;
    --bg-dark: #0f1b2d;
    --bg-card: #162033;
    --bg-input: #1a2740;
    --bg-hover: #1e2f4a;
    --border: #253550;
    --border-light: #2d4060;
    --text-primary: #e8ecf1;
    --text-secondary: #8899ad;
    --text-muted: #5a6d82;
    --accent: #ff6b35;
    --accent-hover: #ff8255;
    --accent-glow: rgba(255, 107, 53, 0.15);
    --success: #34d399;
    --error: #f87171;
    --warning: #fbbf24;
    --info: #60a5fa;
    --sidebar-width: 260px;
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.2s ease;
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-darkest);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.brand-text {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 450;
    transition: all var(--transition);
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-item.active {
    color: var(--accent);
    background: var(--accent-glow);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.5rem 0.75rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-details {
    overflow: hidden;
}

.user-domain {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-link { color: var(--text-muted); }
.logout-link:hover { color: var(--error); background: rgba(248, 113, 113, 0.1); }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.content-area {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.card-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Grid */
.grid {
    display: grid;
    gap: 1.25rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    transition: all var(--transition);
}

.quick-link:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.quick-link-icon {
    width: 42px;
    height: 42px;
    background: var(--accent-glow);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-link-icon svg {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.quick-link-text {
    font-weight: 500;
    font-size: 0.9rem;
}

.quick-link-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge-error { background: rgba(248, 113, 113, 0.15); color: var(--error); }
.badge-warning { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.badge-info { background: rgba(96, 165, 250, 0.15); color: var(--info); }

.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

/* Forms */
.form-group {
    margin-bottom: 1.15rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238899ad' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
    border-color: rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.25);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Alerts */
.alert {
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
    border: 1px solid;
}

.alert-success { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.25); color: var(--success); }
.alert-error { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.25); color: var(--error); }
.alert-warning { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.25); color: var(--warning); }
.alert-info { background: rgba(96, 165, 250, 0.1); border-color: rgba(96, 165, 250, 0.25); color: var(--info); }

/* Tables */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

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

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bg-dark);
}

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

tr:hover td {
    background: var(--bg-hover);
}

td {
    font-size: 0.88rem;
}

/* Account Summary */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.summary-item {
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius);
}

.summary-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.summary-value {
    font-size: 1.15rem;
    font-weight: 600;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darkest);
    padding: 1.5rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand .brand-icon {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    margin: 0 auto 0.75rem;
}

.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.login-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.forgot-link {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: block;
    text-align: right;
    margin-top: -0.5rem;
    margin-bottom: 1.15rem;
}

.forgot-link:hover { color: var(--accent); }

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.empty-state p {
    font-size: 0.85rem;
}

/* Modal / Dialog */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 1.75rem;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Editor-specific styles */
.editor-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 120px);
    margin: -2rem;
}

.editor-sidebar {
    width: 320px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
}

.editor-preview {
    flex: 1;
    background: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
}

.editor-preview iframe {
    flex: 1;
    width: 100%;
    border: none;
}

.editor-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.editor-tab {
    padding: 0.85rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    font-family: inherit;
}

.editor-tab:hover {
    color: var(--text-primary);
}

.editor-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.editor-panel {
    display: none;
    padding: 1.25rem;
}

.editor-panel.active {
    display: block;
}

.editor-section {
    margin-bottom: 1.5rem;
}

.editor-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
}

.color-swatch input[type="color"] {
    width: 48px;
    height: 48px;
    border: none;
    cursor: pointer;
    margin: -6px;
}

.color-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.color-value {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-left: auto;
}

/* Theme presets */
.theme-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.theme-preset {
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: none;
    text-align: center;
    transition: all var(--transition);
    font-family: inherit;
}

.theme-preset:hover {
    border-color: var(--border-light);
}

.theme-preset.active {
    border-color: var(--accent);
}

.theme-preset-colors {
    display: flex;
    gap: 3px;
    justify-content: center;
    margin-bottom: 0.35rem;
}

.theme-preset-colors span {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.theme-preset-name {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Font selector */
.font-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: all var(--transition);
    background: none;
    width: 100%;
    text-align: left;
    color: var(--text-primary);
    font-family: inherit;
}

.font-option:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.font-option.active {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.font-option-name {
    font-size: 0.88rem;
}

.font-option-preview {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* Services editor */
.service-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.service-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.service-item-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.service-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    font-size: 1.1rem;
    transition: color var(--transition);
}

.service-remove:hover {
    color: var(--error);
}

/* Testimonials editor */
.testimonial-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.testimonial-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

/* Editor toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--bg-dark);
    border-top: 1px solid var(--border);
}

.editor-status {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.editor-status.saved {
    color: var(--success);
}

.editor-status.unsaved {
    color: var(--warning);
}

/* Preview toolbar */
.preview-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.preview-size-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
    transition: all var(--transition);
}

.preview-size-btn:hover,
.preview-size-btn.active {
    border-color: var(--accent);
    color: var(--accent);
}

.preview-url {
    flex: 1;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.preview-refresh {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.35rem;
    transition: color var(--transition);
}

.preview-refresh:hover {
    color: var(--accent);
}

.preview-refresh svg {
    width: 18px;
    height: 18px;
}

/* Credential display */
.credential-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
}

.credential-value {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.credential-copy {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    transition: color var(--transition);
}

.credential-copy:hover {
    color: var(--accent);
}

/* Password visibility toggle */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 15, 26, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .content-area {
        padding: 1.25rem;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .editor-layout {
        flex-direction: column;
    }

    .editor-sidebar {
        width: 100%;
        max-height: 50vh;
    }

    .editor-preview {
        min-height: 300px;
    }

    .top-bar {
        padding: 1rem 1.25rem;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .table-wrap {
        font-size: 0.82rem;
    }

    th, td {
        padding: 0.6rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }
}

/* Utility */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
