:root {
    --admin-blue: #1456d9;
    --admin-blue-dark: #0e3f9d;
    --admin-yellow: #ffd43b;
    --admin-bg: #f4f7fb;
    --admin-card: #ffffff;
    --admin-text: #172033;
    --admin-muted: #64748b;
    --admin-line: #e5e7eb;
    --admin-red: #ef4444;
    --admin-green: #16a34a;
    --admin-orange: #f97316;
    --admin-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    --admin-radius: 18px;
}

* {
    box-sizing: border-box;
}

body.admin-body,
body.login-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
    color: var(--admin-text);
    background: var(--admin-bg);
    line-height: 1.55;
}

a {
    color: inherit;
    text-decoration: none;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.admin-sidebar {
    background: #101827;
    color: #e5e7eb;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 16px;
}

.admin-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--admin-blue), var(--admin-blue-dark));
    color: var(--admin-yellow);
    font-weight: 900;
}

.admin-brand-text strong {
    display: block;
    font-size: 16px;
    letter-spacing: -0.04em;
}

.admin-brand-text span {
    display: block;
    font-size: 12px;
    color: #94a3b8;
}

.admin-menu {
    display: grid;
    gap: 5px;
}

.admin-menu-section {
    margin: 18px 8px 6px;
    font-size: 12px;
    font-weight: 900;
    color: #94a3b8;
}

.admin-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 13px;
    color: #cbd5e1;
    font-weight: 800;
    font-size: 14px;
}

.admin-menu a:hover,
.admin-menu a.is-active {
    background: rgba(20, 86, 217, .22);
    color: #fff;
}

.admin-main {
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--admin-line);
    padding: 15px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.admin-page-title h1 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -0.06em;
}

.admin-page-title p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--admin-muted);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.admin-user-info {
    text-align: right;
}

.admin-user-info strong {
    display: block;
    font-size: 14px;
}

.admin-user-info span {
    display: block;
    font-size: 12px;
    color: var(--admin-muted);
}

.admin-logout {
    padding: 9px 12px;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 900;
    font-size: 13px;
}

.admin-content {
    padding: 24px;
}

.admin-grid {
    display: grid;
    gap: 18px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card,
.admin-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-line);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
}

.stat-card {
    padding: 19px;
}

.stat-card span {
    display: block;
    color: var(--admin-muted);
    font-size: 13px;
    font-weight: 800;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    letter-spacing: -0.05em;
}

.stat-card small {
    display: block;
    margin-top: 6px;
    color: var(--admin-muted);
}

.admin-card {
    padding: 20px;
}

.admin-card h2 {
    margin: 0 0 14px;
    font-size: 20px;
    letter-spacing: -0.05em;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--admin-line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.admin-table th {
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    background: #e8f0ff;
    color: var(--admin-blue);
}

.badge.green {
    background: #dcfce7;
    color: #166534;
}

.badge.orange {
    background: #ffedd5;
    color: #9a3412;
}

.badge.gray {
    background: #f1f5f9;
    color: #475569;
}

.empty-box {
    padding: 28px;
    border-radius: 16px;
    background: #f8fafc;
    color: var(--admin-muted);
    text-align: center;
    font-weight: 800;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, rgba(255, 212, 59, .28), transparent 34%),
        linear-gradient(135deg, #eef5ff, #ffffff 46%, #f6f8fb);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border: 1px solid var(--admin-line);
    border-radius: 28px;
    box-shadow: var(--admin-shadow);
    padding: 30px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.login-logo-mark {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--admin-blue), var(--admin-blue-dark));
    color: var(--admin-yellow);
    font-weight: 900;
}

.login-logo strong {
    display: block;
    font-size: 18px;
    letter-spacing: -0.04em;
}

.login-logo span {
    display: block;
    color: var(--admin-muted);
    font-size: 13px;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 28px;
    letter-spacing: -0.06em;
}

.login-card p {
    margin: 0 0 22px;
    color: var(--admin-muted);
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-weight: 900;
    margin-bottom: 7px;
    font-size: 14px;
}

.form-input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--admin-line);
    border-radius: 14px;
    padding: 0 14px;
    font-size: 15px;
    outline: none;
}

.form-input:focus {
    border-color: var(--admin-blue);
    box-shadow: 0 0 0 4px rgba(20, 86, 217, .12);
}

.btn-admin {
    display: inline-flex;
    width: 100%;
    height: 50px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 15px;
    background: var(--admin-blue);
    color: #fff;
    font-weight: 900;
    font-size: 15px;
    cursor: pointer;
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 800;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.login-help {
    margin-top: 18px;
    padding: 13px;
    border-radius: 14px;
    background: #f8fafc;
    color: var(--admin-muted);
    font-size: 13px;
}

@media (max-width: 980px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
    }

    .admin-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-menu-section {
        grid-column: 1 / -1;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px;
    }

    .admin-user {
        width: 100%;
        justify-content: space-between;
    }

    .admin-content {
        padding: 14px;
    }

    .admin-menu {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 22px;
        border-radius: 22px;
    }
}
.admin-form {
    max-width: 520px;
}

