﻿/* =========================================================
   Syd Studio Admin — admin.site.css (FINAL CLEAN)
   - Auth pages + Admin shell (sidebar/header/content)
   - Avatar pill + dropdown polish
   - Identity (Manage Account) styling that applies on desktop too
   - Mini sidebar (desktop) + Drawer sidebar (mobile)
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
    --admin-bg: #eef1f4;
    --admin-text: #1f2937;
    --admin-sidebar-bg: #24313a;
    --admin-sidebar-text: rgba(255,255,255,.85);
    --admin-sidebar-muted: rgba(255,255,255,.55);
    --admin-link: rgba(255,255,255,.80);
    --admin-link-hover: rgba(255,255,255,.92);
    --admin-link-hover-bg: rgba(255,255,255,.06);
    --admin-active-bg: rgba(59,130,246,.18);
    --admin-radius-lg: 22px;
    --admin-radius-md: 14px;
    --admin-radius-sm: 10px;
    --admin-shadow-sm: 0 4px 10px rgba(0,0,0,.04);
    --admin-shadow-md: 0 6px 18px rgba(0,0,0,.06);
    --admin-shadow-lg: 0 10px 26px rgba(0,0,0,.12);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

:where(a, button, input, select, textarea, [role="button"]):focus-visible {
    outline: 2px solid rgba(59,130,246,.55);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

/* =========================================================
   Auth pages
   ========================================================= */
body.auth-page {
    min-height: 100vh;
    background: linear-gradient(rgba(0,0,0,.62), rgba(0,0,0,.62)), url("/img/auth-bg.jpg") center / cover no-repeat;
}

@media (min-width: 992px) {
    body.auth-page {
        background-attachment: fixed;
    }
}

.auth-shell,
.auth-wrap {
    min-height: 100vh;
}

.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 14px;
}

.auth-card {
    width: 100%;
    max-width: 560px;
    border-radius: var(--admin-radius-lg);
    overflow: hidden;
}

    .auth-card .card-body {
        background: rgba(255,255,255,.97);
    }

.auth-title {
    font-weight: 700;
    letter-spacing: .2px;
}

.auth-validation:empty,
.validation-summary-valid {
    display: none !important;
}

.auth-card .form-control-lg {
    border-radius: 12px;
    padding-top: .75rem;
    padding-bottom: .75rem;
}

.auth-card .btn-lg {
    border-radius: 12px;
    padding-top: .85rem;
    padding-bottom: .85rem;
}

.brand-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 18px;
    background: var(--bs-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

.brand-mark__img {
    width: 52px;
    height: 52px;
    display: block;
}

/* =========================================================
   Admin shell
   ========================================================= */
body.admin-page {
    margin: 0;
    min-height: 100vh;
    background: var(--admin-bg);
    color: var(--admin-text);
}

.admin-app {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
    transition: grid-template-columns .2s ease;
}

/* Sidebar */
.admin-sidebar {
    background: var(--admin-sidebar-bg);
    color: var(--admin-sidebar-text);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    padding: 14px 12px;
    transition: width .2s ease, transform .2s ease;
}

.admin-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 14px;
}

.admin-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .admin-avatar img {
        width: 26px;
        height: 26px;
        display: block;
    }

.admin-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.admin-brand-name {
    font-weight: 700;
    letter-spacing: .2px;
    color: rgba(255,255,255,.95);
}

.admin-brand-sub {
    font-size: 12px;
    color: var(--admin-sidebar-muted);
}

.admin-sidebar__section {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.45);
    padding: 12px 10px 6px;
}

/* Nav */
.admin-nav {
    display: grid;
    gap: 4px;
}

.admin-nav__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--admin-radius-sm);
    text-decoration: none;
    color: var(--admin-link);
    position: relative;
}

    .admin-nav__link:hover {
        background: var(--admin-link-hover-bg);
        color: var(--admin-link-hover);
    }

    .admin-nav__link.active {
        background: var(--admin-active-bg);
        color: #fff;
        font-weight: 600;
    }

.admin-nav__icon {
    width: 18px;
    display: inline-flex;
    justify-content: center;
}

.admin-nav__caret {
    transition: transform .15s ease;
}

.admin-nav__link[aria-expanded="true"] .admin-nav__caret {
    transform: rotate(180deg);
}

.admin-subnav {
    margin: 4px 0 8px 28px;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,.10);
    display: grid;
    gap: 4px;
}

    .admin-subnav .admin-nav__link {
        padding: 8px 10px;
        border-radius: var(--admin-radius-sm);
        color: rgba(255,255,255,.72);
    }

        .admin-subnav .admin-nav__link:hover {
            background: var(--admin-link-hover-bg);
            color: var(--admin-link-hover);
        }

/* Main + header */
.admin-main {
    min-width: 0;
    display: grid;
    grid-template-rows: 56px 1fr;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    box-shadow: var(--admin-shadow-sm);
}

.admin-header__left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.admin-header__title {
    min-width: 0;
}

    .admin-header__title .h5 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.admin-burger {
    border: 0;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    padding: 6px 8px;
    border-radius: var(--admin-radius-sm);
    cursor: pointer;
}

    .admin-burger:hover {
        background: rgba(0,0,0,.05);
    }

.admin-header__subtitle {
    font-size: 12px;
    color: rgba(0,0,0,.55);
    margin-top: 2px;
}

.admin-header__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Pills (header icons + avatar) */
.admin-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.08);
    background: #f8fafc;
    text-decoration: none;
    color: rgba(0,0,0,.75);
    cursor: pointer;
    padding: 0; /* important for avatar */
    overflow: hidden; /* important for avatar */
}

    .admin-pill:hover {
        background: rgba(0,0,0,.03);
    }

    /* Hide Bootstrap caret on the avatar pill (keeps it clean) */
    .admin-pill.dropdown-toggle::after {
        display: none;
    }

    /* Avatar inside pill */
    .admin-pill img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        border-radius: 999px;
    }

