﻿/* Legacy table styling kept for compatibility (currently unused by markup) */
.certificates-table {
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-top: 20px;
    background-color: #161b22;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border: 1px solid #30363d;
}

.certificates-table th,
.certificates-table td {
    padding: 15px 50px;
    text-align: left;
    font-size: 16px;
    border-bottom: 1px solid #30363d;
}

.certificates-table th {
    background-color: #0d1117;
    color: #58a6ff;
    font-weight: 600;
}

.certificates-table td {
    color: #c9d1d9;
}

.certificates-table button {
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 2px;
    background-color: #238636;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.certificates-table button:hover {
    background-color: #2ea043;
    transform: translateY(-1px);
}

/* Dashboard Certificati */
.certs-intro {
    color: #8b949e;
    margin-bottom: 24px;
    font-size: .95rem;
}

h1 {
    margin-bottom: 8px;
}

.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.cert-card {
    background: linear-gradient(180deg, #161b22 0%, #10141a 100%);
    border: 1px solid #30363d;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    display: flex;
    flex-direction: column;
}

.cert-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .5);
    border-color: #3d4552;
}

.cert-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #30363d;
    margin-bottom: 16px;
}

.cert-card-heading {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.cert-card-icon {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: #0d1117;
    border: 1px solid #30363d;
}

.cert-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f0f6fc;
    line-height: 1.3;
}

.cert-card-desc {
    font-size: .8rem;
    color: #8b949e;
    margin-top: 2px;
}

.cert-card-desc-block {
    font-size: .85rem;
    color: #8b949e;
    background: #0d1117;
    border: 1px dashed #30363d;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 4px;
}

.cert-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.cert-info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: .84rem;
}

.cert-info-label {
    color: #8b949e;
    white-space: nowrap;
}

.cert-info-value {
    color: #c9d1d9;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: .78rem;
}

.cert-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.status-not-generated {
    background: #21262d;
    color: #8b949e;
    border-color: #30363d;
}

.status-csr-generated {
    background: #1c2e4a;
    color: #58a6ff;
    border-color: #2f5a8f;
}

.status-uploaded {
    background: #10361f;
    color: #3fb950;
    border-color: #238636;
}

.expiry-valid {
    background: #10361f;
    color: #3fb950;
    border-color: #238636;
}

.expiry-expiring {
    background: #3a2f0b;
    color: #e3b341;
    border-color: #9e7a17;
}

.expiry-imminent {
    background: #3d2410;
    color: #f0883e;
    border-color: #ad561f;
}

.expiry-expired {
    background: #3d1213;
    color: #ff7b72;
    border-color: #ad2c2c;
}

.cert-expiry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 4px;
}

.cert-expiry-days {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f0f6fc;
}

.cert-expiry-caption {
    font-size: .72rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.cert-card-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #30363d;
}

.cert-action-btn {
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 8px;
    margin: 0;
    width: 100%;
}

.cert-action-secondary {
    background-color: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
}

.cert-action-secondary:hover {
    background-color: #30363d;
}

.cert-upload-area {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.cert-file-label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .9rem;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 8px;
    cursor: pointer;
    font-size: .8rem;
    color: #c9d1d9;
    transition: background-color .2s ease;
}

.cert-file-label:hover {
    background: #30363d;
}

.cert-file-label input[type=file] {
    display: none;
}

.cert-filename {
    font-size: .76rem;
    color: #58a6ff;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cert-alert {
    display: none;
    padding: .5rem .8rem;
    border-radius: 8px;
    font-size: .78rem;
    margin-top: 12px;
}

.cert-alert.show {
    display: block;
}

.cert-alert.ok {
    background: #10361f;
    color: #3fb950;
    border: 1px solid #238636;
}

.cert-alert.err {
    background: #3d1213;
    color: #ff7b72;
    border: 1px solid #ad2c2c;
}

.cert-alert.inf {
    background: #1c2e4a;
    color: #58a6ff;
    border: 1px solid #2f5a8f;
}
