/**
 * RevidAPI brand — static pages (login, dashboard, admin)
 * Đồng bộ màu xanh với WP homepage (revidapi-header-brand.css)
 */

:root {
    --revid-green: #15803d;
    --revid-green-deep: #166534;
    --revid-green-light: #16a34a;
    --revid-green-soft: #dcfce7;
    --revid-green-accent: #2f9e44;
    --revid-sidebar-bg: #f0f2f0;
    --revid-header-shadow: rgba(21, 128, 61, 0.28);
    --revid-card-border: #e5e7eb;
    --revid-bg-soft: #f0fdf4;
    --revid-sale: #ef4444;

    --primary: var(--revid-green-accent);
    --primary-dark: var(--revid-green-deep);
    --primary-light: var(--revid-green-soft);
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Trust bar */
.trust-bar {
    background: linear-gradient(90deg, #f0fdf4 0%, #ecfdf5 50%, #f0fdf4 100%);
    border-bottom: 1px solid var(--revid-card-border);
    font-size: 13px;
    color: #4b5563;
}

.trust-bar-item strong {
    color: var(--revid-green-deep);
}

.trust-bar a {
    color: var(--revid-green);
    font-weight: 600;
    text-decoration: none;
}

/* Header — gradient xanh giống trang chủ WP */
.header {
    background: linear-gradient(180deg, var(--revid-green-light) 0%, var(--revid-green) 45%, var(--revid-green-deep) 100%);
    box-shadow: 0 12px 30px var(--revid-header-shadow);
    border-bottom: none;
}

.header .nav-links a:not(.btn) {
    color: rgba(255, 255, 255, 0.95);
}

.header .nav-links a:not(.btn):hover,
.header .nav-links a:not(.btn).active {
    color: #fff;
}

.header .nav-links a.active::after {
    background: #fff;
}

.header .btn-outline {
    border: 2px solid rgba(255, 255, 255, 0.85);
    color: #fff;
    background: transparent;
}

.header .btn-outline:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.header .btn-primary {
    background: #fff;
    color: var(--revid-green-deep);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    margin-left: 10px;
    color: #fff;
}

.logo-text .brand-name {
    font-size: 1.05rem;
    font-weight: 800;
}

.logo-text .brand-tag {
    font-size: 0.68rem;
    opacity: 0.9;
}

.btn-primary {
    background: var(--revid-green);
    box-shadow: 0 4px 14px rgba(21, 128, 61, 0.28);
}

.btn-primary:hover {
    background: var(--revid-green-deep);
}

.btn-outline {
    border-color: var(--revid-green);
    color: var(--revid-green);
}

.hero {
    background: linear-gradient(180deg, var(--revid-bg-soft) 0%, #fff 60%, #ecfdf5 100%);
}

.hero h1 {
    color: var(--revid-green-deep);
    background: none;
    -webkit-text-fill-color: unset;
}

.pricing-price {
    color: var(--revid-sale);
    font-weight: 800;
}

.pricing-card.featured {
    border-color: var(--revid-green);
    background: linear-gradient(180deg, #f0fdf4, #fff);
}

.pricing-badge,
.billing-btn.active {
    background: var(--revid-green);
}

.cta {
    background: linear-gradient(135deg, var(--revid-green-light), var(--revid-green-deep));
}

/* Sidebar dashboard — đồng bộ revidapi-platform (#f0f2f0 + accent #2f9e44) */
.dashboard {
    background: #f9fafb;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 40;
}

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

.sidebar {
    width: 240px;
    background: var(--revid-sidebar-bg);
    color: #374151;
    padding: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(47, 158, 68, 0.1);
    box-shadow: none;
    z-index: 50;
}

.sidebar-brand {
    padding: 1rem;
    background: #fff;
    border-bottom: 1px solid rgba(47, 158, 68, 0.1);
}

.sidebar-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    text-decoration: none;
}

.sidebar-logo-img {
    height: 44px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.sidebar-nav-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav-secondary,
.sidebar-ecosystem {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(47, 158, 68, 0.15);
}

.sidebar-ecosystem-label {
    margin: 0 0 0.5rem;
    padding: 0 0.75rem;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9ca3af;
}

.sidebar#dashboardSidebar .sidebar-nav a.sidebar-nav-btn,
.sidebar#dashboardSidebar .sidebar-nav a.sidebar-nav-btn span,
.sidebar#dashboardSidebar .sidebar-logout {
    color: #4b5563;
}

.sidebar-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    box-sizing: border-box;
}

.sidebar-nav-btn > i:first-child {
    font-size: 1.125rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.sidebar-nav-btn span {
    flex: 1;
    text-align: left;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.85);
    color: #111827;
}

.sidebar-nav-btn.active {
    background: #fff;
    color: #111827;
    border-color: rgba(47, 158, 68, 0.25);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sidebar-nav-btn.active > i:first-child {
    color: var(--revid-green-accent);
}

.sidebar-nav-current {
    background: rgba(47, 158, 68, 0.08);
    color: var(--revid-green-deep);
    font-weight: 600;
}

.sidebar-nav-current > i:first-child {
    color: var(--revid-green-accent);
}

.sidebar-nav-soon {
    opacity: 0.75;
    cursor: default;
}

.sidebar-ext {
    font-size: 0.75rem !important;
    color: #d1d5db !important;
    flex-shrink: 0;
}

.sidebar-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 999px;
    flex-shrink: 0;
}

.sidebar-badge-free {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.sidebar-badge-soon {
    color: #9ca3af;
    background: transparent;
    border: none;
    padding: 0;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(47, 158, 68, 0.15);
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.85);
}

.dashboard-mobile-bar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin: -2rem -2rem 1.5rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--revid-card-border);
}