/* Content */
.admin-content {
    padding: 24px;
    position: relative; /* required for ::before overlay */
}

/* Dropdown polish */
.dropdown-menu {
    border: 0;
    border-radius: var(--admin-radius-md);
    box-shadow: var(--admin-shadow-lg);
    padding: 8px;
}

.dropdown-item {
    border-radius: var(--admin-radius-sm);
    padding: 8px 10px;
}

    .dropdown-item:active {
        background: var(--admin-active-bg);
        color: #111827;
    }

/* =========================================================
   Identity pages inside Admin (Manage Account)
   IMPORTANT: applies at ALL widths (not just mobile)
   ========================================================= */

/* So the background photo doesn’t compete with the form */
.admin-content {
    backdrop-filter: blur(2px);
}

    .admin-content::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(255,255,255,.04);
        pointer-events: none;
    }

/* Left nav in Manage pages (your class OR fallback to Identity defaults) */
.manage-nav,
.nav-pills.flex-column {
    background: #2b3640;
    border-radius: 12px;
    padding: 8px;
}

    .manage-nav .nav-link,
    .nav-pills.flex-column .nav-link {
        color: rgba(255,255,255,.75);
        border-radius: 8px;
        padding: 8px 12px;
    }

        .manage-nav .nav-link:hover,
        .nav-pills.flex-column .nav-link:hover {
            background: rgba(255,255,255,.08);
            color: #fff;
        }

        .manage-nav .nav-link.active,
        .nav-pills.flex-column .nav-link.active {
            background: rgba(59,130,246,.25);
            color: #fff;
        }

/* Main panel (forms) */
.identity-form,
.manage-content,
#profile-form,
form[action*="Manage"] {
    background: rgba(255,255,255,.92);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(0,0,0,.12);
}

    /* Buttons */
    .manage-content .btn-primary,
    form[action*="Manage"] .btn-primary {
        background: #2563eb;
        border-color: #2563eb;
        border-radius: 12px;
    }

        .manage-content .btn-primary:hover,
        form[action*="Manage"] .btn-primary:hover {
            background: #1d4ed8;
            border-color: #1d4ed8;
        }

    /* Inputs feel consistent */
    .manage-content .form-control,
    form[action*="Manage"] .form-control {
        border-radius: 12px;
    }

/* =========================================================
   Sidebar mini mode (desktop)
   ========================================================= */
body.admin-sidebar-mini .admin-app {
    grid-template-columns: 74px 1fr;
}

body.admin-sidebar-mini .admin-sidebar {
    padding-left: 10px;
    padding-right: 10px;
}

body.admin-sidebar-mini .admin-sidebar__brand {
    justify-content: center;
}

body.admin-sidebar-mini .admin-brand-text,
body.admin-sidebar-mini .admin-sidebar__section {
    display: none !important;
}

body.admin-sidebar-mini .admin-nav__link {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
    text-align: center;
    font-size: 0;
}

body.admin-sidebar-mini .admin-nav__icon {
    font-size: 18px;
    width: auto;
}

body.admin-sidebar-mini .admin-nav__caret,
body.admin-sidebar-mini .admin-subnav {
    display: none !important;
}

/* =========================================================
   Admin Dashboard polish
   ========================================================= */

.admin-content {
    /* gives the page a soft gallery wash */
    background: radial-gradient(1200px 500px at 20% 0%, rgba(255, 255, 255, .75), transparent 60%);
}

/* The dashboard grid spacing feels nicer a tad tighter */
.admin-dashboard .row.g-4 {
    --bs-gutter-x: 1.25rem;
    --bs-gutter-y: 1.25rem;
}

/* Card base */
.dash-card {
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,.06);
    background: rgba(255,255,255,.82);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    backdrop-filter: blur(3px);
}

    .dash-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 34px rgba(15, 23, 42, .10);
        background: rgba(255,255,255,.90);
    }

    .dash-card:active {
        transform: translateY(-1px);
    }

/* KPI */
.dash-kpi {
    font-size: 2.15rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 750;
    color: #111827;
}

.dash-label {
    color: rgba(0,0,0,.55);
    font-size: .9rem;
}

.dash-muted {
    color: rgba(0,0,0,.55);
}

/* Pills */
.dash-pill {
    border-radius: 999px;
    padding: .18rem .6rem;
    font-size: .8rem;
    border: 1px solid rgba(0,0,0,.10);
    background: rgba(255,255,255,.75);
}

/* Make all KPI cards feel uniform height */
.dash-card--kpi {
    min-height: 108px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Featured frame */
.featured-frame {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(255,255,255,.75);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
}

.featured-img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.featured-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

/* Webmail card “hero” icon */
.webmail-hero {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59,130,246,.10);
    border: 1px solid rgba(59,130,246,.18);
    font-size: 20px;
}

/* Recent activity */
.dash-activity .list-group-item {
    border: 0;
    border-top: 1px solid rgba(0,0,0,.06);
    padding: 12px 8px;
}

    .dash-activity .list-group-item:first-child {
        border-top: 0;
    }

@media (max-width: 991.98px) {
    .featured-img {
        height: 220px;
    }

    .dash-card--kpi {
        min-height: 98px;
    }
}

/* =========================================================
   Mobile drawer
   ========================================================= */
@media (max-width: 991.98px) {
    .admin-app {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        transform: translateX(-100%);
        z-index: 1040;
        background: var(--admin-sidebar-bg);
    }

    body.admin-sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    body.admin-sidebar-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.25);
        z-index: 1030;
    }

    .admin-content {
        padding: 16px;
    }
}
