:root{
    --bg:#1F1F29;
    --surface:rgba(255,255,255,.05);
    --surface-strong:rgba(255,255,255,.075);
    --primary:#FF9933;
    --primary-2:#E67E22;
    --green:#138808;
    --light:#FFFDB7;
    --text:#fff;
    --muted:rgba(255,255,255,.62);
    --border:rgba(255,255,255,.08);
    --danger:#dc2626;
}

*{
    box-sizing:border-box;
}

html{
    min-width:0;
}

body{
    margin:0;
    min-width:0;
    background:linear-gradient(135deg,#14151d 0%,#1F1F29 55%,#12151b 100%);
    color:var(--text);
    font-family:Inter,sans-serif;
    line-height:1.5;
    overflow-x:hidden;
}

body:before{
    content:"";
    position:fixed;
    inset:0;
    pointer-events:none;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size:70px 70px;
    opacity:.32;
    z-index:-1;
}

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

button,
input,
select,
textarea{
    font:inherit;
}

.layout{
    min-height:100vh;
}

.sidebar{
    position:fixed;
    inset:0 auto 0 0;
    width:280px;
    padding:28px;
    display:flex;
    flex-direction:column;
    background:rgba(255,255,255,.035);
    border-right:1px solid var(--border);
    backdrop-filter:blur(28px);
    z-index:80;
    transition:width .22s ease, padding .22s ease, transform .28s ease;
}

.sidebar-collapse-toggle{
    position:absolute;
    top:18px;
    right:-17px;
    width:34px;
    height:34px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:4px;
    border:1px solid var(--border);
    border-radius:999px;
    background:rgba(31,31,41,.96);
    color:#fff;
    cursor:pointer;
    box-shadow:0 14px 34px rgba(0,0,0,.28);
    z-index:2;
}

.sidebar-collapse-toggle span{
    width:7px;
    height:7px;
    border-top:2px solid currentColor;
    border-left:2px solid currentColor;
    transform:rotate(-45deg);
}

.sidebar-collapse-toggle span + span{
    margin-left:-5px;
}

.sidebar-brand{
    display:flex;
    align-items:center;
    gap:16px;
    margin-bottom:38px;
    min-width:0;
}

.brand-icon{
    width:56px;
    height:56px;
    border-radius:20px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    box-shadow:0 20px 40px rgba(86,45,212,.35);
    font-weight:800;
    font-size:.95rem;
}

.sidebar-brand h2{
    margin:0;
    font-size:1.08rem;
}

.sidebar-brand-text,
.menu-label,
.sidebar-footer-label{
    transition:opacity .16s ease, width .16s ease;
}

.sidebar-brand p,
.profile-card p,
.storage-card p,
.topbar-kicker,
.muted{
    color:var(--muted);
}

.sidebar-brand p,
.profile-card p,
.storage-card p{
    margin:3px 0 0;
    font-size:.86rem;
}

.menu{
    flex:1 1 auto;
    display:grid;
    align-content:start;
    gap:10px;
    min-height:0;
    overflow-y:auto;
    overflow-x:hidden;
    padding-right:4px;
    scrollbar-width:thin;
    scrollbar-color:rgba(255,255,255,.24) transparent;
}

.menu::-webkit-scrollbar{
    width:7px;
}

.menu::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.22);
    border-radius:999px;
}

.menu-item{
    min-height:58px;
    display:flex;
    align-items:center;
    gap:14px;
    padding:0 16px;
    border-radius:20px;
    color:rgba(255,255,255,.68);
    font-weight:700;
    transition:.2s ease;
    min-width:0;
}

.menu-item:hover{
    background:rgba(255,255,255,.045);
    color:#fff;
}

.menu-item.active{
    background:linear-gradient(135deg,rgba(86,45,212,.95),rgba(112,73,239,.78));
    color:#fff;
    box-shadow:0 16px 40px rgba(86,45,212,.28);
}

