/* ============================================
   Kazepute Portal — Dark Theme
   Comprehensive dashboard/portal styles
   ============================================ */


/* ===========================================
   1. ROOT VARIABLES
   =========================================== */
:root {
    /* --- Core palette (matches landing page) --- */
    --bg: #0a0e17;
    --surface: #111827;
    --border: #1e293b;
    --accent: #06b6d4;
    --accent-hover: #22d3ee;
    --accent-gradient: linear-gradient(135deg, #06b6d4, #0ea5e9);
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --radius: 12px;
    --transition: 0.3s ease;

    /* --- Portal-specific --- */
    --sidebar-width: 240px;
    --sidebar-bg: linear-gradient(180deg, #0d1220 0%, #111827 100%);
    --sidebar-border: #1a2336;
    --topbar-height: 64px;
    --input-bg: #0f1729;
    --input-border: #1e293b;
    --input-focus-border: var(--accent);
    --input-focus-glow: rgba(6, 182, 212, 0.15);
    --card-bg: #111827;
    --card-border: #1e293b;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);

    /* --- Status colors --- */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-border: rgba(16, 185, 129, 0.25);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-border: rgba(245, 158, 11, 0.25);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-border: rgba(239, 68, 68, 0.25);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    --info-border: rgba(59, 130, 246, 0.25);
}


/* ===========================================
   2. BASE RESET
   =========================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input,
select,
textarea {
    font-family: inherit;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}


/* ===========================================
   3. PORTAL LAYOUT
   =========================================== */
.portal-layout {
    display: flex;
    min-height: 100vh;
}

.portal-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-content {
    padding: 24px;
    padding-top: calc(var(--topbar-height) + 24px);
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}


/* ===========================================
   4. SIDEBAR
   =========================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition);
}

/* Scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* Logo header */
.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .logo-kaze {
    color: var(--accent);
}

.sidebar-logo .logo-pute {
    color: var(--text);
}

.sidebar-logo img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
}

.sidebar-nav-section {
    margin-bottom: 8px;
}

.sidebar-nav-label {
    display: block;
    padding: 8px 12px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    opacity: 0.6;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
    position: relative;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-link:hover {
    background: rgba(6, 182, 212, 0.06);
    color: var(--text);
}

.sidebar-link.active {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

/* Sidebar badge (e.g. Admin label) */
.sidebar-badge {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 10px;
    background: rgba(6, 182, 212, 0.12);
    color: var(--accent);
    line-height: 1.5;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 12px 10px 16px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-footer .sidebar-link {
    color: var(--text-secondary);
}

.sidebar-footer .sidebar-link:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* Close button (visible on mobile only) */
.sidebar-close {
    display: none;
    position: absolute;
    top: 16px;
    right: 12px;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1;
    z-index: 5;
}

.sidebar-close:hover {
    color: var(--text);
    border-color: var(--text-secondary);
}


/* ===========================================
   5. TOPBAR
   =========================================== */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 90;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}

.topbar-breadcrumb {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.topbar-breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--transition);
}

.topbar-breadcrumb a:hover {
    color: var(--accent);
}

.topbar-breadcrumb .separator {
    margin: 0 8px;
    opacity: 0.5;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

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

/* Hamburger toggle */
.hamburger,
.topbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text);
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.topbar-toggle {
    display: none;
}

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


/* ===========================================
   6. CARDS
   =========================================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: rgba(30, 41, 59, 0.8);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}


/* ===========================================
   7. STATS GRID
   =========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    border-color: rgba(6, 182, 212, 0.2);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.05);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
}

.stat-card-icon svg {
    width: 20px;
    height: 20px;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}


/* ===========================================
   8. TABLES
   =========================================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
}

.table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--surface);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: rgba(15, 23, 41, 0.6);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    color: var(--text);
    border-bottom: 1px solid rgba(30, 41, 59, 0.4);
    vertical-align: middle;
}

.data-table tbody tr {
    background: var(--card-bg);
    transition: background var(--transition);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 41, 0.3);
}

.data-table tbody tr:hover {
    background: rgba(6, 182, 212, 0.04);
}

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

/* Table cell helpers */
.table-cell-mono {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.85rem;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* ===========================================
   9. FORMS
   =========================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--input-focus-glow);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

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

.form-error {
    display: block;
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 4px;
}

.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
    border-color: var(--danger);
}

.form-input.is-error:focus,
.form-select.is-error:focus,
.form-textarea.is-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Checkbox / Radio row */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Inline form row */
.form-row {
    display: flex;
    gap: 16px;
}

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


/* ===========================================
   10. BUTTONS
   =========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), box-shadow var(--transition),
                transform var(--transition);
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Primary */
.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Secondary */
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(30, 41, 59, 0.6);
    border-color: var(--text-secondary);
}

