/* =============================================================================
   CMI Account — Licenses Tab Styles
   ============================================================================= */

/* -- Layout wrapper --------------------------------------------------------- */
.cmi-licenses-wrap {
    max-width: 820px;
}

.cmi-section-heading {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8e8e8;
}

/* -- Empty / notice states -------------------------------------------------- */
.cmi-empty-notice {
    color: #666;
    font-style: italic;
    margin-bottom: 32px;
}

/* -- Device list ------------------------------------------------------------ */
.cmi-device-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

/* -- Device card ------------------------------------------------------------ */
.cmi-device-card {
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 20px 24px;
    background: #fff;
}

.cmi-device-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.cmi-device-name {
    font-size: 1rem;
    font-weight: 600;
}

/* -- Status badges ---------------------------------------------------------- */
.cmi-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.cmi-badge-pending {
    background: #fff8e1;
    color: #9a6700;
}

.cmi-badge-fulfilled {
    background: #e8f5e9;
    color: #1e7e34;
}

.cmi-badge-rejected {
    background: #fdecea;
    color: #b71c1c;
}

/* -- Hardware string display ------------------------------------------------ */
.cmi-device-hw-string {
    margin-bottom: 10px;
}

.cmi-field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.cmi-hw-code {
    display: block;
    padding: 10px 14px;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

/* -- Device meta (submitted date) ------------------------------------------ */
.cmi-device-meta {
    margin-bottom: 14px;
    color: #888;
    font-size: 0.82rem;
}

/* -- License details (for fulfilled devices) -------------------------------- */
.cmi-license-details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.cmi-license-type {
    display: inline-block;
    padding: 4px 12px;
    background: #e3f2fd;
    color: #0d47a1;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.cmi-support-expiry {
    color: #666;
    font-size: 0.82rem;
}

/* -- Device action buttons -------------------------------------------------- */
.cmi-device-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

/* -- Pending / rejected notices --------------------------------------------- */
.cmi-pending-notice {
    font-size: 0.88rem;
    color: #9a6700;
    background: #fff8e1;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 8px 0 0;
}

.cmi-rejected-notice {
    font-size: 0.88rem;
    color: #b71c1c;
    background: #fdecea;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 8px 0 0;
}

/* -- Submit hardware ID section --------------------------------------------- */
.cmi-submit-hardware {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid #e8e8e8;
}

.cmi-form-intro {
    color: #555;
    margin-bottom: 20px;
    max-width: 600px;
}

/* -- Form layout ------------------------------------------------------------ */
.cmi-form .cmi-form-row {
    margin-bottom: 18px;
}

.cmi-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.cmi-required {
    color: #d32f2f;
    margin-left: 2px;
}

.cmi-form input[type="text"] {
    width: 100%;
    max-width: 520px;
    padding: 11px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.cmi-form input[type="text"]:focus {
    border-color: #0d6efd;
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

.cmi-field-hint {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 0.82rem;
}

/* -- Buttons ---------------------------------------------------------------- */
.cmi-btn {
    display: inline-block;
    padding: 11px 22px;
    border: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s;
    line-height: 1.4;
}

.cmi-btn:hover {
    opacity: 0.88;
    text-decoration: none;
}

.cmi-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.cmi-btn-primary {
    background: #111;
    color: #fff;
}

.cmi-btn-download {
    background: #1e7e34;
    color: #fff;
}

/* -- Form feedback messages ------------------------------------------------- */
.cmi-form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 18px;
    max-width: 520px;
}

.cmi-form-message--success {
    background: #e8f5e9;
    color: #1e7e34;
    border: 1px solid #a5d6a7;
}

.cmi-form-message--error {
    background: #fdecea;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
}

/* -- Responsive ------------------------------------------------------------- */
@media (max-width: 600px) {
    .cmi-device-card {
        padding: 16px;
    }
    .cmi-form input[type="text"] {
        max-width: 100%;
    }
    .cmi-form-message {
        max-width: 100%;
    }
}

/* =============================================================================
   CMI Account — Modules Tab Styles
   ============================================================================= */

.cmi-modules-wrap {
    max-width: 860px;
}

/* -- Module grid ------------------------------------------------------------- */
.cmi-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* -- Module card ------------------------------------------------------------- */
.cmi-module-card {
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 22px 24px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cmi-module-owned {
    border-color: #a5d6a7;
}

.cmi-module-locked {
    background: #fafafa;
    opacity: 0.85;
}

.cmi-module-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.cmi-module-name {
    font-size: 1rem;
    font-weight: 700;
}

/* -- Locked badge ------------------------------------------------------------ */
.cmi-badge-locked {
    background: #f3f3f3;
    color: #777;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* -- Module description ------------------------------------------------------ */
.cmi-module-desc {
    font-size: 0.88rem;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

/* -- Module actions ---------------------------------------------------------- */
.cmi-module-actions {
    margin-top: auto;
}

.cmi-module-no-file {
    font-size: 0.82rem;
    color: #888;
    font-style: italic;
}

/* -- Secondary button (shop CTA) -------------------------------------------- */
.cmi-btn-secondary {
    background: #f3f3f3;
    color: #333;
}

/* -- Reseller order history / invoice status badges ------------------------- */
.cmi-order-history-title {
    margin-top: 32px;
}

.cmi-order-history .cmi-badge--paid,
.cmi-invoice .cmi-badge--paid {
    background: #d1fae5;
    color: #065f46;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
}

.cmi-order-history .cmi-badge--unpaid,
.cmi-invoice .cmi-badge--unpaid {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
}

@media (max-width: 540px) {
    .cmi-modules-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   CMI Account — Orders Tab Column Styles
   ============================================================================= */

.cmi-col-license-row {
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.cmi-col-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

.cmi-col-badge--pending  { background: #fff8e1; color: #9a6700; }
.cmi-col-badge--active   { background: #e8f5e9; color: #1e7e34; }
.cmi-col-badge--expired  { background: #f3f3f3; color: #777; }
.cmi-col-badge--revoked  { background: #fdecea; color: #b71c1c; }

.cmi-col-support {
    color: #888;
    display: block;
    margin-top: 2px;
}

.cmi-col-na {
    color: #bbb;
    font-size: 0.82rem;
}

/* -- Invoice button --------------------------------------------------------- */
.cmi-btn-invoice {
    background-color: #555 !important;
    color: #fff !important;
    font-size: 0.82rem;
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
}
.cmi-btn-invoice:hover {
    background-color: #333 !important;
    color: #fff !important;
    text-decoration: none;
}