.menu-icon{
    width:34px;
    height:34px;
    border-radius:13px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    background:rgba(255,255,255,.08);
    font-size:.8rem;
    font-weight:900;
}

.sidebar-footer{
    flex:0 0 auto;
    margin-top:16px;
}

.storage-card{
    padding:20px;
    border-radius:24px;
    background:rgba(255,255,255,.04);
    border:1px solid var(--border);
}

.storage-top{
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-bottom:16px;
    font-size:.88rem;
}

.storage-bar{
    height:10px;
    border-radius:999px;
    background:rgba(255,255,255,.08);
    margin-bottom:12px;
}

.storage-progress{
    width:78%;
    height:100%;
    background:linear-gradient(90deg,var(--primary),var(--green));
}

.main-content{
    min-width:0;
    min-height:100vh;
    margin-left:280px;
    transition:margin-left .22s ease;
}

body.sidebar-collapsed .sidebar{
    width:92px;
    padding:24px 16px;
}

body.sidebar-collapsed .main-content{
    margin-left:92px;
}

body.sidebar-collapsed .sidebar-brand{
    justify-content:center;
    margin-bottom:28px;
}

body.sidebar-collapsed .brand-icon{
    width:48px;
    height:48px;
    border-radius:17px;
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .menu-label,
body.sidebar-collapsed .sidebar-footer-label,
body.sidebar-collapsed .storage-bar{
    width:0;
    opacity:0;
    overflow:hidden;
    pointer-events:none;
}

body.sidebar-collapsed .menu-item{
    justify-content:center;
    padding:0;
}

body.sidebar-collapsed .menu-icon{
    width:42px;
    height:42px;
}

body.sidebar-collapsed .storage-card{
    padding:12px;
    border-radius:18px;
}

body.sidebar-collapsed .storage-top{
    justify-content:center;
    margin-bottom:0;
}

body.sidebar-collapsed .storage-card:before{
    content:"A";
    width:34px;
    height:34px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:13px;
    background:rgba(255,255,255,.08);
    font-weight:900;
}

body.sidebar-collapsed .sidebar-collapse-toggle span{
    transform:rotate(135deg);
}

.topbar{
    position:sticky;
    top:0;
    z-index:60;
    min-height:90px;
    padding:0 36px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    
    border-bottom:1px solid var(--border);
    
}

.topbar h1{
    margin:0;
    font-size:1.9rem;
    letter-spacing:0;
}

.topbar-kicker{
    margin:0 0 4px;
    font-size:.84rem;
    font-weight:800;
    text-transform:uppercase;
}

.profile-card{
    display:flex;
    align-items:center;
    gap:12px;
    padding:8px 10px;
    border-radius:22px;
    background:rgba(255,255,255,.05);
    border:1px solid var(--border);
}

.profile-avatar{
    width:44px;
    height:44px;
    border-radius:16px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    font-weight:900;
}

.profile-card h4{
    margin:0;
    font-size:.92rem;
}

.logout-pill{
    min-height:38px;
    display:inline-flex;
    align-items:center;
    padding:0 14px;
    border-radius:14px;
    background:rgba(255,255,255,.06);
    color:#fff;
    font-weight:800;
    font-size:.84rem;
}

.mobile-topbar{
    display:none;
}

.page-content{
    width:100%;
    max-width:1500px;
    margin:0 auto;
    padding:32px 36px 48px;
    min-width:0;
}

.page-title{
    margin:0 0 22px;
    font-size:1.85rem;
    letter-spacing:0;
}

.cards{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:22px;
}

.card,
.panel,
.table-wrap{
    background:var(--surface);
    border:1px solid var(--border);
    backdrop-filter:blur(28px);
    box-shadow:0 24px 70px rgba(0,0,0,.18);
}

.card{
    position:relative;
    border-radius:30px;
    padding:28px;
}

.dashboard-card{
    min-height:174px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    transition:transform .18s ease, border-color .18s ease, background .18s ease;
}

a.dashboard-card:hover{
    transform:translateY(-3px);
    border-color:rgba(112,73,239,.55);
    background:rgba(255,255,255,.075);
}

.card-label{
    position:relative;
    z-index:1;
    color:var(--muted);
    margin-bottom:12px;
    font-weight:700;
}

.card-value{
    position:relative;
    z-index:1;
    font-size:3rem;
    line-height:1;
    font-weight:900;
}

.card-link-label{
    position:relative;
    z-index:1;
    color:rgba(255,255,255,.7);
    font-size:.84rem;
    font-weight:800;
}

.panel{
    border-radius:28px;
    padding:24px;
    margin-bottom:24px;
}

.section-title{
    margin:0 0 18px;
    font-size:1.2rem;
}

.form-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
}