/* Outline */
.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline:hover:not(:disabled) {
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.15);
}

/* Danger */
.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: transparent;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

/* Ghost (text-like) */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
    padding: 8px 12px;
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text);
    background: rgba(241, 245, 249, 0.05);
}

/* Sizes */
.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: 10px;
}

/* Icon-only button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

.btn-icon.btn-lg {
    width: 44px;
    height: 44px;
}

/* Button group */
.btn-group {
    display: inline-flex;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
    border-right-width: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-right-width: 1px;
}

.btn-group .btn:only-child {
    border-radius: var(--radius-sm);
    border-right-width: 1px;
}


/* ===========================================
   11. BADGES
   =========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    line-height: 1.5;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: var(--warning-border);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-border);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: var(--info-border);
}

.badge-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border-color: rgba(148, 163, 184, 0.2);
}

/* Badge with dot indicator */
.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}


/* ===========================================
   12. ALERTS / FLASH MESSAGES
   =========================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid transparent;
    margin-bottom: 16px;
    position: relative;
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    border-radius: 4px;
    transition: opacity var(--transition), background var(--transition);
    font-size: 1rem;
    line-height: 1;
    margin: -4px -4px -4px 0;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.alert-error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning);
}

.alert-info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info);
}


/* ===========================================
   13. AUTH PAGES
   =========================================== */
.auth-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 80px 24px 24px;
    background: var(--bg);
}

.auth-wrapper .alert {
    width: 100%;
    max-width: 440px;
    margin-bottom: 16px;
}

.plan-context {
    width: 100%;
    max-width: 440px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.plan-context-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 6px;
}

.plan-context-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.plan-context-details strong {
    color: var(--text);
    font-size: 1rem;
}

.plan-context-details span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.plan-context-price {
    font-weight: 600;
    color: var(--accent) !important;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text);
}

.auth-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.auth-card .form-input {
    padding: 12px 16px;
}

.auth-card .btn-primary {
    width: 100%;
    padding: 12px 24px;
    font-size: 0.95rem;
    margin-top: 8px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent);
    font-weight: 500;
    transition: color var(--transition);
}

.auth-footer a:hover {
    color: var(--accent-hover);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Forgot password / inline links in auth forms */
.auth-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.auth-link-row a {
    font-size: 0.8rem;
    color: var(--accent);
    transition: color var(--transition);
}

.auth-link-row a:hover {
    color: var(--accent-hover);
}


/* ===========================================
   14. SERVER CARDS
   =========================================== */
.server-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.server-card:hover {
    border-color: rgba(6, 182, 212, 0.2);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.05);
}

