* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

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

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f766e 0%, #1d4ed8 100%);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 24px;
    padding: 36px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}

.login-logo, .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    color: #ffffff;
    background: linear-gradient(135deg, #14b8a6, #2563eb);
    font-weight: 800;
}

.login-card h1 {
    margin: 20px 0 8px;
    font-size: 28px;
}

.login-card p {
    margin: 0 0 24px;
    color: #64748b;
}

label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 700;
    color: #334155;
}

input, select, textarea {
    width: 100%;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
}

input:focus, select:focus, textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

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

.sidebar {
    width: 270px;
    background: #0f172a;
    color: #ffffff;
    padding: 24px;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,.10);
}

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

.brand small {
    color: #94a3b8;
}

.menu {
    padding-top: 22px;
}

.menu-item, .menu-group a {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.menu-item:hover, .menu-group a:hover {
    background: rgba(255,255,255,.08);
    color: #ffffff;
}

.menu-group {
    margin-top: 18px;
}

.menu-group span {
    display: block;
    margin: 0 0 8px 14px;
    color: #38bdf8;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
}

.content {
    flex: 1;
    margin-left: 270px;
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    background: #ffffff;
    border-radius: 22px;
    padding: 22px 24px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, .06);
    margin-bottom: 24px;
}

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

.topbar p {
    margin: 0;
    color: #64748b;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border-radius: 16px;
    padding: 10px 12px;
}

.user-box span {
    font-weight: 700;
}

.user-box small {
    color: #64748b;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.card {
    background: #ffffff;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, .06);
}

.metric span {
    display: block;
    color: #64748b;
    font-weight: 700;
}

.metric strong {
    display: block;
    margin-top: 10px;
    font-size: 28px;
    color: #0f172a;
}

.page-title {
    margin: 0 0 18px;
}

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

.form-grid .full {
    grid-column: 1 / -1;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 800;
    cursor: pointer;
    transition: .2s;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-success {
    background: #0f766e;
    color: #ffffff;
}

.btn-light {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-block {
    width: 100%;
    margin-top: 18px;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

th, td {
    padding: 13px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge-ok {
    background: #dcfce7;
    color: #166534;
}

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

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.alert {
    border-radius: 14px;
    padding: 13px 15px;
    margin-bottom: 16px;
    font-weight: 700;
}

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

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

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.search-bar input {
    max-width: 420px;
}

.hint {
    display: block;
    margin-top: 18px;
    color: #64748b;
    text-align: center;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 10px;
}

@media (max-width: 960px) {
    .sidebar {
        position: static;
        width: 100%;
    }
    .app {
        display: block;
    }
    .content {
        margin-left: 0;
    }
    .cards, .form-grid {
        grid-template-columns: 1fr;
    }
    .topbar, .user-box, .search-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .item-row {
        grid-template-columns: 1fr;
    }
}