.provision-form{
    align-items:start;
}

.form-section{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
    margin-bottom:0;
}

.form-section .section-title,
.form-section .textarea,
.form-section .permissions-box,
.form-section .form-actions{
    grid-column:1 / -1;
}

.form-section .field.full-span{
    grid-column:1 / -1;
}

.full-span{
    grid-column:1 / -1;
}

.input,
.textarea{
    width:100%;
    min-width:0;
    color:#fff;
    background:rgba(255,255,255,.045);
    border:1px solid var(--border);
    border-radius:18px;
    padding:15px 16px;
    outline:none;
}

.input:focus,
.textarea:focus{
    border-color:rgba(112,73,239,.75);
    box-shadow:0 0 0 4px rgba(86,45,212,.16);
}

select.input{
    min-height:54px;
}

.textarea{
    min-height:130px;
    resize:vertical;
}

.field{
    display:grid;
    gap:7px;
    min-width:0;
}

.field-label{
    color:var(--muted);
    font-size:.78rem;
    font-weight:800;
    letter-spacing:.02em;
}

.site-admin-picker{
    display:grid;
    gap:12px;
}

.site-admin-options{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    max-height:220px;
    overflow:auto;
}

.site-admin-option{
    width:100%;
    min-width:0;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:11px 12px;
    border:1px solid var(--border);
    border-radius:14px;
    background:rgba(255,255,255,.045);
    color:#fff;
    cursor:pointer;
    text-align:left;
}

.site-admin-option span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-weight:800;
}

.site-admin-option small{
    color:var(--muted);
    flex:0 0 auto;
    text-transform:capitalize;
}

.site-admin-option.is-selected{
    opacity:.42;
    cursor:not-allowed;
}

.site-admin-badges{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    min-height:38px;
}

.site-admin-badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    max-width:100%;
    padding:8px 10px;
    border-radius:999px;
    background:rgba(112,73,239,.2);
    border:1px solid rgba(112,73,239,.35);
    color:#fff;
    font-weight:800;
    font-size:.84rem;
}

