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

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: #1a1a2e;
    background: #f0f2f5;
}

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

.sidebar {
    width: 250px;
    background: #1a1a2e;
    color: #fff;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    padding: 0 1.5rem 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.sidebar a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    display: block;
    transition: all 0.15s;
}

.sidebar a:hover,
.sidebar a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card h3 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card .value {
    font-size: 2rem;
    font-weight: 700;
}

.card .sub {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.25rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #666;
}

tr:hover td {
    background: #f8f9fa;
}

tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-free { background: #e8e8e8; color: #666; }
.badge-lite { background: #dbeafe; color: #1d4ed8; }
.badge-pro { background: #fef3c7; color: #92400e; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-expired { background: #e8e8e8; color: #666; }
.badge-refunded { background: #fce7f3; color: #9d174d; }

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-primary {
    background: #1a1a2e;
    color: #fff;
}

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

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #1a1a2e;
}

.login-box {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.login-box h1 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.error-message {
    color: #dc2626;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle .slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.2s;
}

.toggle .slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle input:checked + .slider {
    background: #16a34a;
}

.toggle input:checked + .slider::before {
    transform: translateX(20px);
}

tr.clickable {
    cursor: pointer;
}
