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

body {
    background-color: #0D1117;
    color: #e6edf3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: #B44CE0;
    text-decoration: none;
}

a:hover {
    color: #c977e8;
}

.navbar {
    background-color: #161B22;
    border-bottom: 1px solid #30363d;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #5B3CC4, #B44CE0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 32px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    color: #8b949e;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #e6edf3;
    background-color: #21262d;
}

.nav-link.active {
    color: #e6edf3;
    background-color: #21262d;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user {
    color: #8b949e;
    font-size: 14px;
}

.btn-logout {
    background: none;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-logout:hover {
    color: #e6edf3;
    border-color: #8b949e;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px 40px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #e6edf3;
}

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

.page-header .page-title {
    margin-bottom: 0;
}

.search-input {
    background-color: #0D1117;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    width: 280px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #5B3CC4;
    box-shadow: 0 0 0 3px rgba(91, 60, 196, 0.2);
}

.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    background-color: #161B22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px 24px;
    flex: 1;
    min-width: 150px;
    border-left: 4px solid #30363d;
}

.stat-card.stat-total {
    border-left-color: #5B3CC4;
}

.stat-card.stat-active {
    border-left-color: #3fb950;
}

.stat-card.stat-expired {
    border-left-color: #f85149;
}

.stat-card.stat-suspended {
    border-left-color: #d29922;
}

.stat-card.stat-pending {
    border-left-color: #8b949e;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-total .stat-value { color: #B44CE0; }
.stat-active .stat-value { color: #3fb950; }
.stat-expired .stat-value { color: #f85149; }
.stat-suspended .stat-value { color: #d29922; }
.stat-pending .stat-value { color: #8b949e; }

.stat-label {
    font-size: 13px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card {
    background-color: #161B22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #e6edf3;
}

.activate-card {
    border-left: 4px solid #5B3CC4;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #8b949e;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background-color: #0D1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #5B3CC4;
    box-shadow: 0 0 0 3px rgba(91, 60, 196, 0.2);
}

.form-group input::placeholder {
    color: #484f58;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 180px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #5B3CC4, #B44CE0);
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4e33ab, #a040c8);
    box-shadow: 0 2px 8px rgba(91, 60, 196, 0.4);
}

.btn-secondary {
    background-color: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
}

.btn-secondary:hover {
    background-color: #30363d;
}

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

.btn-success:hover {
    background-color: #2ea043;
}

.btn-warning {
    background-color: #9e6a03;
    color: #ffffff;
}

.btn-warning:hover {
    background-color: #b07d09;
}

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

.btn-danger:hover {
    background-color: #f85149;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
}

.select-sm {
    padding: 4px 8px;
    background-color: #0D1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #e6edf3;
    font-size: 12px;
}

.input-sm {
    padding: 4px 8px;
    background-color: #0D1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #e6edf3;
    font-size: 12px;
    width: 130px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #161B22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background-color: #0D1117;
}

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #30363d;
}

td {
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid #21262d;
}

tbody tr:nth-child(even) {
    background-color: #1c2128;
}

tbody tr:hover {
    background-color: #21262d;
}

.nowrap {
    white-space: nowrap;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.extend-form,
.expiry-form {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

code {
    background-color: #0D1117;
    border: 1px solid #30363d;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 13px;
    color: #FFD700;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-active {
    background-color: rgba(63, 185, 80, 0.15);
    color: #3fb950;
}

.status-expired {
    background-color: rgba(248, 81, 73, 0.15);
    color: #f85149;
}

.status-suspended {
    background-color: rgba(210, 153, 34, 0.15);
    color: #d29922;
}

.status-pending {
    background-color: rgba(139, 148, 158, 0.15);
    color: #8b949e;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-register { background-color: rgba(91, 60, 196, 0.2); color: #B44CE0; }
.badge-activated { background-color: rgba(63, 185, 80, 0.2); color: #3fb950; }
.badge-suspended { background-color: rgba(210, 153, 34, 0.2); color: #d29922; }
.badge-reactivated { background-color: rgba(63, 185, 80, 0.2); color: #3fb950; }
.badge-extended { background-color: rgba(0, 188, 212, 0.2); color: #00BCD4; }
.badge-expiry-updated { background-color: rgba(0, 188, 212, 0.2); color: #00BCD4; }
.badge-auto-expired { background-color: rgba(248, 81, 73, 0.2); color: #f85149; }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background-color: rgba(63, 185, 80, 0.1);
    border: 1px solid rgba(63, 185, 80, 0.3);
    color: #3fb950;
}

.alert-error {
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: #f85149;
}

.empty-state {
    text-align: center;
    color: #8b949e;
    padding: 32px;
    font-size: 14px;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0D1117 0%, #161B22 50%, #0D1117 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 24px;
}

.login-card {
    background-color: #161B22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 40px 32px;
}

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

.brand-title {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #5B3CC4, #B44CE0, #00BCD4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.brand-subtitle {
    color: #8b949e;
    font-size: 14px;
}

@media (max-width: 768px) {
    .stats-row {
        flex-direction: column;
    }

    .stat-card {
        min-width: auto;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        min-width: auto;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .search-input {
        width: 100%;
    }

    .navbar {
        padding: 0 12px;
    }

    .nav-links {
        display: none;
    }

    .container {
        padding: 72px 12px 24px;
    }

    .actions-cell {
        flex-direction: column;
        align-items: flex-start;
    }
}

input[type="date"] {
    color-scheme: dark;
}