.site-admin-badge span{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.site-admin-badge button{
    width:22px;
    height:22px;
    border:0;
    border-radius:999px;
    background:rgba(255,255,255,.14);
    color:#fff;
    cursor:pointer;
    line-height:1;
}

.btn{
    min-height:48px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:0 20px;
    border:0;
    border-radius:17px;
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    color:#fff;
    font-weight:800;
    cursor:pointer;
    box-shadow:0 18px 40px rgba(86,45,212,.22);
    white-space:nowrap;
}

.btn.secondary{
    background:rgba(255,255,255,.07);
    box-shadow:none;
}

.btn.danger{
    background:var(--danger);
    box-shadow:none;
}

.alert{
    padding:14px 16px;
    border-radius:18px;
    margin-bottom:18px;
    font-weight:800;
    border:1px solid var(--border);
}

.alert.success{
    background:rgba(0,158,69,.14);
    color:#bbf7d0;
}

.alert.error{
    background:rgba(220,38,38,.14);
    color:#fecaca;
}

.table-wrap{
    width:100%;
    max-width:100%;
    overflow:auto;
    border-radius:24px;
}

.table{
    width:100%;
    min-width:920px;
    border-collapse:separate;
    border-spacing:0;
    table-layout:auto;
}

.users-table{
    min-width:1040px;
}

.table th,
.table td{
    padding:16px;
    border-bottom:1px solid var(--border);
    text-align:left;
    vertical-align:top;
}

.table th{
    position:sticky;
    top:0;
    z-index:2;
    background:rgba(31,31,41,.95);
    color:rgba(255,255,255,.72);
    font-size:.78rem;
    text-transform:uppercase;
    font-weight:900;
}

.table tr:last-child td{
    border-bottom:0;
}

.table td{
    color:rgba(255,255,255,.88);
}

.badge,
.status-pill{
    min-height:30px;
    display:inline-flex;
    align-items:center;
    padding:0 10px;
    border-radius:999px;
    background:rgba(86,45,212,.20);
    border:1px solid rgba(86,45,212,.28);
    color:#d8ccff;
    font-size:.76rem;
    font-weight:900;
    letter-spacing:0;
}

.status-pill.active{
    background:rgba(0,158,69,.14);
    border-color:rgba(0,158,69,.25);
    color:#86efac;
}

.status-pill.disabled{
    background:rgba(220,38,38,.14);
    border-color:rgba(220,38,38,.24);
    color:#fecaca;
}

.ticket-status.open{
    background:rgba(0,158,69,.14);
    border-color:rgba(0,158,69,.25);
    color:#86efac;
}

.ticket-status.closed{
    background:rgba(255,255,255,.075);
    border-color:rgba(255,255,255,.14);
    color:rgba(255,255,255,.72);
}

.ticket-priority.low{
    background:rgba(56,189,248,.12);
    border-color:rgba(56,189,248,.24);
    color:#7dd3fc;
}

.ticket-priority.normal{
    background:rgba(86,45,212,.20);
    border-color:rgba(86,45,212,.28);
    color:#d8ccff;
}

.ticket-priority.high{
    background:rgba(250,204,21,.13);
    border-color:rgba(250,204,21,.26);
    color:#fde68a;
}

.ticket-priority.urgent{
    background:rgba(248,113,113,.14);
    border-color:rgba(248,113,113,.28);
    color:#fecaca;
}

.support-ticket-create-form{
    grid-template-columns:repeat(2,minmax(0,1fr));
}

.support-ticket-detail-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    margin-bottom:18px;
}

.support-ticket-badges,
.support-ticket-actions{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:10px;
}

.support-ticket-thread{
    display:grid;
    gap:14px;
    margin-bottom:18px;
    padding:16px;
    border-radius:22px;
    border:1px solid var(--border);
    background:rgba(255,255,255,.026);
}

.ticket-message-card{
    padding:16px;
    border-radius:18px;
    border:1px solid rgba(255,255,255,.07);
    background:rgba(255,255,255,.045);
}

.ticket-message-card.admin{
    border-color:rgba(112,73,239,.36);
    background:rgba(112,73,239,.12);
}

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

.ticket-message-meta span{
    color:var(--muted);
    font-size:.84rem;
    white-space:nowrap;
}

.ticket-message-card p{
    margin:0;
    color:rgba(255,255,255,.88);
    white-space:pre-wrap;
}

.support-reply-form{
    margin-top:16px;
}

.support-ticket-actions form{
    margin:0;
}

.small{
    margin-top:5px;
    font-size:.88rem;
}

.permissions-box{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
    padding:14px;
    border:1px solid var(--border);
    border-radius:20px;
    background:rgba(255,255,255,.035);
}

.user-form .permissions-box,
.user-form .form-actions{
    grid-column:1 / -1;
}

.check-row{
    min-width:0;
    display:flex;
    align-items:center;
    gap:10px;
    color:rgba(255,255,255,.82);
    font-size:.9rem;
}

.check-row input{
    width:18px;
    height:18px;
    accent-color:var(--primary);
    flex:0 0 auto;
}

