/* ==========================================================================
   Licensing, support portal, and admin dashboard
   ========================================================================== */

.license-form {
    max-width: 520px;
}

.license-form label {
    display: block;
    margin-bottom: 0.4em;
    font-weight: bold;
    color: var(--header-primary);
}

.license-form input[type="text"],
.license-form input[type="email"],
.license-form input[type="password"],
.license-form input[type="number"],
.license-form select,
.license-form textarea {
    width: 100%;
    padding: 0.6em 0.75em;
    margin-bottom: 1em;
    background: var(--dark-bg);
    border: 1px solid var(--dark-tertiary);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1em;
}

.license-form input:focus,
.license-form select:focus,
.license-form textarea:focus {
    outline: none;
    border-color: var(--orange-primary);
}

.license-form textarea {
    resize: vertical;
    min-height: 6em;
}

.license-form button,
.license-actions button {
    cursor: pointer;
    font: inherit;
}

.license-alert {
    padding: 0.75em 1em;
    border-radius: 8px;
    margin-bottom: 1.25em;
}

.license-alert-error {
    background: rgba(236, 111, 102, 0.15);
    border: 1px solid var(--coral-primary);
    color: var(--text-primary);
}

.license-alert-success {
    background: rgba(120, 255, 214, 0.1);
    border: 1px solid var(--firefly-primary);
    color: var(--text-primary);
}

.license-alert-warning {
    background: rgba(249, 160, 109, 0.12);
    border: 1px solid var(--orange-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75em;
}

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

.license-table th,
.license-table td {
    text-align: left;
    padding: 0.6em 0.75em;
    border-bottom: 1px solid var(--dark-tertiary);
    vertical-align: top;
}

.license-table th {
    color: var(--header-primary);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.license-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.license-badge {
    display: inline-block;
    padding: 0.15em 0.6em;
    border-radius: 999px;
    font-size: 0.8em;
    font-weight: bold;
}

.license-badge-active   { background: rgba(120, 255, 214, 0.15); color: var(--firefly-primary); }
.license-badge-open     { background: rgba(120, 255, 214, 0.15); color: var(--firefly-primary); }
.license-badge-expired,
.license-badge-revoked  { background: rgba(236, 111, 102, 0.15); color: var(--coral-primary); }
.license-badge-closed   { background: rgba(139, 148, 158, 0.2); color: var(--text-secondary); }

.license-tickets-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.license-tickets-list li {
    padding: 0.75em 0;
    border-bottom: 1px solid var(--dark-tertiary);
    cursor: pointer;
}

.license-tickets-list li:hover {
    color: var(--orange-primary);
}

.license-ticket-thread {
    max-height: 420px;
    overflow-y: auto;
    margin-bottom: 1em;
}

.license-message {
    padding: 0.75em 1em;
    border-radius: 8px;
    margin-bottom: 0.75em;
    background: var(--dark-bg);
}

.license-message-admin {
    border-left: 3px solid var(--orange-primary);
}

.license-message-customer {
    border-left: 3px solid var(--firefly-primary);
}

.license-message .meta {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 0.35em;
}

.license-tabs {
    display: flex;
    gap: 0.5em;
    margin-bottom: 1.5em;
    flex-wrap: wrap;
}

.license-tabs button {
    padding: 0.5em 1.1em;
    border: 1px solid var(--dark-tertiary);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
}

.license-tabs button.active {
    border-color: var(--orange-primary);
    color: var(--orange-primary);
}

.license-metric-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1em;
    margin-bottom: 2em;
}

.license-metric-tiles .box h3 {
    margin: 0 0 0.25em;
    font-size: 1.8em;
    color: var(--orange-primary);
}

.license-metric-tiles .box p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.license-table-wrap {
    overflow-x: auto;
}

.license-inline-form {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1.5em;
}

.license-inline-form > div {
    flex: 1 1 160px;
}

.license-inline-form label {
    display: block;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 0.25em;
}

.license-inline-form input,
.license-inline-form select {
    width: 100%;
    padding: 0.5em 0.6em;
    background: var(--dark-bg);
    border: 1px solid var(--dark-tertiary);
    border-radius: 6px;
    color: var(--text-primary);
}

.license-row-actions {
    display: flex;
    gap: 0.4em;
    flex-wrap: wrap;
}

.license-row-actions button {
    padding: 0.3em 0.7em;
    border: 1px solid var(--dark-tertiary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85em;
}

.license-row-actions button:hover {
    color: var(--orange-primary);
    border-color: var(--orange-primary);
}

.license-row-actions button.danger:hover {
    color: var(--coral-primary);
    border-color: var(--coral-primary);
}
