:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-main);
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1e1b4b, var(--bg-dark));
}

.pin-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.2s;
}

.pin-dot.active {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 300px;
    margin: 0 auto;
}

.num-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.num-btn:active {
    background: var(--primary);
    border-color: var(--primary);
}

/* Dashboard */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

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

.stat-card {
    background: linear-gradient(145deg, var(--bg-card), rgba(30, 41, 59, 0.5));
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Search */
.search-bar {
    position: relative;
    margin-bottom: 30px;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    padding-left: 50px;
    font-size: 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-main);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Client List */
.client-list {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.client-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s;
    gap: 20px;
}

.client-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.client-info {
    flex: 1;
    min-width: 0;
}

.client-info h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.client-meta {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.client-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.client-services {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.service-tag {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-weight: 500;
}

.client-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .client-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .client-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .client-meta {
        flex-direction: column;
        gap: 8px;
    }
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    color: var(--text-light);
    background: var(--primary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius);
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.2s;
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

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

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header>div:last-child {
        width: 100%;
        justify-content: space-between;
    }

    .client-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .client-info {
        width: 100%;
    }

    .client-meta {
        flex-direction: column;
        gap: 8px;
    }

    .client-status {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10px;
    }

    .input-group label {
        font-size: 0.85rem;
    }

    /* Adjust Numpad for smaller screens */
    .numpad {
        gap: 12px;
    }

    .num-btn {
        width: 56px;
        height: 56px;
        font-size: 1.2rem;
    }

    /* Dashboard Mobile Styles */
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start !important;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .search-box {
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }

    .tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .modal-content {
        max-width: 95%;
        padding: 20px;
        max-height: 95vh;
    }
}