.permission-list{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    max-width:380px;
}

.permission-list span{
    padding:6px 9px;
    border-radius:999px;
    background:rgba(255,255,255,.055);
    color:rgba(255,255,255,.72);
    font-size:.78rem;
    font-weight:700;
}

.users-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    margin-bottom:20px;
}

.users-header .page-title{
    margin-bottom:6px;
}

.user-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:20px;
}

.user-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:26px;
    padding:22px;
    backdrop-filter:blur(28px);
}

.user-card-head{
    display:flex;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px;
}

.user-identity{
    min-width:0;
}

.user-identity h3{
    margin:0 0 5px;
    font-size:1.08rem;
}

.user-meta{
    color:var(--muted);
    font-size:.88rem;
    overflow-wrap:anywhere;
}

.edit-user-form,
.delete-form{
    display:grid;
    gap:12px;
    margin-top:14px;
}

.edit-user-form .permissions-box{
    grid-template-columns:repeat(2,minmax(0,1fr));
}

.manage-details summary{
    list-style:none;
    width:max-content;
}

.manage-details summary::-webkit-details-marker{
    display:none;
}

.actions-row{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.actions-row .delete-form{
    display:inline-flex;
    margin-top:0;
}

.inline-form{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin:0;
}

.commission-input{
    width:96px;
    min-height:42px;
    padding:9px 10px;
}

.tabs-row{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin:0 0 18px;
}

.permissions-box.compact{
    grid-template-columns:repeat(2,minmax(0,1fr));
}

.compact-list{
    gap:6px;
}

.compact-list span{
    font-size:.76rem;
    padding:5px 8px;
}

.mobile-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.58);
    backdrop-filter:blur(10px);
    opacity:0;
    visibility:hidden;
    transition:.2s ease;
    z-index:70;
}

.mobile-overlay.active{
    opacity:1;
    visibility:visible;
}

.menu-toggle{
    width:48px;
    height:48px;
    display:inline-flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:5px;
    border:1px solid var(--border);
    border-radius:18px;
    background:rgba(255,255,255,.055);
    color:#fff;
}

.menu-toggle span{
    width:20px;
    height:2px;
    border-radius:999px;
    background:#fff;
}

@media(max-width:1200px){
    .cards,
    .user-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:980px){
    .sidebar{
        width:280px;
        padding:28px;
        transform:translateX(-100%);
        background:rgba(15,16,22,.96);
        box-shadow:0 30px 80px rgba(0,0,0,.5);
    }

    .sidebar-collapse-toggle{
        display:none;
    }

    body.sidebar-collapsed .sidebar{
        width:280px;
        padding:28px;
    }

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

    .main-content,
    body.sidebar-collapsed .main-content{
        margin-left:0;
    }

    body.sidebar-collapsed .sidebar-brand{
        justify-content:flex-start;
        margin-bottom:38px;
    }

    body.sidebar-collapsed .brand-icon{
        width:56px;
        height:56px;
        border-radius:20px;
    }

    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .menu-label,
    body.sidebar-collapsed .sidebar-footer-label,
    body.sidebar-collapsed .storage-bar{
        width:auto;
        opacity:1;
        overflow:visible;
        pointer-events:auto;
    }

    body.sidebar-collapsed .menu-item{
        justify-content:flex-start;
        padding:0 16px;
    }

    body.sidebar-collapsed .menu-icon{
        width:34px;
        height:34px;
    }

    body.sidebar-collapsed .storage-card{
        padding:20px;
        border-radius:24px;
    }

    body.sidebar-collapsed .storage-card:before{
        content:none;
    }

    .mobile-topbar{
        position:sticky;
        top:0;
        z-index:65;
        min-height:78px;
        padding:0 18px;
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:16px;
        background:rgba(15,16,22,.84);
        border-bottom:1px solid var(--border);
        backdrop-filter:blur(22px);
    }

    .mobile-topbar strong,
    .mobile-topbar span{
        display:block;
    }

    .mobile-topbar span{
        color:var(--muted);
        font-size:.82rem;
        margin-top:2px;
    }

    .topbar{
        display:none;
    }

    .page-content{
        padding:22px 18px 42px;
    }

    .cards,
    .form-grid,
    .form-section,
    .site-admin-options,
    .permissions-box,
    .permissions-box.compact,
    .edit-user-form .permissions-box,
    .user-grid{
        grid-template-columns:1fr;
    }

    .card,
    .panel,
    .user-card{
        border-radius:24px;
        padding:20px;
    }

    .page-title{
        font-size:1.55rem;
    }

    .card-value{
        font-size:2.45rem;
    }

    .users-header{
        display:block;
    }

    .users-header .btn{
        width:100%;
        margin-top:16px;
    }
}

