/* CarRental.CMS/wwwroot/css/cms.css */
:root {
    --sb-w: 256px;
    --sb-bg: #0d1117;
    --sb-hover: #161b22;
    --sb-active: #1f6feb;
    --top-h: 60px;
    --accent: #1f6feb;
    --accent2: #388bfd;
    --success: #2ea043;
    --danger: #da3633;
    --warning: #e3b341;
    --body-bg: #f0f2f5;
    --card-bg: #ffffff;
    --border: #d0d7de;
    --text: #1f2328;
    --muted: #656d76;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
    --radius: 12px;
}

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

body.cms-body {
    font-family: 'Inter',sans-serif;
    background: var(--body-bg);
    color: var(--text)
}

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

/* ── SIDEBAR ── */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sb-w);
    background: var(--sb-bg);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform .25s;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent
}

.sb-header {
    padding: 20px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,.06)
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800
}

    .sb-brand i {
        color: var(--accent2);
        font-size: 1.3rem
    }

.sb-role {
    font-size: .65rem;
    color: #7d8590;
    text-transform: uppercase;
    letter-spacing: .1em;
    display: block;
    margin-top: 3px
}

.sb-user {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.06)
}

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

.sb-username {
    color: #e6edf3;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.3
}

.sb-rolename {
    font-size: .68rem;
    color: #7d8590
}

.sb-nav {
    list-style: none;
    padding: 8px 0;
    flex: 1
}

.sb-section {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #7d8590;
    padding: 14px 16px 4px
}

.sb-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: #8b949e;
    font-size: .84rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s;
    cursor: pointer
}

    .sb-link:hover {
        background: var(--sb-hover);
        color: #e6edf3
    }

    .sb-link.active {
        background: rgba(31,111,235,.12);
        color: var(--accent2);
        border-left-color: var(--accent2)
    }

    .sb-link i {
        font-size: .95rem;
        flex-shrink: 0
    }

.sb-footer {
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,.06)
}

.sb-portal-link {
    color: #58a6ff !important
}

.sb-logout {
    color: #f85149 !important
}

.sb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 199
}

    .sb-overlay.show {
        display: block
    }

/* ── MAIN ── */
.cms-main {
    margin-left: var(--sb-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin .25s
}

.cms-topbar {
    height: var(--top-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow)
}

.sb-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--muted);
    padding: 6px;
    border-radius: 8px;
    display: none
}

.topbar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    flex: 1
}

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

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px
}

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

.ta-name {
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.3
}

.ta-role {
    font-size: .68rem;
    color: var(--muted)
}

.cms-content {
    padding: 24px;
    flex: 1
}

/* ── TOAST BARS ── */
.toast-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: 20px;
    animation: slideDown .3s ease
}

.toast-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0
}

.toast-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* ── PAGE HEADER ── */
.pg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px
}

.pg-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text)
}

.pg-subtitle {
    font-size: .82rem;
    color: var(--muted);
    margin-top: 2px
}

/* ── CARDS ── */
.card2 {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow)
}

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

.card2-title {
    font-size: .9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px
}

.card2-body {
    padding: 20px
}

/* ── STAT CARDS ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(160px,1fr));
    gap: 16px;
    margin-bottom: 28px
}

.stat-card {
    border-radius: var(--radius);
    padding: 20px;
    color: #fff;
    position: relative;
    overflow: hidden
}

    .stat-card .sval {
        font-size: 1.8rem;
        font-weight: 900;
        line-height: 1
    }

    .stat-card .slbl {
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .08em;
        opacity: .85;
        margin-top: 4px
    }

    .stat-card .sico {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 2.2rem;
        opacity: .2
    }

.sc-blue {
    background: linear-gradient(135deg,#1f6feb,#0d4a9e)
}

.sc-green {
    background: linear-gradient(135deg,#2ea043,#1a6626)
}

.sc-amber {
    background: linear-gradient(135deg,#e3b341,#b08800)
}

.sc-red {
    background: linear-gradient(135deg,#da3633,#9b1c1c)
}

.sc-purple {
    background: linear-gradient(135deg,#8957e5,#5a2d8e)
}

.sc-teal {
    background: linear-gradient(135deg,#39d353,#1a7f37)
}

.sc-indigo {
    background: linear-gradient(135deg,#6366f1,#3730a3)
}

.sc-rose {
    background: linear-gradient(135deg,#fb7185,#be123c)
}

/* ── TABLES ── */
.tbl {
    width: 100%;
    border-collapse: collapse
}

    .tbl thead th {
        font-size: .72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .07em;
        color: var(--muted);
        border-bottom: 2px solid var(--border);
        padding: 10px 14px;
        white-space: nowrap
    }

    .tbl tbody td {
        padding: 13px 14px;
        border-bottom: 1px solid var(--border);
        font-size: .875rem;
        vertical-align: middle
    }

    .tbl tbody tr:hover {
        background: #f6f8fa
    }

    .tbl tbody tr:last-child td {
        border-bottom: none
    }

/* ── BADGES ── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700
}

.tag-green {
    background: #d1fae5;
    color: #065f46
}

.tag-amber {
    background: #fef3c7;
    color: #92400e
}

.tag-red {
    background: #fee2e2;
    color: #991b1b
}

.tag-blue {
    background: #dbeafe;
    color: #1e40af
}

.tag-gray {
    background: #f3f4f6;
    color: #374151
}

.tag-purple {
    background: #ede9fe;
    color: #5b21b6
}

/* ── FORMS ── */
.flabel {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    display: block;
    margin-bottom: 5px
}