.server-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.server-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.server-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.server-status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.server-status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.server-status-dot.starting {
    background: var(--warning);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.server-hostname {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.server-ip {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.server-specs {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 14px 0;
    border-top: 1px solid rgba(30, 41, 59, 0.5);
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}

.server-spec {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.server-spec strong {
    display: block;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.server-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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


/* ===========================================
   15. TICKET THREAD
   =========================================== */
.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ticket-message {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
}

.ticket-message.admin {
    border-left: 3px solid var(--accent);
    background: rgba(6, 182, 212, 0.03);
}

.ticket-message.staff {
    border-left: 3px solid var(--accent);
    background: rgba(6, 182, 212, 0.03);
}

.ticket-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ticket-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ticket-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0;
}

.ticket-message.admin .ticket-author-avatar {
    background: var(--accent-gradient);
    color: #fff;
}

.ticket-author-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.ticket-author-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.ticket-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ticket-body {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.7;
}

.ticket-body p {
    margin-bottom: 8px;
}

.ticket-body p:last-child {
    margin-bottom: 0;
}

/* Ticket reply form */
.ticket-reply {
    margin-top: 24px;
}

.ticket-reply .form-textarea {
    min-height: 120px;
}


/* ===========================================
   16. CONSOLE
   =========================================== */
.console-container {
    width: 100%;
    height: calc(100vh - var(--topbar-height) - 48px);
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

.console-container iframe,
.console-container canvas {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.console-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(15, 23, 41, 0.9);
    border-bottom: 1px solid var(--border);
}

.console-toolbar-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.console-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.console-fullscreen {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    border-radius: 0;
    border: none;
}


/* ===========================================
   17. DEPLOY FORM
   =========================================== */
.plan-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.plan-option {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition),
                background var(--transition);
    text-align: center;
}

.plan-option:hover {
    border-color: rgba(6, 182, 212, 0.3);
}

.plan-option.selected {
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.1);
}

.plan-option input[type="radio"] {
    display: none;
}

.plan-option-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.plan-option-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
}

.plan-option-price span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.plan-option-specs {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* OS selector */
.os-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.os-option {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--radius);
    padding: 18px 14px;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition),
                background var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.os-option:hover {
    border-color: rgba(6, 182, 212, 0.3);
}

.os-option.selected {
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.1);
}

.os-option input[type="radio"] {
    display: none;
}

.os-option-icon,
.os-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.os-option-icon img,
.os-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.os-icon svg {
    width: 36px;
    height: 36px;
}

.os-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.os-option-content span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.os-option-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.os-option-version {
    font-size: 0.75rem;
    color: var(--text-secondary);
}


/* ===========================================
   18. BILLING
   =========================================== */

/* Invoice table overrides */
.invoice-table .data-table th:last-child,
.invoice-table .data-table td:last-child {
    text-align: right;
}

.invoice-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.invoice-amount {
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
}

/* Payment method cards */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.payment-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color var(--transition);
}

.payment-card:hover {
    border-color: rgba(30, 41, 59, 0.8);
}

.payment-card.active {
    border-color: var(--accent);
}

.payment-card-icon {
    width: 48px;
    height: 32px;
    background: rgba(241, 245, 249, 0.06);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.payment-card-icon svg,
.payment-card-icon img {
    width: 32px;
    height: auto;
}

.payment-card-details {
    flex: 1;
}

.payment-card-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.payment-card-number {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    margin-top: 2px;
}

.payment-card-actions {
    flex-shrink: 0;
}

/* Billing summary */
.billing-summary {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
}

.billing-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 0.9rem;
}

.billing-summary-row:not(:last-child) {
    border-bottom: 1px solid rgba(30, 41, 59, 0.4);
}

.billing-summary-row.total {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    padding-top: 14px;
    border-top: 2px solid var(--border);
}


/* ===========================================
   19-20. RESPONSIVE & SIDEBAR MOBILE
   =========================================== */

/* Sidebar overlay (dark backdrop on mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 95;
}

.sidebar-overlay.open {
    display: block;
}

/* Tablet breakpoint */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