@media(max-width:720px){
    .table-wrap{
        border-radius:22px;
    }

    .table{
        min-width:760px;
    }

    .table th,
    .table td{
        padding:13px;
        font-size:.9rem;
    }

    .profile-card{
        display:none;
    }

    .btn{
        width:100%;
    }

    .user-card-head{
        flex-direction:column;
    }

    .manage-details summary{
        width:100%;
    }
}

.pricing-admin-form{
    margin-top:22px;
}

.pricing-admin-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:18px;
    margin-bottom:20px;
}

.pricing-admin-card{
    display:grid;
    gap:14px;
    padding:20px;
    border:1px solid var(--border);
    border-radius:24px;
    background:rgba(255,255,255,.04);
}

.pricing-admin-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
}

.pricing-admin-head h3{
    margin:0 0 4px;
    font-size:1.08rem;
}

.pricing-admin-head p,
.pricing-admin-card label span{
    display:block;
    color:var(--muted);
    font-size:.88rem;
}

.pricing-admin-card label{
    display:grid;
    gap:8px;
}

@media(max-width:980px){
    .pricing-admin-grid{
        grid-template-columns:1fr;
    }
}

.pricing-editor-form{
    display:grid;
    gap:16px;
}

.pricing-editor-form.compact{
    margin-top:16px;
    padding:18px;
    border:1px solid var(--border);
    border-radius:22px;
    background:rgba(255,255,255,.035);
}

.pricing-editor-grid{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:14px;
}

.pricing-switch-row{
    display:flex;
    flex-wrap:wrap;
    gap:16px;
}

.pricing-plan-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:20px;
}

.pricing-plan-card{
    padding:22px;
    border:1px solid var(--border);
    border-radius:28px;
    background:var(--surface);
    backdrop-filter:blur(28px);
    box-shadow:0 24px 70px rgba(0,0,0,.18);
}

.pricing-plan-summary{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    margin-bottom:18px;
}

.pricing-plan-summary h3{
    margin:0 0 4px;
    font-size:1.15rem;
}

.pricing-plan-summary p{
    margin:0;
    color:var(--muted);
    font-size:.9rem;
}

.pricing-values{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
    margin-bottom:18px;
}

.pricing-values div{
    padding:14px;
    border-radius:18px;
    background:rgba(255,255,255,.045);
    border:1px solid var(--border);
}

.pricing-values span{
    display:block;
    color:var(--muted);
    font-size:.8rem;
    margin-bottom:4px;
}

.pricing-values strong{
    display:block;
    font-size:1.05rem;
}

.pricing-edit-details summary{
    list-style:none;
    width:max-content;
}

.pricing-edit-details summary::-webkit-details-marker{
    display:none;
}

@media(max-width:1200px){
    .pricing-editor-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:980px){
    .pricing-plan-list,
    .pricing-editor-grid,
    .pricing-values{
        grid-template-columns:1fr;
    }

    .pricing-plan-summary{
        display:grid;
    }

    .pricing-edit-details summary{
        width:100%;
    }
}

