/* ================================================
   Agency / Partner Panel - Matching Gleantap Design
   ================================================ */

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #F9FAFB;
    color: #111928;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

/* ---- Sidebar (matches .side__menu from style.css) ---- */
.ag-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 56px;
    height: 100%;
    background-color: #000;
    border-right: 1px solid rgba(255,255,255,0.08);
    padding: 0 8px;
    z-index: 8;
    transition: .3s ease width, .3s ease padding;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ag-sidebar.opened {
    width: 220px;
    padding: 0 16px;
}

.ag-sidebar__top {
    padding-top: 16px;
    width: 100%;
    text-align: center;
}

.ag-sidebar__logo {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    position: relative;
    height: 32px;
    align-items: center;
}

.ag-sidebar__logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.ag-sidebar__logo-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    transition: .3s ease all;
}

.ag-sidebar__logo-long {
    height: 18px;
    margin-left: 10px;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: .3s ease all;
}

.ag-sidebar.opened .ag-sidebar__logo-long {
    opacity: 1;
    max-width: 100px;
}

.ag-sidebar__menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ag-sidebar__menu > li {
    margin-bottom: 8px;
}

.ag-sidebar__menu > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    border-radius: 10px;
    padding: 8px 10px;
    color: #fff;
    text-decoration: none;
    font-size: 0;
    font-weight: 500;
    transition: .3s ease all;
    white-space: nowrap;
    overflow: hidden;
}

.ag-sidebar__menu > li > a svg {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: #9CA3AF;
    transition: .3s ease all;
    margin-right: 0;
}

.ag-sidebar__menu > li > a span {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: .3s ease all;
    margin-left: 0;
}

.ag-sidebar.opened .ag-sidebar__menu > li > a {
    justify-content: flex-start;
    font-size: 14px;
}

.ag-sidebar.opened .ag-sidebar__menu > li > a svg {
    margin-right: 12px;
}

.ag-sidebar.opened .ag-sidebar__menu > li > a span {
    opacity: 1;
    max-width: 200px;
    margin-left: 0;
}

.ag-sidebar__menu > li > a:hover {
    background-color: #E9ECFB;
    color: #4162E5;
}

.ag-sidebar__menu > li > a:hover svg {
    color: #1C45C2;
}

.ag-sidebar__menu > li > a.current {
    background-color: #E9ECFB;
    color: #1C45C2;
}

.ag-sidebar__menu > li > a.current svg {
    color: #1C45C2;
}

/* Sidebar tooltips (on <li> to avoid overflow:hidden clipping on <a>) */
.ag-sidebar__menu > li {
    position: relative;
}

.ag-sidebar__menu > li::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background-color: #111928;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: .15s ease opacity, .15s ease transform;
    z-index: 100;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ag-sidebar__menu > li::before {
    content: '';
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #111928;
    opacity: 0;
    pointer-events: none;
    transition: .15s ease opacity;
    z-index: 100;
}

.ag-sidebar:not(.opened) .ag-sidebar__menu > li:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.ag-sidebar:not(.opened) .ag-sidebar__menu > li:hover::before {
    opacity: 1;
}

/* Hide tooltips when sidebar is expanded */
.ag-sidebar.opened .ag-sidebar__menu > li::after,
.ag-sidebar.opened .ag-sidebar__menu > li::before {
    display: none;
}

/* Bottom expand button tooltip */
.ag-sidebar__bottom {
    position: relative;
}

.ag-sidebar__bottom::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background-color: #111928;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: .15s ease opacity, .15s ease transform;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ag-sidebar__bottom::before {
    content: '';
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #111928;
    opacity: 0;
    pointer-events: none;
    transition: .15s ease opacity;
    z-index: 100;
}

.ag-sidebar:not(.opened) .ag-sidebar__bottom:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.ag-sidebar:not(.opened) .ag-sidebar__bottom:hover::before {
    opacity: 1;
}

.ag-sidebar.opened .ag-sidebar__bottom::after,
.ag-sidebar.opened .ag-sidebar__bottom::before {
    display: none;
}

.ag-sidebar__bottom {
    padding-bottom: 16px;
    display: flex;
    justify-content: center;
}