/* Mobile breakpoint */
@media (max-width: 768px) {
    /* Sidebar collapses */
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar-close {
        display: flex;
    }

    /* Main area takes full width */
    .portal-main {
        margin-left: 0;
    }

    /* Topbar takes full width */
    .topbar {
        left: 0;
    }

    /* Show hamburger */
    .hamburger,
    .topbar-toggle {
        display: flex;
    }

    /* Content padding */
    .portal-content {
        padding: 16px;
        padding-top: calc(var(--topbar-height) + 16px);
    }

    /* Stats to single column */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Plan selector */
    .plan-selector {
        grid-template-columns: 1fr;
    }

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

    /* Server specs wrap */
    .server-specs {
        flex-direction: column;
        gap: 10px;
    }

    .server-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    /* Auth card */
    .auth-card {
        padding: 28px 20px;
    }

    /* Form row stack */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Table font size */
    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    /* Payment methods */
    .payment-methods {
        grid-template-columns: 1fr;
    }

    /* Console */
    .console-container {
        height: calc(100vh - var(--topbar-height) - 32px);
        border-radius: var(--radius-sm);
    }

    /* Ticket meta stacks */
    .ticket-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* Card padding reduced */
    .card-body {
        padding: 18px;
    }

    .card-header {
        padding: 14px 18px;
    }
}

@media (max-width: 480px) {
    .portal-content {
        padding: 12px;
        padding-top: calc(var(--topbar-height) + 12px);
    }

    .os-selector {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        border-radius: 0;
        border-right-width: 1px;
        border-bottom-width: 0;
    }

    .btn-group .btn:first-child {
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    }

    .btn-group .btn:last-child {
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
        border-bottom-width: 1px;
    }
}


/* ===========================================
   21. EMPTY STATES
   =========================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
    opacity: 0.6;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 360px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.empty-state .btn {
    margin-top: 4px;
}


/* ===========================================
   22. LOADING
   =========================================== */

/* CSS-only spinner */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(6, 182, 212, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 36px;
    height: 36px;
    border-width: 4px;
}

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

/* Loading overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 23, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 50;
    border-radius: inherit;
}

.loading-overlay-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Skeleton loading placeholder */
.skeleton {
    background: linear-gradient(90deg,
        rgba(30, 41, 59, 0.4) 0%,
        rgba(30, 41, 59, 0.8) 50%,
        rgba(30, 41, 59, 0.4) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
}

.skeleton-line:last-child {
    margin-bottom: 0;
    width: 65%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ===========================================
   23. UTILITY CLASSES
   =========================================== */

/* Text alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Text color */
.text-muted { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }

/* Font weight */
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* Margins — top */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* Margins — bottom */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

/* Flexbox */
.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

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

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

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.flex-1 {
    flex: 1;
}

/* Gaps */
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* Width */
.w-full { width: 100%; }

/* Truncate */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Visibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}


/* ===========================================
   24. PAGINATION
   =========================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition),
                border-color var(--transition);
}

.pagination-link:hover {
    color: var(--text);
    border-color: var(--text-secondary);
    background: rgba(241, 245, 249, 0.04);
}

.pagination-link.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pagination-link:disabled,
.pagination-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 10px;
}


/* ===========================================
   25. MODAL
   =========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition);
}

.modal-overlay.open .modal {
    transform: scale(1) translateY(0);
}

.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 680px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 1.15rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition);
}

.modal-close:hover {
    background: rgba(241, 245, 249, 0.05);
    color: var(--text);
    border-color: var(--border);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}


/* Particle canvas background for auth pages */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===========================================
   26. NAVBAR (Public / Auth Pages)
   Mirrors landing page navbar from style.css
   =========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition), padding var(--transition);
}

.navbar.scrolled {
    border-bottom-color: var(--border);
    padding: 12px 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-kaze,
.logo-pute {
    display: inline;
    margin: 0;
    padding: 0;
}

.logo-kaze {
    color: var(--accent);
}

.logo-pute {
    color: var(--text);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 0;
    margin: 0;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--text);
}

.nav-cta {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color var(--transition), color var(--transition) !important;
}

.nav-cta:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

/* --- Nav Dropdown (Public Pages) --- */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition);
    background: none;
    border: none;
    font-family: inherit;
    padding: 0;
}

