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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #d2691e 0%, #cd5c5c 50%, #b7410e 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

h1 {
    color: #b7410e;
    margin-bottom: 10px;
    font-size: 2em;
}

.statistics {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff8dc;
    border-radius: 8px;
    border: 2px solid #d2b48c;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 1.1em;
    color: #333;
    font-weight: 500;
}

.stat-value {
    font-weight: 700;
    color: #b7410e;
    font-size: 1.2em;
}

.ip-reset-timestamp {
    font-style: italic;
    color: #666;
    vertical-align: middle;
}

.info {
    color: #666;
    margin-bottom: 25px;
    font-size: 0.95em;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #d2b48c;
    flex-wrap: wrap;
}

.tab-button {
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 0.95em;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.tab-button:hover {
    color: #b7410e;
    background-color: #fff8dc;
}

.tab-button.active {
    color: #b7410e;
    border-bottom-color: #d2691e;
    font-weight: 600;
}

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

.tab-name {
    flex: 1;
}

.hide-button, .show-button {
    font-size: 1.2em;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
}

.hide-button:hover, .show-button:hover {
    opacity: 1;
    background-color: rgba(183, 65, 14, 0.1);
}

.show-more-button {
    background: #4CAF50;
    border: none;
    padding: 12px 20px;
    font-size: 0.95em;
    font-weight: 500;
    color: white;
    cursor: pointer;
    border-radius: 6px;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.show-more-button:hover {
    background: #45a049;
    transform: scale(1.05);
}

.toggle-hidden-button {
    background: #d2b48c;
    border: none;
    padding: 12px 20px;
    font-size: 0.95em;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    border-radius: 6px;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.toggle-hidden-button:hover {
    background: #cd853f;
    color: white;
}

.tag-buttons-container {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
}

.tag-button {
    background: white;
    border: 2px solid #d2b48c;
    padding: 8px 16px;
    font-size: 0.95em;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.tag-button:hover {
    background: #fff8dc;
    border-color: #b7410e;
    color: #b7410e;
    transform: scale(1.05);
}

.tag-button.active {
    background: #b7410e;
    border-color: #b7410e;
    color: white;
    font-weight: 600;
}

.tag-button.active:hover {
    background: #8b2e0b;
    border-color: #8b2e0b;
}

.tag-button-empty {
    font-size: 1.2em;
    line-height: 1;
    opacity: 0.6;
}

.tag-button.active .tag-button-empty {
    opacity: 1;
}

.hidden-tabs-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #d2b48c;
}

.hidden-tabs-header {
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hidden-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tab-button.hidden-tab {
    opacity: 0.7;
    font-style: italic;
}

.tab-button.hidden-tab:hover {
    opacity: 1;
}

.tab-content {
    display: none;
}

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

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #d2b48c;
}

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

thead {
    background: linear-gradient(135deg, #d2691e 0%, #cd5c5c 50%, #b7410e 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: #fff8dc;
}

tbody tr.account-done {
    background-color: #d4edda !important;
}

tbody tr.account-done:hover {
    background-color: #c3e6cb !important;
}

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

td {
    padding: 12px 15px;
    font-size: 0.9em;
}

.done-toggle-cell {
    text-align: center;
    width: 50px;
    padding: 8px !important;
}

.done-toggle-btn {
    background: transparent;
    border: 2px solid #d2b48c;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.done-toggle-btn:hover {
    background-color: #fff8dc;
    border-color: #b7410e;
    transform: scale(1.1);
}

.done-toggle-btn[data-done="true"] {
    background-color: #d4edda;
    border-color: #28a745;
}

.done-toggle-btn[data-done="true"]:hover {
    background-color: #c3e6cb;
    border-color: #218838;
}

.done-toggle-btn[data-done="false"] {
    background-color: #fff;
    border-color: #d2b48c;
}

.done-toggle-btn[data-done="false"]:hover {
    background-color: #fff8dc;
    border-color: #b7410e;
}

.done-icon {
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    color: #28a745;
}

.done-toggle-btn[data-done="true"] .done-icon {
    color: #dc3545;
}

.done-toggle-btn[data-done="false"] .done-icon {
    color: #28a745;
}

.copyable {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
    word-break: break-all;
}

.copyable:hover {
    background-color: #ffe4b5 !important;
    transform: scale(1.02);
}

.copyable.copied {
    background-color: #8b4513 !important;
    color: white;
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.copyable::after {
    content: '📋';
    opacity: 0;
    margin-left: 8px;
    font-size: 0.8em;
    transition: opacity 0.2s ease;
}

.copyable:hover::after {
    opacity: 0.5;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #8b4513;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 300px;
    word-break: break-all;
    font-size: 0.9em;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Popup overlay and container */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-container {
    width: 90%;
    height: 90%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    animation: slideIn 0.3s ease;
    position: relative;
}

@keyframes slideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.popup-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    font-weight: 600;
    color: #333;
    text-align: center;
    word-break: break-all;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.popup-content:hover {
    color: #b7410e;
    transform: scale(1.05);
}

.popup-content.password-state {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.popup-content.totp-state {
    font-family: 'Courier New', monospace;
    letter-spacing: 8px;
    font-size: 72px;
}

/* Stats page styling */
.stats-container {
    max-width: 1200px;
}

.stats-section {
    margin-bottom: 40px;
}

.stats-section h2 {
    color: #b7410e;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #d2b48c;
    padding-bottom: 10px;
}

.last-done-container {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    padding: 20px;
    background-color: #fff8dc;
    border-radius: 8px;
    border: 2px solid #d2b48c;
}

.last-done-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.last-done-label {
    font-size: 1em;
    color: #666;
    font-weight: 500;
}

.last-done-value {
    font-size: 1.5em;
    color: #b7410e;
    font-weight: 700;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.stats-table thead {
    background: linear-gradient(135deg, #d2691e 0%, #cd5c5c 50%, #b7410e 100%);
    color: white;
}

.stats-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

.stats-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.stats-table tbody tr:hover {
    background-color: #fff8dc;
}

.stats-table tbody tr:last-child {
    border-bottom: none;
}

.stats-table td {
    padding: 12px 15px;
    font-size: 0.9em;
}

.stats-table td strong {
    color: #b7410e;
    font-weight: 600;
}

.stats-table tbody tr.zero-total {
    opacity: 0.5;
    color: #999;
    background-color: #f5f5f5;
}

.stats-table tbody tr.zero-total:hover {
    background-color: #e8e8e8;
}

.stats-table tbody tr.zero-total td strong {
    color: #999;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    th, td {
        padding: 10px;
        font-size: 0.85em;
    }
    
    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

