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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #333;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.5s ease-out;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    color: white;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.header-text h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.header-text p {
    color: #888;
    font-size: 1.2rem;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: #667eea;
    font-weight: 600;
}

.user-role {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 4px;
    margin-left: 0.5rem;
}

.logout-btn {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #f87171;
}

.logout-btn:hover {
    background: rgba(248, 113, 113, 0.2);
    transform: translateY(-1px);
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: #667eea;
    font-weight: 600;
    animation: fadeInUp 0.5s ease-out 0.1s backwards;
}

.sync-status.syncing {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.3);
    color: #60a5fa;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #333;
    color: #e0e0e0;
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.nav-btn.admin-only {
    background: linear-gradient(135deg, #333 0%, #444 100%);
    border: 1px solid #555;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

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

.stat-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #333;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #888;
    font-weight: 600;
    font-size: 1rem;
}

.customers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.customer-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #333;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: backwards;
}

.customer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #444;
}

.customer-info h3 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.customer-info p {
    color: #888;
    font-size: 0.9rem;
}

.device-info {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #e0e0e0;
    margin-bottom: 1rem;
}

.toner-levels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.toner-item {
    text-align: center;
    position: relative;
}

.toner-circle {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border-radius: 50%;
    position: relative;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.toner-circle::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: conic-gradient(
        var(--toner-color) var(--percentage),
        #333 var(--percentage)
    );
    z-index: -1;
}

.toner-circle.low {
    color: #fbbf24;
}

.toner-circle.critical {
    color: #f87171;
}

.toner-label {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #888;
}

.card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #333;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    animation: fadeInUp 0.5s ease-out;
}

.card h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-success {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    margin: 0 0.2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

thead tr {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th, td {
    padding: 1rem;
    text-align: left;
}

tbody tr {
    border-bottom: 1px solid #333;
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
}

.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: none;
    animation: slideIn 0.3s ease-out;
}

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #667eea;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #333;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #1a1a1a;
    color: #e0e0e0;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    color: #667eea;
    font-size: 1.5rem;
}

.close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #e0e0e0;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #333;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.unassigned-section {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.5s ease-out 0.3s backwards;
}

.unassigned-warning {
    color: #f87171;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.price-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.log-box {
    background: #0d0d0d;
    border: 1px solid #333;
    padding: 1rem;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #888;
}

.log-box div {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

hr {
    border: none;
    border-top: 1px solid #333;
    margin: 1rem 0;
}

.stat-card.warning {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-color: rgba(248, 113, 113, 0.3);
}

.stat-card.warning .stat-number {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card.alert {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

.stat-card.alert .stat-number {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    cursor: pointer;
}

.admin-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.admin-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.admin-link:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.no-access {
    text-align: center;
    padding: 4rem;
    color: #888;
}

.no-access h3 {
    color: #f87171;
    margin-bottom: 1rem;
}

.letter-group {
    grid-column: 1/-1;
    display: none;
}

.letter-group {
    grid-column: 1/-1;
    display: none;
}

.waste-toner-warning {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        border-color: rgba(248, 113, 113, 0.3);
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0);
    }
    50% {
        border-color: rgba(248, 113, 113, 0.5);
        box-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
    }
}