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

html {
    background: #05070f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #05070f 0%, #0a0d18 100%);
    min-height: 100vh;
    color: #fff;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #0f121d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #6c63ff, #a78bfa);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
    box-shadow: 0 8px 32px rgba(108,99,255,0.4);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-header p {
    font-size: 13px;
    color: #94a3b8;
}

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

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: #1a1f2e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.form-group input::placeholder {
    color: #64748b;
}

.form-group input:focus {
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #6c63ff, #8b5cf6);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(108,99,255,0.35);
}

.btn-secondary {
    padding: 12px 20px;
    background: #1a1f2e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
}

.error-msg {
    color: #f87171;
    font-size: 12px;
    margin-top: 8px;
    text-align: center;
}

/* Dashboard */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

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

.title {
    font-size: 28px;
    font-weight: 700;
}

.btn-logout {
    padding: 8px 16px;
    background: #0f121d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #1a1f2e;
    color: #fff;
}

.toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .toolbar {
        grid-template-columns: 1fr;
    }
}

.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #64748b;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    background: #1a1f2e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

.toolbar .btn-primary {
    width: auto;
    white-space: nowrap;
    padding: 12px 20px;
    margin-top: 0;
}

/* Ticket Grid */
.ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

@media (max-width: 768px) {
    .ticket-grid {
        grid-template-columns: 1fr;
    }
}

.ticket-card {
    background: #0f121d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}

.ticket-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6c63ff, #a78bfa);
    opacity: 0;
    transition: opacity 0.2s;
}

.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border-color: rgba(108,99,255,0.3);
}

.ticket-card:hover::before {
    opacity: 1;
}

.ticket-card.picked-up {
    background: rgba(34,197,94,0.05);
    border-color: rgba(34,197,94,0.25);
}

.ticket-card.picked-up::before {
    opacity: 1;
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.ticket-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ticket-number {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 20px;
    font-weight: 500;
}

.ticket-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticket-badge.open {
    background: rgba(250,204,21,0.12);
    border: 1px solid rgba(250,204,21,0.2);
    color: #facc15;
}

.ticket-badge.picked {
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.2);
    color: #22c55e;
}

.ticket-name {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 12px;
}

.ticket-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 14px;
}

.ticket-info-label {
    font-size: 12px;
    color: #64748b;
}

.ticket-info-value {
    font-size: 14px;
    font-weight: 600;
}

.ticket-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

@media (max-width: 768px) {
    .ticket-actions {
        grid-template-columns: 1fr;
    }
}

.btn-toggle {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid;
}

.btn-toggle.mark-picked {
    background: rgba(34,197,94,0.15);
    border-color: rgba(34,197,94,0.25);
    color: #22c55e;
}

.btn-toggle.mark-picked:hover {
    background: rgba(34,197,94,0.25);
}

.btn-toggle.mark-open {
    background: #1a1f2e;
    border-color: rgba(255,255,255,0.08);
    color: #94a3b8;
}

.btn-toggle.mark-open:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
}

.btn-delete {
    padding: 8px 12px;
    background: rgba(248,113,113,0.1);
    border: 1px solid rgba(248,113,113,0.2);
    border-radius: 10px;
    color: #f87171;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: rgba(248,113,113,0.2);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    opacity: 0.4;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 6px;
}

.empty-text {
    font-size: 13px;
    color: #64748b;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(20px);
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    background: #0f121d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal-header p {
    font-size: 12px;
    color: #94a3b8;
}

.required {
    color: #ef4444;
    font-weight: 600;
}

.optional {
    font-size: 11px;
    font-weight: 400;
    color: #64748b;
}

.numpad-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
}

.numpad-display span:first-child {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 40px;
    font-weight: 300;
    min-width: 40px;
    text-align: center;
}

.numpad-display .label {
    font-size: 13px;
    color: #64748b;
}

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

.numpad button {
    height: 44px;
    background: #1a1f2e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #fff;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s;
}

.numpad button:hover {
    background: rgba(255,255,255,0.08);
}

.numpad button:active {
    transform: scale(0.94);
    background: rgba(255,255,255,0.14);
}

.numpad button.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.numpad button.back {
    background: rgba(248,113,113,0.1);
    border-color: rgba(248,113,113,0.15);
    color: #f87171;
}

.numpad button.back:hover {
    background: rgba(248,113,113,0.18);
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
    padding-top: 10px;
    position: sticky;
    bottom: 0;
    background: #0f121d;
}

.modal-actions .btn-primary {
    margin-top: 0;
}

/* Screensaver */
.screensaver {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5,7,15,0.96);
    backdrop-filter: blur(40px);
    animation: fadeIn 0.3s ease;
}

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

.screensaver-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px;
    max-width: 300px;
    width: 100%;
}

.lock-icon {
    width: 52px;
    height: 52px;
    background: rgba(108,99,255,0.2);
    border: 1px solid rgba(108,99,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    margin-bottom: 16px;
}

.screensaver-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.screensaver-content p {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 28px;
}

.pin-dots {
    display: flex;
    gap: 14px;
    margin-bottom: 8px;
}

.pin-dots .dot {
    width: 12px;
    height: 12px;
    border: 2px solid #64748b;
    border-radius: 50%;
    background: transparent;
    transition: all 0.15s;
}

.pin-dots .dot.filled {
    border-color: #a78bfa;
    background: #a78bfa;
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(167,139,250,0.5);
}

.pin-error {
    color: #f87171;
    font-size: 12px;
    height: 16px;
    margin-bottom: 16px;
}

.pin-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 260px;
    margin-top: 12px;
}

.pin-numpad button {
    width: 68px;
    height: 68px;
    margin: 0 auto;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.pin-numpad button:hover {
    background: rgba(255,255,255,0.1);
}

.pin-numpad button:active {
    transform: scale(0.92);
    border-color: rgba(108,99,255,0.4);
    background: rgba(108,99,255,0.3);
}

.pin-numpad button span {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 24px;
    font-weight: 300;
    color: #fff;
}

.pin-numpad button small {
    font-size: 7px;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: #64748b;
    margin-top: 2px;
}

.pin-numpad button.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.pin-numpad button.back-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
}

.pin-numpad button.back-btn:hover {
    background: rgba(255,255,255,0.06);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.4s ease;
}