.nav-dropdown-trigger:hover,
.nav-dropdown.open .nav-dropdown-trigger {
    color: var(--text);
}

.nav-dropdown-chevron {
    width: 14px;
    height: 14px;
    transition: transform var(--transition);
}

.nav-dropdown.open .nav-dropdown-chevron {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 320px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    z-index: 100;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 8px;
    transition: background var(--transition);
}

.nav-dropdown-item:hover {
    background: rgba(6, 182, 212, 0.06);
}

.nav-dropdown-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(6, 182, 212, 0.1);
    font-size: 1.2rem;
}

.nav-dropdown-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.nav-dropdown-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Nav auth buttons */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn-login {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: border-color var(--transition), color var(--transition);
}

.nav-btn-login:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.nav-links a.nav-btn-signup {
    padding: 8px 20px;
    background: var(--accent-gradient);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff !important;
    transition: box-shadow var(--transition), transform var(--transition);
}

.nav-links a.nav-btn-signup:hover {
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
    transform: translateY(-1px);
    color: #fff;
}

.nav-profile-link {
    display: flex;
    align-items: center;
}

.nav-profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff !important;
    font-size: 0.85rem;
    font-weight: 600;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.nav-profile-avatar:hover {
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav for public pages */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--surface);
        border-left: 1px solid var(--border);
        flex-direction: column;
        justify-content: center;
        gap: 24px;
        padding: 40px;
        transition: right var(--transition);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        font-size: 1.1rem;
    }

    /* Dropdown in mobile sidebar */
    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-trigger {
        font-size: 1.1rem;
    }

    .nav-dropdown-menu {
        position: static;
        transform: none;
        width: 100%;
        background: rgba(17, 24, 39, 0.6);
        border: none;
        border-radius: 8px;
        padding: 4px 0;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        margin-top: 8px;
        display: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
        transform: none;
    }

    .nav-dropdown-item {
        padding: 10px 14px;
    }

    .nav-dropdown-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    /* Auth buttons in mobile */
    .nav-auth {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .nav-btn-login,
    .nav-links a.nav-btn-signup {
        width: 100%;
        text-align: center;
        display: block;
    }
}


/* ===========================================
   27. POWER CONTROLS
   =========================================== */
.power-controls {
    display: inline-flex;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.power-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text-secondary);
    border: none;
    border-right: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.power-btn:last-child {
    border-right: none;
}

.power-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.power-btn:hover {
    background: rgba(241, 245, 249, 0.05);
    color: var(--text);
}

.power-btn.power-start:hover {
    background: var(--success-bg);
    color: var(--success);
}

.power-btn.power-stop:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.power-btn.power-reboot:hover {
    background: var(--warning-bg);
    color: var(--warning);
}

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

.power-btn:disabled:hover {
    background: var(--card-bg);
    color: var(--text-secondary);
}


/* ===========================================
   TRANSITIONS & ANIMATIONS
   =========================================== */

/* Fade in animation (reusable) */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide up entrance */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: slide-up 0.4s ease forwards;
}


/* ===========================================
   PRINT STYLES
   =========================================== */
@media print {
    .sidebar,
    .topbar,
    .hamburger,
    .sidebar-overlay,
    .power-controls,
    .btn-group,
    .modal-overlay {
        display: none !important;
    }

    .portal-main {
        margin-left: 0 !important;
    }

    .portal-content {
        padding-top: 0 !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .card,
    .stat-card,
    .server-card {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}


/* ===========================================
   ADDITIONAL PORTAL COMPONENTS
   =========================================== */

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

/* Detail grid */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.detail-value {
    font-size: 0.9rem;
    color: var(--text);
}

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

/* Server list compact (dashboard) */
.server-list-compact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.server-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.server-list-item:hover {
    background: rgba(241, 245, 249, 0.03);
}

.server-list-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.server-list-info div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.server-list-info strong {
    font-size: 0.9rem;
}

.server-list-info .text-muted {
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Ticket list item (dashboard) */
.ticket-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    gap: 12px;
}

.ticket-list-item:hover {
    background: rgba(241, 245, 249, 0.03);
}

.ticket-list-item div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ticket-list-item strong {
    font-size: 0.9rem;
}

.ticket-list-item .text-muted {
    font-size: 0.8rem;
}

/* Server grid */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* Server card body */
.server-card-body {
    padding: 16px 20px;
}

/* Server specs grid */
.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.3);
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    color: var(--text-secondary);
}

