* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background: #f3f6fa;
    color: #172033;
}

a {
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

/* LOGIN */

.login-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(circle at top left, #193a66 0, transparent 35%),
        linear-gradient(135deg, #081827, #102c4c);
}

.login-card {
    width: 420px;
    max-width: calc(100% - 30px);
    background: #ffffff;
    padding: 36px;
    border-radius: 14px;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.25);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
}

.login-brand h1 {
    margin: 0;
    font-size: 24px;
}

.login-brand p {
    margin: 3px 0 0;
    color: #69809b;
}

.brand-mark {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 52px;
    height: 52px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2274e5, #36a3ff);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
}

.login-card h2 {
    margin: 0 0 6px;
}

.login-subtitle {
    color: #718096;
    margin-bottom: 26px;
}

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

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

.form-group input {
    width: 100%;
    height: 46px;
    border: 1px solid #d5dce5;
    border-radius: 8px;
    padding: 0 13px;
    outline: none;
}

.form-group input:focus {
    border-color: #2274e5;
    box-shadow: 0 0 0 3px rgba(34, 116, 229, 0.12);
}

.alert-error {
    background: #fff0f0;
    border: 1px solid #ffcccc;
    color: #b91c1c;
    padding: 11px 12px;
    border-radius: 7px;
    margin-bottom: 18px;
}

.login-footer {
    margin-top: 22px;
    text-align: center;
    color: #98a5b5;
    font-size: 12px;
}

/* APP */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0d1f34, #102a46);
    color: white;
    padding: 22px 16px;
}

.sidebar-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 4px 4px 26px;
}

.sidebar-brand strong {
    display: block;
    font-size: 17px;
}

.sidebar-brand span {
    display: block;
    font-size: 12px;
    color: #7fc1ff;
    margin-top: 4px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.menu-item {
    color: #dce7f2;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.menu-item:hover,
.menu-item.active {
    background: #176bd6;
    color: white;
}

.sidebar-system {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 18px;
}

.sidebar-system h4 {
    margin: 0 0 16px;
    color: #7fc1ff;
    font-size: 13px;
}

.system-row {
    margin-bottom: 14px;
}

.system-row span {
    display: block;
    color: #b4c3d2;
    font-size: 12px;
    margin-bottom: 4px;
}

.system-row strong {
    font-size: 12px;
}

.status-active {
    display: inline-block;
    background: #198754;
    padding: 4px 8px;
    border-radius: 5px;
}

.sidebar-footer {
    color: #8ea3b7;
    margin-top: 20px;
    font-size: 12px;
}

.main-content {
    width: calc(100% - 250px);
    margin-left: 250px;
    padding: 0 24px 35px;
}

.topbar {
    height: 88px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    margin: 0;
    font-size: 25px;
}

.topbar p {
    margin: 5px 0 0;
    font-size: 13px;
    color: #7c8997;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-logout {
    color: #b42318;
    font-size: 13px;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 21px;
    box-shadow: 0 3px 10px rgba(20, 40, 70, 0.06);
    border: 1px solid #e8edf3;
}

.stat-label {
    color: #526374;
    font-size: 13px;
    font-weight: 600;
}

.stat-number {
    margin-top: 10px;
    font-weight: 800;
    font-size: 31px;
}

.stat-small {
    font-size: 18px;
    margin-top: 17px;
}

.stat-note {
    margin-top: 8px;
    color: #8a99a8;
    font-size: 12px;
}

.panel {
    background: white;
    border: 1px solid #e6ebf0;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(20, 40, 70, 0.05);
}

.panel-header {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    gap: 20px;
}

.panel-header h2 {
    margin: 0;
    font-size: 18px;
}

.panel-header p {
    margin: 5px 0 0;
    color: #8996a3;
    font-size: 12px;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input {
    width: 350px;
    height: 38px;
    border: 1px solid #d8dee6;
    border-radius: 6px;
    padding: 0 12px;
}

.btn-primary {
    border: 0;
    background: #176bd6;
    color: white;
    padding: 0 17px;
    min-height: 38px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary:hover {
    background: #105cb9;
}

.btn-secondary {
    display: flex;
    align-items: center;
    border: 1px solid #d6dde5;
    color: #4a5968;
    padding: 0 14px;
    border-radius: 6px;
    background: white;
}

.btn-full {
    width: 100%;
    height: 47px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

thead {
    background: #f8fafc;
}

th {
    text-align: left;
    color: #435265;
    padding: 12px 11px;
    border-top: 1px solid #e8edf2;
    border-bottom: 1px solid #e8edf2;
    white-space: nowrap;
}

td {
    padding: 11px;
    border-bottom: 1px solid #edf1f5;
    vertical-align: top;
}

tbody tr:hover {
    background: #f8fbff;
}

.ihale-title {
    min-width: 260px;
    max-width: 390px;
    line-height: 1.45;
}

.money {
    text-align: right;
    font-weight: 700;
}

.nowrap {
    white-space: nowrap;
}

.badge-success {
    display: inline-block;
    background: #e5f7eb;
    color: #16794a;
    padding: 5px 7px;
    border-radius: 5px;
    white-space: nowrap;
}

.btn-view {
    display: inline-block;
    background: #176bd6;
    color: white;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: #8a98a7;
}

.pagination-bar {
    min-height: 64px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #627384;
    font-size: 12px;
}

.pagination {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pagination a {
    display: flex;
    width: 32px;
    height: 32px;
    justify-content: center;
    align-items: center;
    border: 1px solid #d7dee6;
    border-radius: 5px;
    color: #176bd6;
    font-size: 20px;
}

.pagination-bar select {
    height: 34px;
    border: 1px solid #d7dee6;
    border-radius: 5px;
    padding: 0 8px;
    background: white;
}

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

    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 760px) {
    .sidebar {
        display: none;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 0 12px 25px;
    }

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

    .topbar {
        height: auto;
        padding: 18px 0;
        align-items: flex-start;
        gap: 18px;
    }

    .search-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .search-form input {
        width: 100%;
    }
}