.ag-sidebar__bottom > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #9CA3AF;
    transition: .3s ease all;
    cursor: pointer;
}

.ag-sidebar__bottom > a:hover {
    color: #fff;
}

.ag-sidebar.opened .ag-sidebar__bottom > a {
    transform: rotate(180deg);
}

/* ---- Header ---- */
.ag-header {
    position: fixed;
    top: 0;
    left: 56px;
    width: calc(100% - 56px);
    height: 52px;
    background-color: #fff;
    border-bottom: 1px solid #E5E7EB;
    z-index: 7;
    padding: 0 24px;
    display: flex;
    align-items: center;
    transition: .3s ease left, .3s ease width;
}

body.sidebar-open .ag-header {
    left: 220px;
    width: calc(100% - 220px);
}

.ag-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.ag-header__left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    max-width: 600px;
}

.ag-header__expand {
    display: none;
}

.ag-header__search {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 480px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    background-color: #F9FAFB;
    padding: 0 14px;
    gap: 10px;
    transition: .2s ease border-color;
}

.ag-header__search:focus-within {
    border-color: #1C45C2;
    background-color: #fff;
}

.ag-header__search svg {
    flex-shrink: 0;
}

.ag-header__search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #111928;
    font-family: inherit;
}

.ag-header__search input::placeholder {
    color: #9CA3AF;
}

.ag-header__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ag-header__user {
    position: relative;
    cursor: pointer;
}

.ag-header__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4162E5, #1C45C2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: .2s ease box-shadow;
}

.ag-header__user:hover .ag-header__avatar {
    box-shadow: 0 0 0 3px rgba(28,69,194,0.15);
}

.ag-header__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 200px;
    z-index: 200;
    overflow: hidden;
}

.ag-header__dropdown-name {
    padding: 12px 16px 8px;
    font-size: 14px;
    font-weight: 600;
    color: #111928;
}

.ag-header__dropdown-divider {
    height: 1px;
    background-color: #E5E7EB;
    margin: 0 12px;
}

.ag-header__dropdown ul {
    list-style: none;
    padding: 6px 0;
    margin: 0;
}

.ag-header__dropdown ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: #374151;
    transition: .2s ease background-color;
}

.ag-header__dropdown ul li a:hover {
    background-color: #F3F4F6;
}

.ag-header__dropdown ul li a svg {
    flex-shrink: 0;
}

/* ---- Content Area ---- */
.ag-content {
    margin-left: 56px;
    margin-top: 52px;
    min-height: calc(100vh - 52px);
    background-color: #F9FAFB;
    transition: .3s ease margin-left;
    padding: 0;
}

body.sidebar-open .ag-content {
    margin-left: 220px;
}

/* ---- Dashboard ---- */
.agency-dashboard {
    padding: 32px 32px 48px;
    max-width: 100%;
}

.agency-dashboard__welcome {
    margin-bottom: 28px;
}

.agency-dashboard__title {
    margin: 0 0 4px 0;
    font-size: 26px;
    line-height: 130%;
    font-weight: 700;
    color: #111928;
}

.agency-dashboard__subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #6B7280;
    margin: 0;
}

/* Quick Actions */
.agency-quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.agency-quick-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: .2s ease all;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.agency-quick-action--primary {
    background-color: #1C45C2;
    color: #fff;
    box-shadow: 0 1px 3px rgba(28,69,194,0.3);
}

.agency-quick-action--primary:hover {
    background-color: #143699;
    color: #fff;
}

.agency-quick-action--outline {
    background-color: #fff;
    color: #374151;
    border: 1px solid #D1D5DB;
}

.agency-quick-action--outline:hover {
    background-color: #F3F4F6;
    border-color: #9CA3AF;
    color: #111928;
}

/* KPI Cards */
.agency-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.agency-kpi-card {
    background-color: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 20px;
    transition: .2s ease box-shadow;
}

.agency-kpi-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.agency-kpi-card__label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px 0;
    font-size: 14px;
    font-weight: 400;
    color: #6B7280;
}

.agency-kpi-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex-shrink: 0;
}