.dashboard-mobile-title {
    font-weight: 700;
    color: #111827;
    font-size: 0.95rem;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(47, 158, 68, 0.2);
    border-radius: 8px;
    background: #fff;
    color: var(--revid-green-accent);
    font-size: 1.25rem;
    cursor: pointer;
}

@media (max-width: 1023px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .dashboard-mobile-bar {
        display: flex;
    }
}

.stat-card .value {
    color: var(--revid-green-accent);
}

.card {
    border: 1px solid var(--revid-card-border);
}

.table th {
    background: #f0fdf4;
    color: var(--revid-green-deep);
}

.page-header .btn-primary {
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
}

.nav-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .header .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    .header .nav-links.open { display: flex; }
}

/* Dashboard top header — revidapi-platform */
.main-content {
    display: flex;
    flex-direction: column;
}

.dashboard-top-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    margin: -2rem -2rem 1.5rem;
    padding: 0.875rem 1.5rem;
}

.dashboard-top-header-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-top-menu {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    color: #4b5563;
    font-size: 1.35rem;
    cursor: pointer;
}

.dashboard-top-title {
    font-weight: 700;
    color: #111827;
    font-size: 0.95rem;
    display: none;
}

.dashboard-top-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.dash-lang { position: relative; }

.dash-lang-btn,
.dash-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #374151;
    font-size: 0.875rem;
}

.dash-lang-btn:hover,
.dash-user-btn:hover {
    background: #f3f4f6;
}

.dash-lang-menu,
.dash-user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 180px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 0.35rem;
    z-index: 50;
}

.dash-lang-menu button,
.dash-user-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: none;
    background: none;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
}

.dash-lang-menu button:hover,
.dash-user-menu a:hover {
    background: #f9fafb;
}

.dash-user-menu a:last-child {
    color: #dc2626;
}

.dash-notify {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 1.35rem;
    color: #6b7280;
    cursor: pointer;
}

.dash-notify:hover { background: #f3f4f6; }

.dash-notify-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

.dash-user { position: relative; }

.dash-user-btn {
    padding-left: 0.75rem;
    border-left: 1px solid #e5e7eb;
}

.dash-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--revid-green-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.dash-user-meta {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
    max-width: 160px;
}

.dash-user-meta strong {
    font-size: 0.875rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-user-meta small {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-user-chevron { color: #9ca3af; }

.dash-login-btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
}

@media (max-width: 1023px) {
    .dashboard-top-menu { display: inline-flex; }
    .dashboard-top-title { display: inline; }
    .dash-user-meta { display: none; }
}

@media (max-width: 640px) {
    .dashboard-top-header {
        margin: -1rem -1rem 1rem;
        padding: 0.75rem 1rem;
    }
    .dash-lang-label { display: none; }
}
