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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.subtitle {
    color: #666;
    font-size: 0.95rem;
}

.auth-section {
    text-align: center;
    margin-bottom: 20px;
}

.btn-primary {
    padding: 14px 28px;
    background: #0066ff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
    background: #0052cc;
}

.btn-primary:active {
    transform: scale(0.98);
}

.results-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
    padding: 40px;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #0066ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    display: none;
    background: #fff5f5;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid #fed7d7;
}

.error.active {
    display: block;
}

.summary {
    display: none;
    text-align: center;
    padding: 20px;
    background: #f0f7ff;
    border-radius: 10px;
    margin-bottom: 20px;
}

.summary.active {
    display: block;
}

.summary-count {
    font-size: 3rem;
    font-weight: 700;
    color: #0066ff;
}

.summary-label {
    font-size: 0.95rem;
    color: #555;
    margin-top: 5px;
}

.tabs-results {
    display: none;
}

.tabs-results.active {
    display: block;
}

.tab-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.tab-item:last-child {
    border-bottom: none;
}

.tab-item:hover {
    background: #fafafa;
}

.tab-name {
    font-weight: 500;
    color: #333;
}

.tab-count {
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-badge {
    background: #0066ff;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.count-badge.zero {
    background: #e0e0e0;
    color: #666;
}

.status-icon {
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.share-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
}

.share-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.share-info {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.btn-secondary {
    padding: 12px 20px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.link-output {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.link-output input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #f9f9f9;
}

.btn-small {
    padding: 10px 16px;
    background: #0066ff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-small:hover {
    background: #0052cc;
}

.last-updated {
    margin-top: 15px;
}

/* Login Section */
.login-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    max-width: 400px;
    margin: 0 auto;
}

.login-form .input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.input-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #0066ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.input-group input::placeholder {
    color: #aaa;
}

/* Admin Panel */
.admin-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.groups-section, .sheets-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.groups-section h3, .sheets-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.section-info {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.group-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.group-form .input-group {
    margin-bottom: 0;
}

.preview-section {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.preview-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.preview-count {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.preview-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
}

.preview-empty {
    color: #888;
    font-style: italic;
}

.sheets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.sheet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.sheet-name {
    font-size: 0.9rem;
    color: #333;
}

.btn-filter {
    background: #e0e0e0;
    color: #555;
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-filter:hover {
    background: #d0d0d0;
}

.logout-section {
    text-align: center;
    padding: 20px 0;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Views Section */
.views-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
}

.views-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.views-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.view-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.view-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.view-title {
    font-weight: 600;
    color: #333;
}

.view-details {
    font-size: 0.85rem;
    color: #666;
}

.view-actions {
    display: flex;
    gap: 8px;
}

.btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-delete:hover {
    background: #fecaca;
}

.empty-views {
    color: #888;
    text-align: center;
    padding: 20px;
}

.password-info {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-align: center;
}

.button-row {
    display: flex;
    gap: 10px;
}

.button-row .btn-secondary,
.button-row .btn-primary {
    flex: 1;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .results-section {
        padding: 20px;
    }
}