.agency-kpi-card__icon--blue { background-color: #EEF2FF; color: #1C45C2; }
.agency-kpi-card__icon--green { background-color: #ECFDF5; color: #059669; }
.agency-kpi-card__icon--purple { background-color: #F3E8FF; color: #7C3AED; }
.agency-kpi-card__icon--orange { background-color: #FFF7ED; color: #EA580C; }

.agency-kpi-card__value {
    font-size: 30px;
    line-height: 120%;
    font-weight: 700;
    color: #111928;
    margin: 0;
    letter-spacing: -0.5px;
}

/* Charts Row */
.agency-dashboard__row {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 16px;
    margin-bottom: 24px;
}

.agency-card {
    background-color: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
}

.agency-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #F3F4F6;
}

.agency-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111928;
}

.agency-card__meta {
    font-size: 13px;
    color: #9CA3AF;
    font-weight: 400;
}

.agency-card__action {
    font-size: 13px;
    color: #1C45C2;
    text-decoration: none;
    font-weight: 500;
}

.agency-card__action:hover {
    color: #143699;
}

.agency-card__body {
    padding: 20px;
}

.agency-card__body--flush {
    padding: 0;
}

/* Chart container */
.agency-chart-container {
    position: relative;
    height: 260px;
}

/* Account Health */
.agency-health-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.agency-health-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #F3F4F6;
}

.agency-health-item:last-child {
    border-bottom: none;
}

.agency-health-item__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agency-health-item__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.agency-health-item__dot--green { background-color: #059669; }
.agency-health-item__dot--yellow { background-color: #F59E0B; }
.agency-health-item__dot--red { background-color: #EF4444; }

.agency-health-item__label {
    font-size: 14px;
    color: #374151;
}

.agency-health-item__count {
    font-size: 20px;
    font-weight: 700;
    color: #111928;
}

/* Active Rate bar */
.agency-active-rate {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #F3F4F6;
}

.agency-active-rate__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.agency-active-rate__label {
    font-size: 13px;
    color: #6B7280;
}

.agency-active-rate__value {
    font-size: 14px;
    font-weight: 600;
    color: #111928;
}

.agency-active-rate__bar {
    width: 100%;
    height: 6px;
    background-color: #E5E7EB;
    border-radius: 3px;
    overflow: hidden;
}

.agency-active-rate__fill {
    height: 100%;
    background: linear-gradient(90deg, #059669, #34D399);
    border-radius: 3px;
    transition: .3s ease width;
}

/* Table */
.agency-table {
    width: 100%;
    border-collapse: collapse;
}

.agency-table thead th {
    padding: 12px 20px;
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    background-color: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

.agency-table tbody td {
    padding: 14px 20px;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: middle;
}

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

.agency-table tbody tr:hover {
    background-color: #FAFBFC;
}

.agency-table__company {
    font-weight: 600;
    color: #111928;
}

.agency-table__status {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.agency-table__status--active { background-color: #ECFDF5; color: #059669; }
.agency-table__status--inactive { background-color: #FEF2F2; color: #EF4444; }
.agency-table__status--pending { background-color: #FFF7ED; color: #F59E0B; }

.agency-table__login-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1C45C2;
    background-color: #EEF2FF;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: .2s ease all;
    font-family: inherit;
}

.agency-table__login-btn:hover {
    background-color: #DDE4FF;
}

/* Empty state */
.agency-empty-state {
    text-align: center;
    padding: 48px 20px;
}

.agency-empty-state__text {
    font-size: 14px;
    color: #9CA3AF;
}

/* ---- Accounts Pages ---- */
.agency-accounts {
    padding: 32px 32px 48px;
    max-width: 100%;
}

.agency-accounts__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.agency-accounts__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #111928;
}

.agency-accounts__search {
    position: relative;
    width: 280px;
}

.agency-accounts__search input {
    width: 100%;
    padding: 9px 16px 9px 40px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background-color: #F9FAFB;
    outline: none;
    font-family: inherit;
    transition: .2s ease border-color;
}

.agency-accounts__search input:focus {
    border-color: #1C45C2;
    background-color: #fff;
}

.agency-accounts__search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
}

/* ---- Configuration ---- */
.agency-config {
    padding: 32px 32px 48px;
    max-width: 100%;
}

.agency-config__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.agency-config__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #111928;
}

/* ---- Alerts ---- */
.alert-blk {
    position: fixed;
    max-width: 380px;
    bottom: 24px;
    right: 24px;
    left: auto;
    width: auto;
    z-index: 9999;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.alert-waitiner,
.alert-suciner,
.alert-erriner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.alert-waitiner { background-color: #fff; border: 1px solid #E5E7EB; color: #374151; }
.alert-suciner { background-color: #ECFDF5; border: 1px solid #059669; color: #065F46; }
.alert-erriner { background-color: #FEF2F2; border: 1px solid #EF4444; color: #991B1B; }

/* ---- Tabs ---- */
.ag-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #E5E7EB;
}

.ag-tabs__tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: .2s ease all;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ag-tabs__tab:hover {
    color: #111928;
}

.ag-tabs__tab--active {
    color: #1C45C2;
    border-bottom-color: #1C45C2;
}

.ag-tabs__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background-color: #F3F4F6;
    color: #6B7280;
}

.ag-tabs__tab--active .ag-tabs__count {
    background-color: #EEF2FF;
    color: #1C45C2;
}

/* ---- Status Dot ---- */
.ag-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.ag-status-dot--green { background-color: #059669; }
.ag-status-dot--yellow { background-color: #F59E0B; }
.ag-status-dot--red { background-color: #EF4444; }

/* ---- Badges ---- */
.ag-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.ag-badge--subtle {
    background-color: #F3F4F6;
    color: #6B7280;
    margin-left: 6px;
}

.ag-badge--green { background-color: #ECFDF5; color: #059669; }
.ag-badge--yellow { background-color: #FFF7ED; color: #EA580C; }
.ag-badge--red { background-color: #FEF2F2; color: #EF4444; }
.ag-badge--blue { background-color: #EEF2FF; color: #1C45C2; }
.ag-badge--purple { background-color: #F3E8FF; color: #7C3AED; }

/* ---- Module Picker ---- */
.ag-module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.ag-module-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    transition: .2s ease all;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    user-select: none;
}

.ag-module-check:hover {
    border-color: #1C45C2;
    background-color: #FAFBFF;
}

.ag-module-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1C45C2;
    cursor: pointer;
    flex-shrink: 0;
}

.ag-module-check input[type="checkbox"]:checked + span {
    color: #1C45C2;
}

.ag-module-cost {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: #9CA3AF;
    flex-shrink: 0;
}

.ag-module-check:has(input:checked) .ag-module-cost {
    color: #1C45C2;
}

.ag-module-check:has(input:checked) {
    border-color: #1C45C2;
    background-color: #EEF2FF;
}

/* Disabled input + unlimited label */
.ag-input--disabled {
    background-color: #F3F4F6 !important;
    color: #9CA3AF !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.ag-unlimited-label {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #1C45C2;
    letter-spacing: 0.02em;
}

/* ---- Tier Cards ---- */
.ag-tier-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.ag-tier-card {
    cursor: pointer;
    display: block;
}

.ag-tier-card input[type="radio"] {
    display: none;
}

.ag-tier-card__inner {
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    padding: 14px 16px;
    transition: .2s ease all;
}

.ag-tier-card:hover .ag-tier-card__inner {
    border-color: #1C45C2;
    background-color: #FAFBFF;
}

.ag-tier-card input:checked + .ag-tier-card__inner {
    border-color: #1C45C2;
    background-color: #EEF2FF;
    box-shadow: 0 0 0 1px #1C45C2;
}

.ag-tier-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.ag-tier-card__name {
    font-size: 15px;
    font-weight: 600;
    color: #111928;
}

.ag-tier-card__base {
    font-size: 13px;
    font-weight: 600;
    color: #1C45C2;
}

.ag-tier-card__modules {
    font-size: 12px;
    color: #6B7280;
    line-height: 1.5;
}

.ag-tier-card__contacts {
    font-size: 12px;
    color: #059669;
    font-weight: 500;
    margin-top: 4px;
}

/* ---- Assign Link ---- */
.ag-assign-link {
    font-size: 13px;
    color: #1C45C2;
    cursor: pointer;
    font-weight: 500;
}

.ag-assign-link:hover {
    text-decoration: underline;
}

/* ---- Action Buttons ---- */
.ag-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ag-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    transition: .2s ease background-color;
}

.ag-action-btn:hover {
    background-color: #F3F4F6;
}

/* ---- Modal ---- */
.ag-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ag-modal {
    background-color: #fff;
    border-radius: 12px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.ag-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.ag-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111928;
}

.ag-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: none;
    font-size: 20px;
    color: #9CA3AF;
    cursor: pointer;
    transition: .2s ease all;
}

.ag-modal__close:hover {
    background-color: #F3F4F6;
    color: #374151;
}

.ag-modal__body {
    padding: 24px;
}

/* ---- Form Elements ---- */
.ag-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ag-form-group {
    display: flex;
    flex-direction: column;
}

.ag-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.ag-input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #111928;
    background-color: #fff;
    font-family: inherit;
    outline: none;
    transition: .2s ease border-color;
    width: 100%;
}

.ag-input:focus {
    border-color: #1C45C2;
    box-shadow: 0 0 0 3px rgba(28,69,194,0.1);
}

.ag-input--textarea {
    height: auto;
    padding: 10px 12px;
    resize: vertical;
    min-height: 80px;
}

select.ag-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ---- Billing Model Cards ---- */
.ag-billing-models {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ag-billing-model {
    cursor: pointer;
    display: block;
}

.ag-billing-model input[type="radio"] {
    display: none;
}

.ag-billing-model__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    transition: .2s ease all;
}

.ag-billing-model:hover .ag-billing-model__inner {
    border-color: #1C45C2;
    background-color: #FAFBFF;
}

.ag-billing-model--active .ag-billing-model__inner,
.ag-billing-model input:checked + .ag-billing-model__inner {
    border-color: #1C45C2;
    background-color: #EEF2FF;
    box-shadow: 0 0 0 1px #1C45C2;
}

.ag-billing-model__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}

.ag-billing-model__name {
    font-size: 15px;
    font-weight: 600;
    color: #111928;
    margin-bottom: 2px;
}

.ag-billing-model__desc {
    font-size: 13px;
    color: #6B7280;
}

/* Stripe Elements container */
#card-element {
    min-height: 40px;
}

.StripeElement--focus {
    border-color: #1C45C2 !important;
    box-shadow: 0 0 0 3px rgba(28,69,194,0.1);
}

.StripeElement--invalid {
    border-color: #EF4444 !important;
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .agency-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .agency-dashboard__row { grid-template-columns: 1fr; }
}

@media (max-width: 991px) {
    .ag-sidebar {
        transform: translateX(-100%);
    }
    .ag-sidebar.mobile-open {
        transform: translateX(0);
        width: 220px;
        padding: 0 16px;
    }
    .ag-sidebar.mobile-open .ag-sidebar__logo-long { opacity: 1; max-width: 100px; }
    .ag-sidebar.mobile-open .ag-sidebar__menu > li > a { justify-content: flex-start; font-size: 14px; }
    .ag-sidebar.mobile-open .ag-sidebar__menu > li > a svg { margin-right: 12px; }
    .ag-sidebar.mobile-open .ag-sidebar__menu > li > a span { opacity: 1; max-width: 200px; }
    .ag-header { left: 0; width: 100%; }
    .ag-header__expand { display: flex; }
    .ag-content { margin-left: 0; }
    body.sidebar-open .ag-header { left: 0; width: 100%; }
    body.sidebar-open .ag-content { margin-left: 0; }
    .agency-dashboard, .agency-accounts, .agency-config { padding: 24px 16px; }
    .agency-accounts__header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .agency-accounts__search { width: 100%; }
    .agency-quick-actions { flex-wrap: wrap; }
}

@media (max-width: 767px) {
    .agency-kpi-grid { grid-template-columns: 1fr; }
    .agency-dashboard__title { font-size: 22px; }
    .agency-kpi-card__value { font-size: 24px; }
}

/* Overlay for mobile sidebar */
.ag-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 7;
}

.ag-overlay.active {
    display: block;
}