.finput {
    border: 1.5px solid var(--border);
    border-radius: 9px;
    padding: 9px 13px;
    font-size: .875rem;
    width: 100%;
    transition: border-color .15s;
    background: #fff;
    color: var(--text)
}

    .finput:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(31,111,235,.12);
        outline: none
    }

.finput-group {
    display: flex
}

    .finput-group .prefix {
        background: #f6f8fa;
        border: 1.5px solid var(--border);
        border-right: none;
        padding: 9px 12px;
        border-radius: 9px 0 0 9px;
        font-size: .875rem;
        color: var(--muted)
    }

    .finput-group .finput {
        border-radius: 0 9px 9px 0
    }

/* ── BUTTONS ── */
.btn2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 9px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .15s
}

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

    .btn2-primary:hover {
        background: #1358c8;
        color: #fff
    }

.btn2-success {
    background: var(--success);
    color: #fff
}

    .btn2-success:hover {
        background: #238636;
        color: #fff
    }

.btn2-danger {
    background: var(--danger);
    color: #fff
}

    .btn2-danger:hover {
        background: #b91c1c;
        color: #fff
    }

.btn2-ghost {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border)
}

    .btn2-ghost:hover {
        background: #f6f8fa
    }

.btn2-sm {
    padding: 5px 11px;
    font-size: .8rem
}

.btn2-xs {
    padding: 3px 8px;
    font-size: .75rem
}

/* ── IMAGE UPLOAD ── */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: #fafafa
}

    .drop-zone:hover {
        border-color: var(--accent);
        background: #f0f7ff
    }

    .drop-zone i {
        font-size: 2.2rem;
        color: var(--muted);
        display: block;
        margin-bottom: 8px
    }

.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(120px,1fr));
    gap: 10px
}

.img-item {
    position: relative;
    border-radius: 9px;
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 2px solid var(--border)
}

    .img-item img {
        width: 100%;
        height: 100%;
        object-fit: cover
    }

    .img-item.main-img {
        border-color: var(--accent)
    }

.img-actions {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s
}

.img-item:hover .img-actions {
    opacity: 1
}

.img-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--accent);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px
}

/* ── FEATURE TAGS ── */
.feat-box {
    border: 1.5px solid var(--border);
    border-radius: 9px;
    padding: 8px;
    min-height: 44px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    cursor: text
}

.feat-tag {
    background: var(--accent);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px
}

.feat-input {
    border: none;
    outline: none;
    font-size: .875rem;
    min-width: 130px;
    flex: 1;
    background: transparent
}

/* ── PERMISSION MATRIX ── */
.perm-table th, .perm-table td {
    padding: 9px 14px;
    font-size: .82rem
}

.perm-area-head {
    background: #f6f8fa;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted)
}

.access-sel {
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: 4px 10px;
    font-size: .8rem;
    background: #fff
}

/* ── OWNER CARDS ── */
.owner-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all .2s;
    box-shadow: var(--shadow)
}

    .owner-card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px)
    }

.owner-card-banner {
    height: 80px;
    background: linear-gradient(135deg,#1f6feb,#0d4a9e);
    position: relative
}

    .owner-card-banner img {
        width: 100%;
        height: 100%;
        object-fit: cover
    }

.owner-card-logo {
    position: absolute;
    bottom: -20px;
    left: 16px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 3px solid #fff;
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow)
}

    .owner-card-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain
    }

.owner-card-body {
    padding: 28px 16px 16px
}

.owner-card-name {
    font-weight: 800;
    font-size: .95rem;
    margin-bottom: 2px
}

.owner-card-meta {
    font-size: .75rem;
    color: var(--muted)
}

/* ── LOGIN PAGE ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,#0d1117 0%,#161b22 60%,#1f2d3d 100%)
}

.login-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 16px;
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,.5)
}

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

    .login-logo i {
        font-size: 2.8rem;
        color: var(--accent2)
    }

    .login-logo h1 {
        font-size: 1.4rem;
        font-weight: 800;
        color: #e6edf3;
        margin: 10px 0 4px
    }

    .login-logo p {
        color: #7d8590;
        font-size: .85rem
    }

.login-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #8b949e;
    display: block;
    margin-bottom: 5px
}

.login-input {
    width: 100%;
    background: #0d1117;
    border: 1.5px solid #30363d;
    border-radius: 9px;
    padding: 10px 14px;
    color: #e6edf3;
    font-size: .9rem;
    transition: border-color .15s
}

    .login-input:focus {
        border-color: var(--accent2);
        box-shadow: 0 0 0 3px rgba(56,139,253,.15);
        outline: none
    }

.login-btn {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 12px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    margin-top: 20px
}

    .login-btn:hover {
        background: #1358c8
    }

.login-hint {
    text-align: center;
    margin-top: 16px;
    font-size: .75rem;
    color: #7d8590
}

/* ── DENIED PAGE ── */
.denied-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center
}

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

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

    .sb-overlay.show {
        display: block
    }

    .cms-main {
        margin-left: 0
    }

    .sb-toggle {
        display: block
    }

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

    .cms-content {
        padding: 16px
    }
}
