/* Netshell Social Manager - Admin Styles */

:root {
    --ns-primary: #1e3a5f;
    --ns-primary-light: #2c5282;
    --ns-accent: #3182ce;
    --ns-bg: #f0f4f8;
    --ns-card-bg: #ffffff;
    --ns-sidebar-bg: #1a2332;
    --ns-sidebar-text: #cbd5e0;
    --ns-sidebar-active: #3182ce;
    --ns-text: #2d3748;
    --ns-text-muted: #718096;
    --ns-border: #e2e8f0;
    --ns-success: #38a169;
    --ns-danger: #e53e3e;
    --ns-warning: #d69e2e;
    --ns-info: #3182ce;
}

/* ========== Global ========== */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--ns-bg);
    color: var(--ns-text);
}

/* ========== Landing Page ========== */
.ns-landing-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a2332 0%, #1e3a5f 50%, #2c5282 100%);
}

.ns-landing-container {
    width: 100%;
    max-width: 760px;
    padding: 2rem;
}

.ns-landing-brand {
    text-align: center;
    margin-bottom: 2.5rem;
    color: #fff;
}

.ns-landing-brand h1 {
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.ns-landing-brand p {
    opacity: 0.7;
    font-size: 1rem;
    margin: 0;
}

.ns-portal-card {
    background: var(--ns-card-bg);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.ns-portal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.ns-portal-card h5 {
    font-weight: 600;
    color: var(--ns-text);
    margin-bottom: 0.5rem;
}

.ns-portal-card p {
    color: var(--ns-text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.ns-portal-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.ns-portal-icon.ns-portal-platform {
    background: rgba(30, 58, 95, 0.1);
    color: var(--ns-primary);
}

.ns-portal-icon.ns-portal-tenant {
    background: rgba(49, 130, 206, 0.1);
    color: var(--ns-accent);
}

/* ========== Login Page ========== */
.ns-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 50%, #3182ce 100%);
}

.ns-login-wrapper.ns-login-tenant {
    background: linear-gradient(135deg, #1a2332 0%, #2c5282 50%, #4299e1 100%);
}

.ns-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--ns-card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 2.5rem;
}

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

.ns-login-card .ns-brand h2 {
    font-weight: 700;
    color: var(--ns-primary);
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
}

.ns-login-card .ns-brand p {
    color: var(--ns-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.ns-login-card .form-control {
    border-radius: 8px;
    padding: 0.65rem 1rem;
    border: 1.5px solid var(--ns-border);
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ns-login-card .form-control:focus {
    border-color: var(--ns-accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.ns-login-card .form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--ns-text);
    margin-bottom: 0.375rem;
}

.ns-login-card .btn-primary {
    background-color: var(--ns-primary);
    border-color: var(--ns-primary);
    border-radius: 8px;
    padding: 0.65rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: background-color 0.2s, transform 0.1s;
}

.ns-login-card .btn-primary:hover {
    background-color: var(--ns-primary-light);
    border-color: var(--ns-primary-light);
    transform: translateY(-1px);
}

.ns-login-card .btn-primary:active {
    transform: translateY(0);
}

.ns-login-card .btn-primary:disabled {
    opacity: 0.7;
    transform: none;
}

/* ========== Admin Layout ========== */
.ns-admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.ns-sidebar {
    width: 260px;
    background: var(--ns-sidebar-bg);
    color: var(--ns-sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform 0.3s;
}

.ns-sidebar-tenant {
    background: #172033;
}

.ns-sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ns-sidebar-brand h5 {
    font-weight: 700;
    color: #fff;
    margin: 0;
    font-size: 1.1rem;
}

.ns-sidebar-brand small {
    color: var(--ns-sidebar-text);
    font-size: 0.75rem;
    opacity: 0.7;
}

.ns-sidebar-nav {
    padding: 1rem 0;
    flex-grow: 1;
}

.ns-sidebar-nav .nav-link {
    color: var(--ns-sidebar-text);
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border-radius: 0;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.ns-sidebar-nav .nav-link:hover,
.ns-sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.ns-sidebar-nav .nav-link.active {
    border-left: 3px solid var(--ns-sidebar-active);
    padding-left: calc(1.25rem - 3px);
}

.ns-sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ========== Main Content ========== */
.ns-main {
    margin-left: 260px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ns-topbar {
    background: var(--ns-card-bg);
    border-bottom: 1px solid var(--ns-border);
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.ns-topbar h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ns-text);
}

.ns-content {
    padding: 1.5rem;
    flex-grow: 1;
}

/* ========== Dashboard Cards ========== */
.ns-stat-card {
    background: var(--ns-card-bg);
    border: 1px solid var(--ns-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.ns-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ns-stat-card .ns-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.ns-stat-card .ns-stat-icon.bg-primary-soft {
    background: rgba(49, 130, 206, 0.1);
    color: var(--ns-accent);
}

.ns-stat-card .ns-stat-icon.bg-success-soft {
    background: rgba(56, 161, 105, 0.1);
    color: var(--ns-success);
}

.ns-stat-card .ns-stat-icon.bg-warning-soft {
    background: rgba(214, 158, 46, 0.1);
    color: var(--ns-warning);
}

.ns-stat-card .ns-stat-icon.bg-info-soft {
    background: rgba(49, 130, 206, 0.1);
    color: var(--ns-info);
}

.ns-stat-card .ns-stat-icon.bg-danger-soft {
    background: rgba(229, 62, 62, 0.1);
    color: var(--ns-danger);
}

.ns-stat-card .ns-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ns-text);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.ns-stat-card .ns-stat-label {
    font-size: 0.8125rem;
    color: var(--ns-text-muted);
    font-weight: 500;
}

/* ========== Info Cards (Tenant Dashboard) ========== */
.ns-info-card {
    background: var(--ns-card-bg);
    border: 1px solid var(--ns-border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ns-info-card .ns-info-label {
    font-size: 0.75rem;
    color: var(--ns-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.ns-info-card .ns-info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ns-text);
}

/* ========== Welcome Banner ========== */
.ns-welcome-banner {
    background: linear-gradient(135deg, var(--ns-primary) 0%, var(--ns-primary-light) 100%);
    border-radius: 12px;
    padding: 1.75rem 2rem;
    color: #fff;
    margin-bottom: 1.5rem;
}

.ns-welcome-banner.ns-welcome-tenant {
    background: linear-gradient(135deg, #172033 0%, #2c5282 100%);
}

.ns-welcome-banner h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ns-welcome-banner p {
    margin: 0;
    opacity: 0.85;
    font-size: 0.9rem;
}

/* ========== Table ========== */
.ns-table-card {
    background: var(--ns-card-bg);
    border: 1px solid var(--ns-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.ns-table-card .table {
    margin: 0;
    font-size: 0.875rem;
}

.ns-table-card .table thead th {
    background: #f7fafc;
    border-bottom: 2px solid var(--ns-border);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ns-text-muted);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.ns-table-card .table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

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

.ns-table-card .table tbody tr:hover {
    background: #f7fafc;
}

/* ========== Search Input ========== */
.ns-search-input {
    border-radius: 10px;
    padding: 0.6rem 1rem;
    border: 1.5px solid var(--ns-border);
    font-size: 0.875rem;
    max-width: 400px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ns-search-input:focus {
    border-color: var(--ns-accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

/* ========== Badges ========== */
.ns-badge-active {
    background: rgba(56, 161, 105, 0.1);
    color: var(--ns-success);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.3em 0.7em;
    border-radius: 6px;
}

.ns-badge-inactive {
    background: rgba(229, 62, 62, 0.1);
    color: var(--ns-danger);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.3em 0.7em;
    border-radius: 6px;
}

.ns-badge-completed {
    background: rgba(49, 130, 206, 0.1);
    color: var(--ns-accent);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.3em 0.7em;
    border-radius: 6px;
}

.ns-badge-pending {
    background: rgba(214, 158, 46, 0.1);
    color: var(--ns-warning);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.3em 0.7em;
    border-radius: 6px;
}

/* ========== Modal ========== */
.modal-content {
    border-radius: 14px;
}

.modal-header {
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
}

.modal-body .form-control,
.modal-body .form-select {
    border-radius: 8px;
    padding: 0.55rem 0.875rem;
    border: 1.5px solid var(--ns-border);
    font-size: 0.875rem;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: var(--ns-accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.modal-body .form-label {
    font-size: 0.8125rem;
    margin-bottom: 0.3rem;
}

/* ========== Buttons ========== */
.btn-logout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--ns-sidebar-text);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    background: rgba(229, 62, 62, 0.15);
    color: #fc8181;
    border-color: rgba(229, 62, 62, 0.3);
}

.btn-primary {
    background-color: var(--ns-primary);
    border-color: var(--ns-primary);
}

.btn-primary:hover {
    background-color: var(--ns-primary-light);
    border-color: var(--ns-primary-light);
}

/* ========== Spinner ========== */
.ns-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ns-spin 0.75s linear infinite;
}

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

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

    .ns-sidebar.show {
        transform: translateX(0);
    }

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

    .ns-topbar .ns-menu-toggle {
        display: block !important;
    }
}

@media (min-width: 992px) {
    .ns-topbar .ns-menu-toggle {
        display: none !important;
    }
}

/* ========== Post Type Badges ========== */
.bg-purple {
    background-color: #6f42c1 !important;
}
