*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
    background-color: #041F41;
    color: #EAF3F8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #1278C8;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #16CAF5;
}

img {
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
}

table {
    border-collapse: collapse;
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Header */
.app-header {
    background-color: #041F41;
    border-bottom: 1px solid #0B4D91;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.brand-primary {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #FFFFFF;
    letter-spacing: 1px;
}

.brand-secondary {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #16CAF5;
    letter-spacing: 0.5px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #EAF3F8;
    padding: 6px 0;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #16CAF5;
}

.nav-logout {
    color: #667085;
}

.nav-logout:hover {
    color: #EF4444;
}

/* Footer */
.app-footer {
    background-color: #041F41;
    border-top: 1px solid #0B4D91;
    padding: 20px 32px;
    text-align: center;
    margin-top: auto;
}

.app-footer p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: #667085;
}

/* Main */
.app-main {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 32px;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #FFFFFF;
    background-color: #1278C8;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #0B4D91;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #EAF3F8;
    background-color: #0B4D91;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: #1278C8;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 6px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.btn-icon:hover {
    background-color: rgba(102, 112, 133, 0.15);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #EAF3F8;
    margin-bottom: 6px;
}

.form-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #FFFFFF;
    background-color: #041F41;
    border: 1px solid #667085;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    border-color: #1278C8;
}

.form-input::placeholder {
    color: #667085;
}

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px - 60px - 80px);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: #0B4D91;
    border-radius: 8px;
    padding: 48px 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #FFFFFF;
    margin-bottom: 8px;
}

.login-tagline {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #16CAF5;
}

.login-error {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #EF4444;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid #EF4444;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 20px;
}

/* Modules Page */
.modules-page {
    padding: 0;
}

.modules-header {
    margin-bottom: 40px;
}

.modules-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 28px;
    color: #FFFFFF;
    margin-bottom: 6px;
}

.modules-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 15px;
    color: #667085;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.module-card {
    display: block;
    background-color: #0B4D91;
    border-radius: 8px;
    overflow: hidden;
    transition: background-color 0.2s ease;
}

.module-card:hover {
    background-color: #1278C8;
}

.module-card-indicator {
    height: 4px;
}

.module-card-body {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.module-card-icon {
    flex-shrink: 0;
}

.module-card-info {
    flex: 1;
}

.module-card-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #FFFFFF;
    margin-bottom: 2px;
}

.module-card-count {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: #667085;
}

.module-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.online {
    animation: pulse-dot 2s infinite;
}

.status-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: #667085;
}

.online-text {
    color: #16CAF5;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Module Detail */
.module-detail {
    padding: 0;
}

.detail-header {
    margin-bottom: 28px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #667085;
    margin-bottom: 16px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #16CAF5;
}

.detail-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 28px;
    color: #FFFFFF;
    margin-bottom: 20px;
}

.detail-summary {
    display: flex;
    gap: 40px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-value {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #FFFFFF;
}

.summary-label {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-actions {
    margin-bottom: 28px;
}

/* Table */
.table-container {
    background-color: #0B4D91;
    border-radius: 8px;
    overflow: hidden;
}

.accounts-table {
    width: 100%;
    border-collapse: collapse;
}

.accounts-table thead {
    background-color: #041F41;
}

.accounts-table th {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 14px 20px;
}

.accounts-table td {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #EAF3F8;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(102, 112, 133, 0.2);
}

.accounts-table tbody tr:nth-child(even) {
    background-color: rgba(4, 31, 65, 0.3);
}

.accounts-table tbody tr:hover {
    background-color: rgba(18, 120, 200, 0.1);
}

.cell-id {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #667085;
}

.account-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 13px;
    text-transform: capitalize;
}

.status-dot-inline {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-online {
    color: #16CAF5;
}

.status-offline {
    color: #667085;
}

.status-error {
    color: #EF4444;
}

.status-paused {
    color: #1278C8;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: #0B4D91;
    border-radius: 8px;
}

.empty-state p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #667085;
    margin-top: 16px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(4, 31, 65, 0.8);
}

.modal-content {
    position: relative;
    z-index: 1001;
    width: 100%;
    max-width: 480px;
    background-color: #0B4D91;
    border-radius: 8px;
    padding: 32px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: #FFFFFF;
}

.modal-form .form-group {
    margin-bottom: 16px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 2000;
    padding: 14px 24px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #FFFFFF;
    animation: toast-in 0.3s ease;
}

.toast-success {
    background-color: #10B981;
}

.toast-error {
    background-color: #EF4444;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
