/* ═══════════════════════════════════════════════════
   Components — Cards, KPIs, Badges, Tables, Forms,
   Buttons, Lists, Details Panels, Notices
   ═══════════════════════════════════════════════════ */

/* ── Card ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.25s var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-hd {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.card-title {
    font-size: 13px; font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-family: var(--font);
}
.card-action {
    font-size: 12px; color: var(--blue);
    cursor: pointer; font-weight: 600;
    transition: color .2s;
}
.card-action:hover { text-decoration: underline; color: #2563eb; }

/* ── KPI ── */
.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 18px;
    box-shadow: var(--shadow);
    position: relative; overflow: hidden;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.kpi::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--kpi-color, var(--blue));
    border-radius: var(--r2) var(--r2) 0 0;
}
.kpi-icon   { font-size: 20px; margin-bottom: 10px; }
.kpi-label  {
    font-size: 11.5px; color: var(--text-3);
    font-weight: 600; margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: .05em;
    font-family: var(--font);
}
.kpi-val {
    font-size: 32px; font-weight: 800;
    color: var(--text-1); line-height: 1;
    letter-spacing: -.5px;
    font-family: var(--font);
}
.kpi-sub { font-size: 11.5px; margin-top: 8px; font-weight: 500; }
.kpi-sub.up { color: var(--green); }
.kpi-sub.dn { color: var(--red); }
.kpi-sub.nt { color: var(--text-3); }

/* ── Badge ── */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 700;
    padding: 4px 10px; border-radius: 6px;
    white-space: nowrap;
}
.badge::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
}
.badge.green       { background: var(--green-bg); color: var(--green); }
.badge.green::before{ background: var(--green); }
.badge.red         { background: var(--red-bg); color: var(--red); }
.badge.red::before { background: var(--red); }
.badge.amber       { background: var(--amber-bg); color: var(--amber); }
.badge.amber::before{ background: var(--amber); }
.badge.blue        { background: var(--blue-bg); color: var(--blue); }
.badge.blue::before{ background: var(--blue); }
.badge.gray        { background: var(--bg2); color: var(--text-3); }
.badge.gray::before{ background: var(--text-4); }

/* ── Table ── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead tr { border-bottom: 2px solid var(--border); }
.tbl th {
    text-align: left; padding: 10px 12px;
    font-size: 11px; font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase; letter-spacing: .05em;
    font-family: var(--font);
}
.tbl td {
    padding: 12px; border-bottom: 1px solid #f5f7fa;
    vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr {
    transition: background .15s, transform .15s;
}
.tbl tbody tr:hover td { background: rgba(59,130,246,.03); }
.tbl tbody tr:hover { transform: translateX(1px); }
.twrap { overflow-x: auto; }

/* ── Form ── */
.fg { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fl {
    font-size: 11.5px; font-weight: 700;
    color: var(--text-2);
    font-family: var(--font);
}
.fi {
    font-size: 13.5px; padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-1);
    font-family: var(--font-body);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.fi:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .1);
}
.fgrid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-grid .fg   { margin-bottom: 0; }
.form-grid .full { grid-column: 1 / -1; }

/* ── Buttons ── */
.btn-row {
    display: flex; gap: 10px;
    margin-top: 16px; flex-wrap: wrap;
}
.btn {
    font-size: 13px; font-weight: 700;
    padding: 10px 18px; border-radius: 8px;
    cursor: pointer; border: none;
    font-family: var(--font);
    transition: all .2s var(--ease-out);
    display: inline-flex;
    align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--navy);
    color: #fff;
}
.btn-primary:hover { background: var(--navy-3); }
.btn-accent {
    background: var(--accent);
    color: #fff;
}
.btn-accent:hover { background: var(--accent-hover); }
.btn-sec {
    background: #fff;
    color: var(--text-1);
    border: 1px solid var(--border);
}
.btn-sec:hover { background: var(--bg); }
.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-bdr);
}
.btn-danger:hover { background: #fee2e2; }
.btn-sm   { padding: 7px 14px; font-size: 12px; }
.btn-wfull { width: 100%; }

/* ── List Items ── */
.list-item {
    display: flex; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid #f5f7fa;
    align-items: flex-start;
}
.list-item:last-child { border-bottom: none; padding-bottom: 0; }
.item-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.item-title {
    font-size: 13px; font-weight: 700;
    color: var(--text-1); line-height: 1.4;
}
.item-meta {
    font-size: 11.5px; color: var(--text-3);
    margin-top: 4px;
}

/* ── Detail Panel ── */
.dp-row { display: flex; margin-bottom: 8px; font-size: 13px; }
.dp-lbl { width: 100px; color: var(--text-3); font-weight: 600; }
.dp-val { color: var(--text-1); font-weight: 700; flex: 1; }

/* ── Notice Banners ── */
.notice-banner {
    background: var(--red-bg);
    border: 1px solid var(--red-bdr);
    border-radius: var(--r);
    padding: 12px 16px;
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.notice-text {
    color: var(--red);
    font-size: 13px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}