.admin-form .btn-admin {
    max-width: 220px;
}
.admin-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.admin-card-head h2 {
    margin-bottom: 4px;
}

.admin-card-head p {
    margin: 0;
    color: var(--admin-muted);
    font-size: 14px;
}

.stat-link {
    display: block;
    transition: transform .16s ease, border-color .16s ease;
}

.stat-link:hover {
    transform: translateY(-2px);
    border-color: rgba(20, 86, 217, .35);
}

.search-form {
    margin-top: 4px;
}

.search-grid {
    display: grid;
    grid-template-columns: 160px 180px 160px 160px 1fr 120px;
    gap: 12px;
    align-items: end;
}

.search-keyword {
    min-width: 220px;
}

.search-submit .btn-admin {
    height: 48px;
}

.admin-small-btn {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 11px;
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.admin-small-btn.primary {
    background: var(--admin-blue);
    color: #fff;
}

.badge.red {
    background: #fee2e2;
    color: #991b1b;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
    margin-top: 18px;
}

.pagination a {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 11px;
    border: 1px solid var(--admin-line);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 13px;
}

.pagination a.is-active {
    background: var(--admin-blue);
    color: #fff;
    border-color: var(--admin-blue);
}

@media (max-width: 1180px) {
    .search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-keyword {
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .admin-card-head {
        display: block;
    }

    .admin-card-head .admin-small-btn {
        margin-top: 10px;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }
}
.detail-head-card {
    background: linear-gradient(135deg, #ffffff, #eef5ff);
    border: 1px solid var(--admin-line);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    padding: 22px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.detail-kicker {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e8f0ff;
    color: var(--admin-blue);
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 8px;
}

.detail-head-card h2 {
    margin: 0 0 6px;
    font-size: 28px;
    letter-spacing: -0.06em;
}

.detail-head-card p {
    margin: 0;
    color: var(--admin-muted);
}

.detail-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.info-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.info-table > div {
    background: #f8fafc;
    border: 1px solid var(--admin-line);
    border-radius: 14px;
    padding: 13px;
    min-width: 0;
}

.info-table > div.info-wide {
    grid-column: 1 / -1;
}

.info-table span {
    display: block;
    color: var(--admin-muted);
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 5px;
}

.info-table strong {
    display: block;
    word-break: break-all;
}

.memo-box {
    min-height: 90px;
    background: #f8fafc;
    border: 1px solid var(--admin-line);
    border-radius: 14px;
    padding: 15px;
    color: #334155;
}

.admin-form-wide {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.form-textarea {
    width: 100%;
    border: 1px solid var(--admin-line);
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    resize: vertical;
}

.form-textarea:focus {
    border-color: var(--admin-blue);
    box-shadow: 0 0 0 4px rgba(20, 86, 217, .12);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.btn-inline {
    width: auto;
    min-width: 140px;
    padding-left: 18px;
    padding-right: 18px;
}

.sub-title {
    margin: 18px 0 10px;
    font-size: 16px;
    letter-spacing: -0.03em;
}

.timeline {
    display: grid;
    gap: 10px;
}

.timeline-item {
    border: 1px solid var(--admin-line);
    border-radius: 14px;
    padding: 13px;
    background: #f8fafc;
}

.timeline-item strong {
    display: block;
    margin-bottom: 4px;
}

.timeline-item span {
    display: block;
    color: var(--admin-muted);
    font-size: 13px;
}

@media (max-width: 1180px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .detail-head-card {
        display: block;
    }

    .detail-head-actions {
        justify-content: flex-start;
        margin-top: 14px;
    }

    .info-table {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}


/* 견적관리 CSS START */
.estimate-form-grid {
    grid-template-columns: 180px 1fr;
}

.estimate-title-field {
    min-width: 0;
}

.estimate-item-wrap {
    width: 100%;
    overflow-x: auto;
}

.estimate-item-table {
    min-width: 1080px;
}

.estimate-item-table th:nth-child(1),
.estimate-item-table td:nth-child(1) {
    width: 220px;
}

.estimate-item-table th:nth-child(2),
.estimate-item-table td:nth-child(2) {
    width: 130px;
}

.estimate-item-table th:nth-child(3),
.estimate-item-table td:nth-child(3) {
    width: 90px;
}

.estimate-item-table th:nth-child(4),
.estimate-item-table td:nth-child(4) {
    width: 130px;
}

.estimate-item-table th:nth-child(5),
.estimate-item-table td:nth-child(5) {
    width: 90px;
}

.estimate-item-table th:nth-child(7),
.estimate-item-table td:nth-child(7) {
    width: 80px;
}

.estimate-search-grid {
    grid-template-columns: 160px 160px 1fr 120px;
}

.admin-table tfoot th {
    background: #f8fafc;
    border-top: 2px solid var(--admin-line);
    font-size: 15px;
}

@media (max-width: 760px) {
    .estimate-form-grid,
    .estimate-search-grid {
        grid-template-columns: 1fr;
    }
}
/* 견적관리 CSS END */