.admin-modal{
    width:min(920px,calc(100% - 32px));
    max-height:calc(100vh - 40px);
    padding:0;
    border:0;
    border-radius:28px;
    background:transparent;
    color:var(--text);
    overflow:visible;
}

.payment-modal{
    width:min(1080px,calc(100% - 32px));
}

.payment-form{
    display:grid;
    gap:16px;
}

.payment-form-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:14px;
}

.payment-subtitle{
    margin:6px 0 0;
    font-size:1rem;
}

.payment-lines-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
}

.payment-line-items{
    display:grid;
    gap:10px;
}

.payment-line-row{
    display:grid;
    grid-template-columns:minmax(220px,1fr) 110px 150px auto;
    gap:10px;
}

.payments-table{
    min-width:1120px;
}

.invoice-sheet{
    padding:30px;
    border:1px solid var(--border);
    border-radius:28px;
    background:rgba(255,255,255,.96);
    color:#111827;
}

.invoice-sheet .muted,
.invoice-sheet p{
    color:#4b5563;
}

.invoice-head,
.invoice-meta-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:20px;
    margin-bottom:26px;
}

.invoice-head{
    align-items:start;
}

.invoice-head h2{
    margin:0 0 6px;
    font-size:1.6rem;
}

.invoice-head .status-pill{
    justify-self:end;
    grid-column:3;
}

.invoice-meta-grid span{
    display:block;
    color:#6b7280;
    font-size:.78rem;
    font-weight:900;
    text-transform:uppercase;
    margin-bottom:6px;
}

.invoice-meta-grid strong{
    display:block;
    margin-bottom:6px;
    font-size:1.05rem;
}

.invoice-meta-grid p{
    margin:3px 0;
}

.invoice-table{
    width:100%;
    border-collapse:collapse;
}

.invoice-table th,
.invoice-table td{
    padding:13px 10px;
    border-bottom:1px solid #e5e7eb;
    text-align:left;
}

.invoice-table th{
    color:#6b7280;
    font-size:.78rem;
    text-transform:uppercase;
}

.invoice-table tfoot td{
    border-bottom:0;
    font-weight:900;
    font-size:1.05rem;
}

.invoice-table tfoot td:first-child{
    text-align:right;
}

.invoice-notes{
    margin:22px 0 0;
    padding-top:18px;
    border-top:1px solid #e5e7eb;
}

.autotag-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:20px;
}

.autotag-card{
    padding:22px;
    border:1px solid var(--border);
    border-radius:28px;
    background:var(--surface);
    backdrop-filter:blur(28px);
    box-shadow:0 24px 70px rgba(0,0,0,.18);
}

.autotag-card-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px;
}

.autotag-form{
    display:grid;
    gap:16px;
}

.autotag-form.compact{
    margin-top:14px;
    padding:18px;
    border:1px solid var(--border);
    border-radius:22px;
    background:rgba(255,255,255,.035);
}

.autotag-form-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
}

.autotag-stats{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
    margin-bottom:16px;
}

.autotag-stats div{
    min-width:0;
    padding:13px;
    border:1px solid var(--border);
    border-radius:18px;
    background:rgba(255,255,255,.045);
}

.autotag-stats span,
.autotag-history-item span{
    display:block;
    color:var(--muted);
    font-size:.78rem;
    font-weight:800;
}

.autotag-stats strong{
    display:block;
    margin-top:4px;
    overflow-wrap:anywhere;
}

.autotag-history-details{
    margin-top:12px;
}

.autotag-usage-form{
    display:grid;
    grid-template-columns:140px 220px minmax(180px,1fr) auto;
    gap:10px;
    margin-top:14px;
}

.autotag-history-list{
    display:grid;
    gap:10px;
    margin-top:14px;
}

.autotag-history-item{
    padding:12px 14px;
    border:1px solid var(--border);
    border-radius:16px;
    background:rgba(255,255,255,.04);
}

.autotag-history-item p{
    margin:5px 0 0;
    color:rgba(255,255,255,.78);
}

