* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top, rgba(59,130,246,0.06), transparent 24%),
        #f3f6fb;
    color: #172033;
    overflow-x: hidden;
}
body { min-height: 100vh; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
textarea { resize: vertical; }

.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main-content {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.topbar__left,
.topbar__right,
.topbar__user,
.profile-box,
.hero-actions,
.profile-actions,
.section__head {
    display: flex;
    align-items: center;
}

.topbar__left {
    gap: 14px;
    min-width: 0;
}

.topbar__left > div { min-width: 0; }
.topbar__left h1 {
    margin: 0 0 4px;
    font-size: 28px;
    line-height: 1.25;
}

.topbar__left p,
.topbar__user small,
.section__head p,
.notice-box small,
.service-card p,
.notes-list,
.profile-box p {
    margin: 0;
    color: #66748f;
}

.menu-toggle {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid #dce4f2;
    background: #fff;
    cursor: pointer;
    display: none;
    position: relative;
    font-size: 0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}
.menu-toggle::before,
.menu-toggle::after,
.menu-toggle span {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    height: 2px;
    border-radius: 999px;
    background: #1f2a44;
}
.menu-toggle::before { top: 15px; }
.menu-toggle span { top: 22px; }
.menu-toggle::after { top: 29px; }

.topbar__user {
    gap: 12px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #e4ebf5;
    padding: 10px 14px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(20, 40, 90, 0.05);
}

.avatar-circle,
.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.avatar-circle { width: 42px; height: 42px; }

.notice-box,
.hero-card,
.stat-card,
.service-card,
.panel,
.page-card,
.order-card,
.order-note,
.order-history {
    background: rgba(255,255,255,0.92);
    border: 1px solid #e5ebf5;
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.notice-box {
    padding: 18px 20px;
    margin-bottom: 20px;
    line-height: 1.65;
}

.hero-grid,
.stat-grid,
.service-grid,
.content-grid,
.order-layout {
    display: grid;
    gap: 20px;
}
.hero-grid { grid-template-columns: 1.6fr 1fr; margin-bottom: 20px; }
.hero-card { padding: 26px; }
.hero-card--welcome { background: linear-gradient(135deg, #ffffff, #f7faff); }
.hero-card--welcome h2,
.section__head h2,
.service-card h3,
.profile-box h3 { margin: 0 0 10px; }
.hero-card--welcome p { margin: 0; max-width: 780px; line-height: 1.7; color: #55627c; }

.badge,
.tag,
.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.badge { background: #eaf2ff; color: #2457d6; padding: 8px 12px; margin-bottom: 16px; }
.hero-actions,
.profile-actions { gap: 12px; margin-top: 22px; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    text-decoration: none;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform .16s ease, box-shadow .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { color: #fff; background: linear-gradient(135deg, #2563eb, #3b82f6); box-shadow: 0 12px 24px rgba(37,99,235,.18); }
.btn--light,.btn--outline { color: #21304b; background: #fff; border-color: #d8e1ef; }
.btn--dark { color: #fff; background: #111827; }

.profile-stats { display: grid; gap: 12px; margin-top: 18px; }
.profile-stats div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed #e4eaf3;
}
.profile-stats div:last-child { border-bottom: 0; }
.profile-stats span { color: #6b778d; }
.profile-avatar { width: 64px; height: 64px; font-size: 24px; }
.profile-box { gap: 14px; }

.stat-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
.stat-card { padding: 22px; }
.stat-card span { display: block; color: #6d7890; margin-bottom: 10px; }
.stat-card strong { font-size: 28px; }
.section { margin-bottom: 20px; }
.section__head { justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section__head--small { margin-bottom: 18px; }
.service-grid { grid-template-columns: repeat(4, 1fr); }
.service-card { padding: 22px; }
.service-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.tag { background: #eef5ff; color: #2d65d4; padding: 7px 11px; }
.service-link { display: inline-block; margin-top: 14px; text-decoration: none; color: #1f6fff; font-weight: 700; }
.content-grid { grid-template-columns: 1.5fr 1fr; }
.panel { padding: 22px; }
.table-wrap,.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table, table { width: 100%; border-collapse: collapse; }
.data-table th,.data-table td, th, td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid #e8eef6;
    white-space: nowrap;
}
.data-table th, th { font-size: 14px; color: #68758d; background: #f8fafc; }
.status-pill { background: #edf7ed; color: #207245; padding: 7px 11px; }
.notes-list { padding-left: 18px; line-height: 1.9; }

/* order page */
.order-shell { width: 100%; min-width: 0; }
.order-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.order-balance {
    background: rgba(255,255,255,0.92);
    border: 1px solid #dbe4f1;
    color: #2563eb;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}
.order-layout { grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr); margin-bottom: 20px; }
.order-card,.order-note,.order-history { padding: 22px; }
.page-title { margin: 0; font-size: 28px; line-height: 1.2; }
.page-subtitle { margin: 6px 0 0; color: #66748f; }
.card-title { font-size: 18px; font-weight: 700; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid #e8eef6; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; color: #172033; }
.form-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #d8e2f0;
    border-radius: 14px;
    font-size: 15px;
    outline: none;
    background: #f8fbff;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.form-control:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59,130,246,.10);
}
textarea.form-control { min-height: 120px; }
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single {
    height: 48px !important;
    border: 1px solid #d8e2f0 !important;
    border-radius: 14px !important;
    background: #f8fbff !important;
    display: flex !important;
    align-items: center !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 46px !important;
    padding-left: 14px !important;
    padding-right: 36px !important;
    color: #172033 !important;
    font-size: 15px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
    right: 10px !important;
}
.select2-dropdown { border: 1px solid #d8e2f0 !important; border-radius: 14px !important; overflow: hidden; }
.select2-search--dropdown { padding: 10px; }
.select2-search__field {
    min-height: 40px;
    border-radius: 10px !important;
    border: 1px solid #d8e2f0 !important;
    padding-left: 12px !important;
}
.reactions-wrapper { display: flex; gap: 10px; flex-wrap: wrap; }
.reaction-item {
    cursor: pointer;
    border: 1px solid #dbe4f1;
    border-radius: 14px;
    padding: 10px 14px;
    background: #f8fbff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: .18s ease;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
}
.reaction-item:hover,.reaction-item.active {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #2563eb;
    transform: translateY(-1px);
}
.reaction-item input { display: none; }
.reaction-item span { font-size: 20px; }
.price-box {
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
    border: 1px dashed #93c5fd;
    padding: 18px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 20px;
}
.price-box span { font-size: 14px; color: #1e40af; display: block; margin-bottom: 6px; font-weight: 600; }
.price-box strong { font-size: clamp(24px, 5vw, 32px); color: #2563eb; font-weight: 800; letter-spacing: -.3px; }
.order-note ul { list-style: none; padding: 0; margin: 0; font-size: 14px; color: #66748f; }
.order-note li { display: flex; gap: 8px; margin-bottom: 12px; }
.order-note li:last-child { margin-bottom: 0; }
.order-note b:first-child { color: #2563eb; }
.alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 20px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge { padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef3c7; color: #92400e; }

@media (max-width: 1199px) {
    .service-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991px) {
    .main-content { padding: 16px; }
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 46px;
    }
    .hero-grid,
    .content-grid,
    .service-grid,
    .stat-grid,
    .order-layout { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .topbar__right,.topbar__user { width: 100%; }
    .topbar__user { justify-content: flex-start; }
}

@media (max-width: 576px) {
    .main-content { padding: 14px; }
    .topbar__left { width: 100%; }
    .topbar__left h1, .page-title { font-size: 22px; }
    .hero-card,.panel,.service-card,.stat-card,.notice-box,.order-card,.order-note,.order-history { padding: 16px; border-radius: 18px; }
    .btn { width: 100%; }
    .hero-actions .btn, .profile-actions .btn { width: 100%; }
    .avatar-circle { width: 38px; height: 38px; }
    .data-table th,.data-table td,th,td { padding: 12px 10px; font-size: 13px; }
    .reactions-wrapper { gap: 8px; }
    .reaction-item { flex: 1 1 calc(50% - 8px); justify-content: center; min-width: 110px; }
}
