/* Codcy Image Optimizer — Admin Styles */

.codcy-io-wrap {
    max-width: 860px;
    margin: 28px 20px 40px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a2a;
}

/* Header */
.codcy-io-header {
    background: #0f0f1a;
    border-radius: 10px;
    padding: 24px 28px;
    margin-bottom: 14px;
    color: #fff;
}
.codcy-io-header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}
.codcy-io-logo {
    width: 36px;
    height: 36px;
    color: #fff;
    flex-shrink: 0;
}
.codcy-io-header h1 {
    margin: 0 0 3px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    border: none;
    padding: 0;
}
.codcy-io-header p {
    margin: 0;
    font-size: 13px;
    color: rgba(255,255,255,.55);
}
.codcy-io-header a {
    color: rgba(255,255,255,.75);
    text-decoration: none;
}
.codcy-io-header a:hover { color: #fff; }

/* Info bar */
.codcy-io-infobar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.codcy-io-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}
.codcy-io-badge.ok      { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.codcy-io-badge.err     { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.codcy-io-badge.neutral { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.codcy-io-badge code    { font-size: 11px; background: transparent; }

/* Alert */
.codcy-io-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
    border-left: 3px solid;
}
.codcy-io-alert.err { background: #fef2f2; color: #991b1b; border-color: #ef4444; }

/* Card */
.codcy-io-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px 28px;
    margin-bottom: 14px;
}
.codcy-io-card-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #0f0f1a;
}
.codcy-io-card-desc {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 18px;
    line-height: 1.5;
}

/* Buttons */
.codcy-io-btn {
    display: inline-block;
    padding: 9px 22px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity .15s, background .15s;
    line-height: 1.4;
}
.codcy-io-btn:disabled { opacity: .5; cursor: not-allowed; }
.codcy-io-btn.primary { background: #0f0f1a; color: #fff; }
.codcy-io-btn.primary:hover:not(:disabled) { background: #1e1e35; }
.codcy-io-btn.success { background: #059669; color: #fff; }
.codcy-io-btn.success:hover:not(:disabled) { background: #047857; }
.codcy-io-btn.danger  { background: #fff; color: #dc2626; border: 1px solid #fca5a5; }
.codcy-io-btn.danger:hover:not(:disabled)  { background: #fef2f2; }

.codcy-io-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #f3f4f6;
}

/* Stat grid */
.codcy-io-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 6px;
}
.codcy-io-stat {
    border-radius: 8px;
    padding: 14px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.codcy-io-stat-val   { font-size: 22px; font-weight: 700; line-height: 1.1; }
.codcy-io-stat-label { font-size: 11px; opacity: .65; text-transform: uppercase; letter-spacing: .4px; }

/* Progress */
.codcy-io-progress-wrap { margin-bottom: 14px; }
.codcy-io-progress-bar {
    background: #f3f4f6;
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}
.codcy-io-progress-bar #progress-fill {
    height: 100%;
    background: #059669;
    border-radius: 6px;
    width: 0%;
    transition: width .35s ease;
}
.codcy-io-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
}

/* Savings bar */
.codcy-io-savings {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
    padding: 9px 14px;
    font-size: 13px;
    color: #065f46;
    font-weight: 500;
    margin-bottom: 12px;
}

/* Log */
.codcy-io-log {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    padding: 12px 14px;
    max-height: 260px;
    overflow-y: auto;
    font-size: 11.5px;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    line-height: 1.75;
    color: #374151;
}
.codcy-io-log .log-err { color: #dc2626; }
.codcy-io-log.err-log  { max-height: 180px; }

/* Section label */
.codcy-io-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #9ca3af;
    margin: 18px 0 8px;
}
.codcy-io-section-label.err-label { color: #dc2626; }

/* Tags */
.codcy-io-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.codcy-io-tag {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.codcy-io-tag.orange  { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.codcy-io-tag.green   { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.codcy-io-tag.neutral { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

/* Manual mode */
.codcy-io-manual-info { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.codcy-io-manual-row {
    display: grid; grid-template-columns: 160px 1fr;
    padding: 9px 14px; font-size: 12.5px; border-bottom: 1px solid #f3f4f6;
}
.codcy-io-manual-row:last-child { border-bottom: none; }
.codcy-io-manual-row .label { color: #6b7280; font-weight: 500; }
.codcy-io-manual-row .value { color: #111; font-family: 'DM Mono', monospace; word-break: break-all; }
.codcy-io-manual-row.ok  .value { color: #059669; font-weight: 600; font-family: inherit; }
.codcy-io-manual-row.warn .value { color: #d97706; font-weight: 600; font-family: inherit; }
.codcy-io-manual-row.err { background: #fef2f2; color: #b91c1c; grid-template-columns: 1fr; }

.codcy-io-footer {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 10px;
    padding-top: 10px;
}
.codcy-io-footer a { color: #6b7280; text-decoration: none; }
.codcy-io-footer a:hover { color: #374151; }
