
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
    position: relative;
    overflow: hidden;
    box-shadow: var(--btn-shadow);
    background: var(--bg-buttons);
    color: #fff;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn .icon,
.btn svg {
    display: none;
}
.btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
    transition: all 0.8s ease;
    pointer-events: none;
    display: none;
}
.btn:hover {
    background: var(--bg-buttons-hover);
    background-image: linear-gradient(135deg, rgb(152, 91, 47) 10%, rgb(225, 128, 38) 85%);
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(74, 108, 247, 0.25);
}
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--bg-buttons);
    color: #fff;
}
.btn-primary:hover { background: var(--bg-buttons-hover); background-image: linear-gradient(135deg, rgb(152, 91, 47) 10%, rgb(225, 128, 38) 85%); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--bg-buttons);
    color: #fff;
    border: none;
}
.btn-secondary:hover { background: var(--bg-buttons-hover); background-image: linear-gradient(135deg, rgb(152, 91, 47) 10%, rgb(225, 128, 38) 85%); }

.btn-ghost {
    background: var(--bg-buttons);
    color: #fff;
    border: none;
}
.btn-ghost:hover { background: var(--bg-buttons-hover); background-image: linear-gradient(135deg, rgb(152, 91, 47) 10%, rgb(225, 128, 38) 85%); }

.btn-danger {
    background: transparent;
    color: #e25555;
    border: 1px solid #e25555;
    box-shadow: none;
}
.btn-danger::after { display: none; }
.btn-danger:hover {
    background: rgba(226, 85, 85, 0.12);
    background-image: none;
    color: #ff7b7b;
    box-shadow: 0 7px 14px rgba(226, 85, 85, 0.25);
}
.btn-danger:active { transform: translateY(0); }

.btn-success {
    background: var(--bg-buttons);
    color: #fff;
    border: none;
}
.btn-success:hover { background: var(--bg-buttons-hover); background-image: linear-gradient(135deg, rgb(152, 91, 47) 10%, rgb(225, 128, 38) 85%); }

.btn-sm  { min-height: 34px; padding: 7px 13px; font-size: 12.5px; gap: 5px; }
.btn-xs  { min-height: 30px; padding: 6px 10px;  font-size: 11.5px; gap: 4px; }
.btn-lg  { min-height: 42px; padding: 11px 22px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; gap: 0; }
.btn-table-action {
    min-width: 58px;
    justify-content: center;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    min-height: 34px;
}


.badge {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font);
    letter-spacing: 0;
    white-space: nowrap;
}
.badge::before {
    display: none;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error   { background: var(--error-bg);   color: var(--error); }
.badge-accent  { background: var(--accent-dim); color: var(--accent); }
.badge-neutral { background: var(--surface3);   color: var(--text-muted); }
.badge-nobefore::before { display: none; }
.badge-license {
    gap: 0;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}
.badge-license::before { display: none; }


.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.form-group:last-child { margin-bottom: 0; }
.form-label {
    font-size: 10.5px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.form-input {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    color: var(--text);
    font-family: var(--font);
    outline: none;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:read-only { opacity: 0.55; cursor: not-allowed; }

.form-select {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    color: var(--text);
    font-family: var(--font);
    outline: none;
    width: 100%;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}
.form-select:hover { border-color: rgba(33, 48, 77, 0.28); }
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    padding: 4px 0;
}
.checkbox-label input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.form-error {
    font-size: 11px;
    color: var(--error);
    font-family: var(--font-mono);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(33, 48, 77, 0.65);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.modal {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.96) translateY(8px);
    transition: transform 0.2s ease;
    position: relative;
}
.modal-overlay.open .modal {
    transform: scale(1) translateY(0);
}
.modal-lg { max-width: 560px; }
.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.modal-subtitle {
    font-size: 12px;
    color: rgb(9, 8, 8);
    margin-top: 3px;
}
.modal-close {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}
.modal-close:hover { background: var(--surface3); color: var(--text); }
.modal-body { margin-bottom: 20px; }
.modal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.modal-footer .btn {
    min-width: 112px;
}

.modal-footer .btn-ghost {
    background: #f6f8ff;
    color: #2c6bff;
    border: 1px solid #8fb0ff;
    box-shadow: none;
}

.modal-footer .btn-ghost::after {
    display: none;
}

.modal-footer .btn-ghost:hover {
    background: #edf3ff;
    border-color: #2c6bff;
    color: #1f5fa8;
    background-image: none;
    box-shadow: none;
}
.modal-alert {
    background: var(--error-bg);
    border: 1px solid rgba(220,38,38,0.25);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 12.5px;
    color: var(--error);
    margin-bottom: 16px;
    line-height: 1.5;
}

.modal-alert strong {
    color: inherit;
    font-weight: 800;
}
.modal-info {
    background: rgba(158, 55, 55, 0.25);
    border: 1px solid rgba(232, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 12.5px;
    color: var(--accent);
    margin-bottom: 16px;
    line-height: 1.5;
}

.recipient-picker {
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}
.recipient-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
}
.recipient-row:last-child {
    border-bottom: none;
}
.recipient-row input {
    margin-top: 3px;
    accent-color: var(--accent);
}
.recipient-row span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.recipient-row small {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
}

@media (max-width: 480px) {
    .modal-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}


.license-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.license-opt {
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface2);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.14s;
    user-select: none;
}
.license-opt:hover { border-color: var(--border-light); color: var(--text); }
.license-opt.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}
.trial-days {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.trial-day-btn {
    padding: 6px 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface2);
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.14s;
}
.trial-day-btn:hover, .trial-day-btn.selected {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.topbar-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface2);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    margin-right: 4px;
}
.topbar-back:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-logout:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239,68,68,0.08);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-bottom: 20px;
}
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.14s;
}
.breadcrumb a:hover {
    color: var(--accent);
}
.breadcrumb span:last-child {
    color: var(--text);
}
.bc-sep {
    color: var(--border);
    font-size: 14px;
}

.thumb-row {
    display: flex;
    gap: 16px;
    padding: 16px 20px 20px;
}
.thumb-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.thumb-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 120px;
    border-radius: 14px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.thumb-avatar-preview {
    background: #fff;
}
.thumb-avatar-preview .thumb-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 0;
    background: transparent;
}
.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}
.thumb-emoji {
    font-size: 52px;
    line-height: 1;
}

.thumb-emoji .icon {
    font-size: 40px;
}
.thumb-theme-preview {
    position: relative;
}
.thumb-theme-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.25);
    display: block;
    box-shadow: 0 4px 16px rgba(33, 48, 77, 0.25);
}
.thumb-label {
    font-size: 10px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}
.thumb-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.assign-wrap {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 0;
}
.assign-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.assign-icon { font-size: 22px; }
.assign-count {
    font-size: 32px;
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1;
}
.assign-done .assign-count   { color: var(--success); }
.assign-pending .assign-count { color: #f59e0b; }
.assign-label {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.assign-divider {
    width: 1px;
    height: 60px;
    background: var(--border);
    margin: 0 10px;
}
.assign-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 18px;
}
.assign-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--surface2);
    border-radius: 99px;
    overflow: hidden;
}
.assign-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 99px;
    transition: width 0.6s ease;
}
.assign-pct {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
}
