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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 60px;
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.domain-info {
    font-size: 1.1rem;
    margin-top: 5px;
    opacity: 0.9;
    font-weight: 600;
}

.sync-status {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-status.syncing {
    background: rgba(255, 193, 7, 0.3);
}

.sync-status.synced {
    background: rgba(46, 204, 113, 0.3);
}

.sync-status.error {
    background: rgba(231, 76, 60, 0.3);
}

/* Bỏ các style cho config section */

.tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.1);
}

.tab {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab.active {
    background: rgba(255, 255, 255, 0.2);
    border-bottom: 3px solid white;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.input-group input, .input-group select, .input-group textarea {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
}

.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.full-width {
    grid-column: 1 / -1;
}

.add-btn {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.add-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(86, 171, 47, 0.3);
}

.add-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bill-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

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

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

tr:hover {
    background-color: #f8f9ff;
}

.delete-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.summary-card h3 {
    color: #d63031;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.summary-card .amount {
    font-size: 2rem;
    font-weight: bold;
    color: #2d3436;
}

.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.print-btn {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
}

.clear-btn {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
    color: white;
}

.save-btn {
    background: linear-gradient(135deg, #00b894 0%, #55a3ff 100%);
    color: white;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #636e72;
}

/* Summary Tab Styles */
.filter-section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    color: white;
}

.filter-section label {
    color: white;
    font-weight: 600;
}

.filter-section select, .filter-section input {
    background: rgba(255, 255, 255, 0.9);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stat-card h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #00b894 0%, #55a3ff 100%);
}

.notification.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
}

.notification.warning {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer a {
    color: #4facfe;
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .input-section, .config-form {
        grid-template-columns: 1fr;
    }

    .summary, .filter-section {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
    }

    .header h1 {
        font-size: 2rem;
    }

    table {
        font-size: 14px;
    }

    th, td {
        padding: 10px 8px;
    }

    .sync-status {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 15px;
        justify-content: center;
    }
    
    .container {
        margin-bottom: 80px;
    }
}

@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        background: white;
    }

    .header {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
    }

    .tabs, .input-section, .actions, .sync-status, .config-section, .footer {
        display: none;
    }

    .tab-content {
        display: block !important;
        padding: 20px;
    }
}
