:root {
    --blue: #0f5fd7;
    --blue-dark: #0b3f93;
    --blue-light: #eaf3ff;
    --white: #ffffff;
    --bg: #f4f8fd;
    --text: #172033;
    --muted: #6d7b91;
    --border: #dbe5f2;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --radius: 16px;
    --shadow: 0 16px 45px rgba(15, 95, 215, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
}

.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(15, 95, 215, 0.25), transparent 35%),
        linear-gradient(135deg, #f7fbff 0%, #dcecff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 430px;
}

.login-card {
    background: var(--white);
    border-radius: 24px;
    padding: 34px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.login-logo h1 {
    margin: 0;
    font-size: 20px;
    color: var(--blue-dark);
}

.login-logo p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.logo-icon {
    width: 66px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(15, 95, 215, 0.28);
}

.logo-icon.small {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 20px;
}

.form-group {
    margin-bottom: 17px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
    color: #27364f;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 13px;
    font-size: 15px;
    outline: none;
    transition: 0.2s ease;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(15, 95, 215, 0.12);
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: white;
    border: none;
    border-radius: 13px;
    padding: 12px 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 95, 215, 0.22);
    transition: 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 95, 215, 0.28);
}

.full-width {
    width: 100%;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-weight: 700;
    font-size: 14px;
}

.alert-danger {
    background: #fff1f2;
    color: #b91c1c;
    border: 1px solid #fecdd3;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 22px;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
        justify-content: center;
}

.sidebar-brand strong {
    display: block;
    color: var(--blue-dark);
    font-size: 20px;
}

.sidebar-brand span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav a {
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 13px;
    color: #30415f;
    font-weight: 700;
    transition: 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--blue-light);
    color: var(--blue-dark);
}

.sidebar-footer {
    margin-top: auto;
}

.user-box {
    padding: 14px;
    border-radius: 14px;
    background: var(--blue-light);
    margin-bottom: 12px;
}

.user-box strong {
    display: block;
    color: var(--blue-dark);
}

.user-box span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.logout-link {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #334155;
    font-weight: 800;
}

.main-content {
    margin-left: 270px;
    padding: 30px;
    width: calc(100% - 270px);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0;
    color: var(--blue-dark);
    font-size: 20px;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 10px 28px rgba(15, 95, 215, 0.07);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-card strong {
    font-size: 30px;
    color: var(--blue-dark);
}

.stat-card.success strong {
    color: var(--success);
}

.stat-card.warning strong {
    color: var(--warning);
}

.stat-card.danger strong {
    color: var(--danger);
}

.table-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 10px 28px rgba(15, 95, 215, 0.07);
    overflow: hidden;
}

.table-card-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
}

.table-card-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--blue-dark);
}

.table-card-header p {
    margin: 5px 0 0;
    color: var(--muted);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1050px;
}

.modern-table th {
    background: #f8fbff;
    color: #314562;
    font-size: 13px;
    text-align: left;
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.modern-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
    vertical-align: middle;
}

.modern-table tr:hover td {
    background: #fbfdff;
}

.empty-row {
    text-align: center;
    color: var(--muted);
    padding: 30px !important;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-muted {
    background: #f1f5f9;
    color: #475569;
}

.table-link {
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

.muted {
    color: var(--muted);
}

.action-buttons {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.btn-small {
    border: none;
    background: var(--blue-light);
    color: var(--blue-dark);
    border-radius: 10px;
    padding: 7px 10px;
    font-weight: 800;
    cursor: pointer;
}

.btn-small.danger {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 18px;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 24px;
    }
}

.lic-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 18px;
}

.lic-modal-overlay.show {
    display: flex;
}

.lic-modal {
    width: min(980px, 100%);
    max-height: 92vh;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 25px 80px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lic-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #ffffff, #eef6ff);
}

.lic-modal-header h2 {
    margin: 0;
    color: var(--blue-dark);
    font-size: 18px;
}

.lic-modal-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.lic-modal-close {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 14px;
    background: #eaf3ff;
    color: var(--blue-dark);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    font-weight: 700;
}

.lic-modal-body {
    padding: 22px;
    overflow-y: auto;
}

.modal-loading {
    padding: 30px;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}

.lic-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.lic-form-grid .full {
    grid-column: 1 / -1;
}

.lic-section-title {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    padding: 12px 14px;
    background: var(--blue-light);
    color: var(--blue-dark);
    border-radius: 13px;
    font-weight: 900;
}

.lic-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: none;
    border-radius: 13px;
    padding: 12px 18px;
    font-weight: 800;
    cursor: pointer;
}

.btn-generate {
    background: #eff6ff;
    color: var(--blue-dark);
    border: 1px solid #bfdbfe;
    border-radius: 13px;
    padding: 11px 15px;
    font-weight: 900;
    cursor: pointer;
}

.generated-info {
    display: none;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #dcfce7;
    color: #166534;
    font-size: 14px;
    font-weight: 700;
}

.generated-info.show {
    display: block;
}

.lic-file-note {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

textarea.license-preview {
    min-height: 110px;
    font-family: Consolas, monospace;
    font-size: 12px;
}

@media (max-width: 700px) {
    .lic-form-grid {
        grid-template-columns: 1fr;
    }

    .lic-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .lic-actions button {
        width: 100%;
    }
}

.pcs-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pcs-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 12px 14px;
    font-weight: 800;
    color: #30415f;
}

.pcs-check-item input {
    width: 18px;
    height: 18px;
}

code {
    background: #f1f5f9;
    color: #1e3a8a;
    padding: 3px 6px;
    border-radius: 7px;
    font-size: 12px;
}

@media (max-width: 700px) {
    .pcs-check-grid {
        grid-template-columns: 1fr;
    }

    .logo-icon.small {
        font-size: 13px;
    }
}

.pcs-assigned-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pcs-assigned-item {
    border: 1px solid var(--border);
    background: #f8fbff;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

@media (max-width: 700px) {
    .pcs-assigned-item {
        flex-direction: column;
        align-items: stretch;
    }
}
.pcs-client-system-grid {
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.pcs-system-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 95, 215, 0.06);
}

.pcs-system-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.pcs-system-card-head strong {
    display: block;
    color: var(--blue-dark);
    font-size: 18px;
}

.pcs-system-card-head span {
    display: block;
    color: var(--muted);
    margin-top: 4px;
    font-size: 13px;
}

.pcs-system-card-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pcs-system-card-body div {
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 11px;
}

.pcs-system-card-body span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.pcs-system-card-body strong {
    color: #24364f;
    font-size: 14px;
}

.pcs-system-modules {
    margin-top: 14px;
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .pcs-client-system-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .pcs-system-card-body {
        grid-template-columns: 1fr;
    }
}
.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 700px) {
    .topbar-actions {
        width: 100%;
        justify-content: stretch;
    }

    .topbar-actions button,
    .topbar-actions a {
        width: 100%;
        justify-content: center;
    }
}