.spec-value {
    color: var(--text);
    font-weight: 500;
}

/* Button block */
.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Input group */
.input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

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

.input-group .btn {
    flex-shrink: 0;
}

/* Deploy form */
.deploy-form .card {
    margin-bottom: 20px;
}

.deploy-form .card:last-of-type {
    margin-bottom: 0;
}

.deploy-summary {
    text-align: center;
    padding: 24px 0;
}

.deploy-summary-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.deploy-summary-info svg {
    flex-shrink: 0;
    color: var(--accent);
}

/* Empty state small */
.empty-state-small {
    text-align: center;
    padding: 24px;
}

.empty-state svg {
    color: var(--text-secondary);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Stats grid variants */
.stats-grid-2 { grid-template-columns: repeat(2, 1fr); }
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
    .stats-grid-3 { grid-template-columns: 1fr; }
}

/* Node health */
.node-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.node-health-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.node-health-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.node-health-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.node-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

/* Node stats */
.node-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.node-stat-label {
    width: 40px;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0;
}

.node-stat-value {
    color: var(--text);
    font-size: 0.8rem;
    min-width: 50px;
    text-align: right;
    flex-shrink: 0;
}

/* Progress bar */
.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Clickable table row */
.clickable-row {
    cursor: pointer;
    transition: background var(--transition);
}

.clickable-row:hover {
    background: rgba(6, 182, 212, 0.03) !important;
}

/* Align center utility */
.align-center {
    align-items: center;
}

/* Auth subtitle */
.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 20px;
}

.auth-link {
    color: var(--accent);
    font-weight: 500;
    transition: color var(--transition);
}

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

.auth-form {
    margin-bottom: 0;
}

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

/* ===========================================
   APP MARKETPLACE — PORTAL STYLES
   =========================================== */

/* App badge on server cards */
.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.app-badge img {
    border-radius: 2px;
}

/* App info card on server detail */
.app-info-card {
    border-color: rgba(6, 182, 212, 0.2);
}

/* App deploy summary sidebar */
.app-deploy-summary {
    background: var(--card-bg);
}

.sticky-card {
    position: sticky;
    top: calc(var(--topbar-height) + 24px);
}

.deploy-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.deploy-summary-total {
    font-size: 1.1rem;
    color: var(--text);
}

.deploy-summary-total strong {
    color: var(--accent);
    font-size: 1.2rem;
}

/* Category badges */
.badge-category-ai {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.25);
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-category-web {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-category-devtools {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* OS family tabs */
.os-family-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.os-family-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

.os-family-tab:hover {
    color: var(--text);
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(6, 182, 212, 0.04);
}

.os-family-tab.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.1);
}

.os-family-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.os-family-tab-icon svg {
    width: 18px;
    height: 18px;
}

.os-family-group.hidden {
    display: none;
}

/* Custom ISO upload */
.custom-iso-upload {
    text-align: center;
    padding: 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: rgba(6, 182, 212, 0.02);
}

.custom-iso-info {
    margin-bottom: 24px;
}

.custom-iso-info svg {
    margin: 0 auto 12px;
    display: block;
}

.custom-iso-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.custom-iso-info p {
    font-size: 0.85rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

.custom-iso-upload .form-group {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

/* Checkbox label style */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* Sidebar badge */
.sidebar-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent);
    margin-left: 8px;
}

/* hCaptcha widget */
.h-captcha {
    display: flex;
    justify-content: center;
    margin: 16px 0 8px;
}