.license-usage-stats{
    margin-top:4px;
}

.license-usage-graph{
    min-height:150px;
    display:flex;
    align-items:flex-end;
    gap:8px;
    padding:14px 4px 10px;
    margin:4px 0 14px;
    border:1px solid var(--border);
    border-radius:18px;
    background:rgba(255,255,255,.035);
}

.license-usage-bar{
    flex:1;
    min-width:0;
    height:120px;
    display:grid;
    grid-template-rows:1fr auto auto;
    gap:5px;
    align-items:end;
    text-align:center;
}

.license-usage-bar span{
    width:100%;
    min-height:4px;
    border-radius:10px 10px 4px 4px;
    background:linear-gradient(180deg, #6ee7b7, #22c55e);
}

.license-usage-bar small,
.license-usage-bar em{
    display:block;
    color:var(--muted);
    font-size:.68rem;
    font-style:normal;
    line-height:1.1;
    overflow:hidden;
    text-overflow:ellipsis;
}

.license-domain-list{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-bottom:14px;
}

.license-domain-pill{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin:0;
    padding:8px 10px;
    border:1px solid rgba(112,73,239,.35);
    border-radius:999px;
    background:rgba(112,73,239,.2);
    color:#fff;
    font-weight:800;
    font-size:.84rem;
}

.license-domain-pill button{
    width:22px;
    height:22px;
    border:0;
    border-radius:999px;
    background:rgba(255,255,255,.14);
    color:#fff;
    cursor:pointer;
    line-height:1;
}

.license-add-domain-form{
    display:grid;
    grid-template-columns:minmax(180px,1fr) auto;
    gap:10px;
    margin-bottom:14px;
}

.license-action-form{
    display:grid;
    grid-template-columns:180px minmax(180px,1fr) auto;
    gap:10px;
    margin-bottom:14px;
}

@media(max-width:980px){
    .payment-form-grid,
    .payment-line-row,
    .invoice-head,
    .invoice-meta-grid,
    .autotag-grid,
    .autotag-form-grid,
    .autotag-stats,
    .autotag-usage-form,
    .license-action-form{
        grid-template-columns:1fr;
    }

    .license-add-domain-form{
        grid-template-columns:1fr;
    }

    .invoice-head .status-pill{
        justify-self:start;
        grid-column:auto;
    }

    .payment-lines-head{
        display:grid;
    }

    .autotag-card-head{
        display:grid;
    }
}

.admin-modal::backdrop{
    background:rgba(0,0,0,.66);
    backdrop-filter:blur(12px);
}

.admin-modal-card{
    max-height:calc(100vh - 40px);
    overflow:auto;
    padding:24px;
    border:1px solid var(--border);
    border-radius:28px;
    background:linear-gradient(135deg,rgba(31,31,41,.98),rgba(18,21,27,.98));
    box-shadow:0 40px 100px rgba(0,0,0,.48);
}

.admin-modal-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    margin-bottom:20px;
}

.admin-modal-head .section-title{
    margin-bottom:4px;
}

.modal-close{
    width:42px;
    height:42px;
    border:1px solid var(--border);
    border-radius:16px;
    background:rgba(255,255,255,.07);
    color:#fff;
    font-weight:900;
    cursor:pointer;
    flex:0 0 auto;
}

.pricing-plan-card > .actions-row{
    margin-top:4px;
}

@media(max-width:720px){
    .admin-modal{
        width:calc(100% - 18px);
        max-height:calc(100vh - 18px);
    }

    .admin-modal-card{
        max-height:calc(100vh - 18px);
        padding:18px;
        border-radius:22px;
    }

    .admin-modal-head{
        gap:12px;
    }

    .support-ticket-create-form{
        grid-template-columns:1fr;
    }

    .support-ticket-detail-head,
    .ticket-message-meta{
        flex-direction:column;
    }

    .ticket-message-meta span{
        white-space:normal;
    }
}
